May 5, 2016

PRVF-5300 : Failed to retrieve active version for CRS on this node

When i am trying to install the non-RAC database installation fails with the below error

PRVF-5300 : Failed to retrieve active version for CRS on this node

MOS DOC: Installation of Standalone (Non-RAC) 11gR2 Database Fails with Errors: "PRVF-5300, PRKC-1033, PRCT-1406" (Doc ID 1380126.1)

The issue is we have the RAC setup in past on this server and we have removed few days back. Now we are trying to install the Oracle Restart (ASM+DB) but installation failing.

Here we have identified the problem, as OCR/OLR is still present in the server due to that installation failing.  Once you removed the OCR/OLR that solves the our problem.

Check the OCR/OLR locations
[oracle@test dba]$ ls -lhrt /etc/ocr.loc
ls: /etc/ocr.loc: No such file or directory
[oracle@test dba]$ ls -lhrt /etc/oracle/olr.loc
-rw-r----- 1 root oinstall 103 Jul 22  2015 /etc/oracle/olr.loc

so, here olr is present in server level. Remove the olr disk and start the installation


Happy Learning :)

May 2, 2016

How to resize the datafile in Primary

Resize the datafile help us when there is not much space is available in the OS level.
1.Check the datafiles under the tablespace.

SQL> SELECT FILE_NAME,TABLESPACE_NAME,BYTES/1024/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024/1024 MAXSIZE FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='PROD_DATA';

FILE_NAME                                        TABLESPACE_NAME                BYTES/1024/1024/1024 AUT    MAXSIZE
------------------------------------------------ ------------------------------ -------------------- --- ----------
+DATA/PROD/DATAFILE/prod_data2.256.894385677   PROD_DATA                                365 YES        374

Here only 9gb free space left. 

2. Check is there any provisioned disks are there to add. 

SQL> col path for a35
Select path,disk_number,name,mount_status,header_status,os_mb/1024,total_mb/1024,free_mb/1024,FAILGROUP from v$asm_disk where header_status<>'MEMBER' ;

no rows selected

3. Now identify the HWM for the datafile for how much space to we can resize. The below script will prompt for the datafile.

set linesize 400
col tablespace_name format a20
col file_size format 9999999
col file_name format a66
col hwm format 9999999
col can_save format 99999
SELECT tablespace_name, file_name, file_size, hwm, file_size-hwm can_save FROM (SELECT /*+ RULE */ ddf.tablespace_name, ddf.file_name file_name,
ddf.bytes/1048576 file_size,(ebf.maximum + de.blocks-1)*dbs.db_block_size/1048576 hwm 
FROM dba_data_files ddf,(SELECT file_id, MAX(block_id) maximum FROM dba_extents GROUP BY file_id) ebf,dba_extents de,
(SELECT value db_block_size FROM v$parameter WHERE name='db_block_size') dbs WHERE ddf.file_id = ebf.file_id 
AND de.file_id = ebf.file_id AND ddf.file_name='&Datafile_Name' and de.block_id = ebf.maximum ORDER BY 1,2); 

 Enter value for Datafile: +DATA/PROD/DATAFILE/prod_data2.256.894385677 

TABLESPACE_NAME      FILE_NAME                                                           FILE_SIZE        HWM CAN_SAVE
-------------------- ------------------------------------------------------------------ ---------- ---------- --------
PROD_DATA     +DATA/PROD/DATAFILE/prod_data2.256.894385677         373760     361254    12506

Based on the above output we came to know that we can save upto 12506mb. 

4. Resize the datafile

SQL> alter database datafile '+DATA/PROD/DATAFILE/prod_data2.256.894385677' resize 361255m;

Database altered.

Now check the utilization.


SQL> SELECT FILE_NAME,TABLESPACE_NAME,BYTES/1024/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024/1024 MAXSIZE FROM DBA_DATA_FILES WHERE TABLESPACE_NAME='PROD_DATA';

FILE_NAME                                        TABLESPACE_NAME                BYTES/1024/1024/1024 AUT    MAXSIZE
------------------------------------------------ ------------------------------ -------------------- --- ----------
+DATA/PROD/DATAFILE/prod_data2.256.894385677    PROD_DATA                                352.78   YES        374

If it has standby, the above change will reflect on standby as well. No need to take any action on standby.

Happy Learning :)