I've done this several times now and can confirm it's pretty straight forward. You can move and/or rename the controlfiles using this method. This is easy, but it does require some quick downtime. Here are the steps to move and rename the database controlfiles.
- Query your current controlfile locations.
- Alter your system to update to the new names/locations.
- Shutdown the database.
- Move/rename the controlfiles on the server.
- Startup the database.
- Verify the new names and locations.
- Update your pfile from your spfile.
- Cleanup old location.
Query your current controlfile locations.
SQL> select name from v$controlfile;
--------------------------------------------------------------------------------
/u01/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcms_.ctl
/u02/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcn5_.ctl
/u03/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcng_.ctl
Alter your system to update to the new names/locations.
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string
/u01/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcms_.ctl, /u02/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcn5_.ctl, /u03/oradata/orcl/ORCL/controlfile/o1_mf_dhngfcng_.ctl
SQL> alter system set control_files='/oracle/u01/oradata/orcl/controlfile/control01.ctl', -
> '/oracle/u02/oradata/orcl/controlfile/control02.ctl', -
> '/oracle/u03/oradata/orcl/controlfile/control03.ctl' scope=spfile;
System altered.
Shutdown the database.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
Move/rename the controlfiles on the server.
Create new directory locations.
$ cd /u01/oradata/orcl
$ mkdir controlfile
$ cd /u02/oradata/orcl
$ mkdir controlfile
$ cd /u03/oradata/orcl
$ mkdir controlfile
cd to the current location of the control files and move each one to new location, renaming in the process.
$ cd /u01/oradata/orcl/ORCL/controlfile/
$ mv o1_mf_dhngfcms_.ctl ../../controlfile/control01.ctl
$ cd /u02/oradata/orcl/ORCL/controlfile/
$ mv o1_mf_dhngfcn5_.ctl ../../controlfile/control02.ctl
$ cd /u03/oradata/orcl/ORCL/controlfile/
$ mv o1_mf_dhngfcng_.ctl ../../controlfile/control03.ctl
Startup the database.
SQL> startup
ORACLE instance started.
...
Database mounted.
Database opened.
Verify the new names and locations.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/oracle/u01/oradata/orcl/controlfile/control01.ctl
/oracle/u02/oradata/orcl/controlfile/control02.ctl
/oracle/u03/oradata/orcl/controlfile/control03.ctl
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /oracle/u01/oradata/orcl/con
trolfile/control01.ctl, /oracl
e/u02/oradata/orcl/controlfi
le/control02.ctl, /oracle/u03/
oradata/orcl/controlfile/con
trol03.ctl
Update your pfile from your spfile.
SQL> create pfile from spfile;
File created.
Cleanup old location.
$ rmdir controlfile
$ cd ..
$ rmdir ORCL
Backup your database!
Backup your database!
cool - thanks
ReplyDelete