Even on the latest Oracle Engineered Systems like ODA X6-2S/M there’s only one single controlfile created by default. Despite the storage redundancy there’s always a risk of someone accidentally deleting a file or some logical corruption of the file.
Therefore, we always multiplex the controlfiles and online redo logs. But, what is the easiest way of adding a second controlfile to a database using OMF on a file system?
I think it’s the following procedure. Although, I’m gladly proven wrong with a even more elegant solution.
The command output has been stripped to the relevant information.
$ . oraenv ORACLE_SID = [DUMMY] ? DEV1 $ rman target / -- see, there is only one online log destination RMAN> select name, value from v$parameter where name like 'db_create_online_log_dest_%'; NAME VALUE -------------------------------------- -------------------------------------- db_create_online_log_dest_1 /u03/app/oracle/redo/ db_create_online_log_dest_2 db_create_online_log_dest_3 db_create_online_log_dest_4 db_create_online_log_dest_5 -- set a second online log destination RMAN> alter system set db_create_online_log_dest_2 = '/u02/app/oracle/oradata/DEV1' scope=both; -- get the current controlfile path for later reference in commands RMAN> select value from v$parameter where name = 'control_files'; VALUE -------------------------------------------------------------------------------- /u03/app/oracle/redo/DEV1/controlfile/o1_mf_cwxjo46k_.ctl -- this will make RMAN "restore" command create new controlfiles in all online log destinations RMAN> alter system reset control_files; -- restart instance so parameter changes will take effect RMAN> shutdown immediate -- only start in NOMOUNT as to be able to restore controlfile RMAN> startup nomount -- this will create two new OMF controlfiles based on existing one -- remember, we have reset control_files parameter RMAN> restore controlfile from '/u03/app/oracle/redo/DEV1/controlfile/o1_mf_cwxjo46k_.ctl'; ... channel ORA_DISK_1: copied control file copy output file name=/u03/app/oracle/redo/DEV1/controlfile/o1_mf_cxf4q747_.ctl output file name=/u02/app/oracle/oradata/DEV1/DEV1/controlfile/o1_mf_cxf4q74v_.ctl Finished restore at 12-SEP-16 -- use the two newly created controlfiles at next startup RMAN> alter system set control_files = '/u03/app/oracle/redo/DEV1/controlfile/o1_mf_cxf4q747_.ctl','/u02/app/oracle/oradata/DEV1/DEV1/controlfile/o1_mf_cxf4q74v_.ctl' scope=spfile; -- the old controlfile is not needed anymore RMAN> host "rm /u03/app/oracle/redo/DEV1/controlfile/o1_mf_cwxjo46k_.ctl"; RMAN> startup force
Since I’m using Oracle 12c RMAN is capable of running SQL just like this…no need to change between SQL*Plus and RMAN anymore.
(Please don’t debate the file system structure, it’s from an engineered system. I think it’s horrible!)