Move Oracle Control File to a Different Location



Share this article :

Symptom

You want to move the Oracle control file from location A to location B.

Pre-Checks

• Define your Oracle is using SPFILE or PFILE

SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type"
     FROM sys.v_$parameter WHERE name = 'spfile';

• Define your control file location

SQL> select NAME from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oracle/SID/origlogA/cntrl/cntrlSID.dbf

If your system is using SPFILE

1. Login to the Oracle SQL as SYSDBA

sqlplus "/as sysdba"

2. Change to the new path in the control file with SPFILE scope.

ALTER SYSTEM SET control_files='/oracle/SID/origlogB/cntrl/cntrlSID.dbf' scope=spfile;

3. Shutdown the Oracle

SQL> shutdown immediate;

4. Exit the SQL, go to the old directory of control file and move to the new directory. Advisable to create a backup before moving.

mv /oracle/SID/origlogA/cntrl/cntrlSID.dbf /oracle/SID/origlogB/cntrl/

5. Login to SQL back, startup the Oracle

SQL> startup

6. Verify the control file has been updated in the parameter

SQl> select NAME from V$CONTROLFILE;

If your system is using PFILE

1. Login to the Oracle SQL as SYSDBA

sqlplus "/as sysdba"

2. Change to the new path in the control file, initSID.ora using VI editor.

vi initORA.ora

3. Look for the below entry and change to the new path

*.control_files='/oracle/SID/origlogA/cntrl/cntrlSID.dbf'

4. Shutdown the Oracle

SQL> shutdown immediate;

5. Exit the SQL, go to the old directory control and move to the new directory. Advisable to create a backup before moving.

mv /oracle/SID/origlogA/cntrl/cntrlSID.dbf /oracle/SID/origlogB/cntrl/

6. Login to SQL back, startup the Oracle

SQL> startup

Related posts

Converting between SPFILE or PFILE
ORA-01012: not logged on
ORA-00955: name is already used by an existing object
Changing Oracle Parameter
© 2017 ITsiti. All Rights Reserved
Powered by KEEM