A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

How to move/copy controlfile from filesystem to ASM ??

1 min read
1. Create a pfile as a backup of your spfile
sqlplus '/ as sysdba'

SQL> create pfile='/tmp/spfile-bk.ora' from spfile;
2. Update the control_file parameter in the spfile.
sqlplus '/ as sysdba'

SQL> select name from v$controlfile;

        NAME
        --------------------------------------------------------------------------------
        +DATA01/test/controlfile/current.200.165920580

 SQL> alter system set control_files='+DATA01/test/controlfile/current.200.165920580','+FRA01' scope=spfile sid='*';
3. Shutdown / Startup the database in nomount mode
sqlplus '/ as sysdba'
        
SQL> shutdown immediate;
SQL> startup nomount;
4. Copy the new control file using RMAN.
rman

 RMAN> connect target /
 RMAN> restore controlfile from '+DATA1/test/controlfile/current.200.165920580';

 Starting restore at 01-Aug-23
 allocated channel: ORA_DISK_10
 channel ORA_DISK_1: sid=testinstance=testdevtype=DISK

 channel ORA_DISK_1: copied control file copy
 output filename=+DATA1/test/controlfile/current.200.165920580
 output filename=+FRA01/test/controlfile/current.200.693721750
 Finished restore at 01-Aug-23
5. Modify the spfile with the name of new control file
 sqlplus '/ as sysdba'
 
 SQL> alter system set control_files='+DATA01/test/controlfile/current.200.165920580','+FRA01/test/controlfile/current.200.693721750' scope=spfile sid='*';
6. Shutdown / Startup the database and check the new control file
sqlplus '/ as sysdba'

SQL> shutdown immediate;
SQL> startup;
SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA01/test/controlfile/current.200.165920580
+FRA01/test/controlfile/current.200.693721750

Hope it worked !! 🙂