Changing Control Files location in Oracle

We will demonstrate how to change control files location.

  • 1-Query the V$CONTROLFILE view to find the control files location.
  • SQL> select name from v$controlfile;
    
    NAME
    --------------------------------------------------------------------------------
    /u00/oracle/oradata/RCAT/control01.ctl
    /u00/oracle/flash_recovery_area/RCAT/control02.ctl
  • 2-When we are moving control files we have to alter their location using the values stored in the control_files parameter. To find it's values use the following syntax:
  • SQL> show parameter control_files
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    control_files                        string      /u00/oracle/oradata/RCAT/contr
                                                     ol01.ctl, /u00/oracle/flash_re
                                                     covery_area/RCAT/control02.ctl
  • 3-Shutdown your database.
  • SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
  • 4-Start up your database in mount mode.
  • SQL> startup mount;
    ORACLE instance started.
    
    Total System Global Area 1603411968 bytes
    Fixed Size                  2213776 bytes
    Variable Size            1006635120 bytes
    Database Buffers          587202560 bytes
    Redo Buffers                7360512 bytes
    Database mounted.
  • 5-Move your control files to the new location.
  • mv /u00/oracle/oradata/RCAT/control01.ctl /u01/oracle/oradata/RCAT/control01.ctl
    mv /u00/oracle/flash_recovery_area/RCAT/control02.ctl /u01/oracle/oradata/RCAT/control02.ctl
  • 5-Alter the control_files parameter so that will match the new control_files location.
  • ALTER SYSTEM SET control_files='/u01/oracle/oradata/RCAT/control01.ctl','/u01/oracle/oradata/RCAT/control02.ctl' SCOPE=SPFILE;
    System altered.
  • 6-Bounce your database and check your control_files location.
  • SQL> select name from v$controlfile;
    
    NAME
    --------------------------------------------------------------------------------
    /u01/oracle/oradata/RCAT/control01.ctl
    /u01/oracle/oradata/RCAT/control02.ctl
    
    SQL>