Oracle June 10, 2011 0

How to multiply control files in Oracle DB RAC 11g

This examle shows how to multiply control files in Oracle Database RAC 11g.

An example cluster database racdb1 is up and running on two nodes (rac1 and rac2)
Two database instances: [racdb11] and [racdb12]

1. SHUTDOWN the database and start an instance [racdb11] only on the first node (rac1) and check the current configuration.

Next, shutdown an instance and start it up into “nomount” mode
[oracle@rac1 ~]$ srvctl stop DATABASE -d racdb1

[oracle@rac1 ~]$ sqlplus / as sysdba
SQL> startup
 ...
 ...
DATABASE mounted.
DATABASE opened.

SQL> SHOW parameter control_files

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +RACDB_DATA/racdb1/controlfile
 /current.256.709676643, +FRA/r
 acdb1/controlfile/current.256.
 709676647

SQL> SELECT name FROM v$controlfile;

NAME
--------------------------------------------------------------------------------
+RACDB_DATA/racdb1/controlfile/current.256.709676643
+FRA/racdb1/controlfile/current.256.709676647

SQL> shutdown immediate
DATABASE closed.
DATABASE dismounted.
ORACLE instance shut down.
Start oracle DATABASE IN nomount state ON node 1 [racdb11].

SQL> startup nomount
ORACLE instance started.

2. See current control files on ASM in DATA and FRA (grid user is my asmadmin)

[grid@rac1 ~]$ asmcmd 
ASMCMD> ls RACDB_DATA/RACDB1/CONTROLFILE/ Current.256.709676643
ASMCMD> ls FRA/RACDB1/CONTROLFILE/ Current.256.709676647

3. Multiply control files using RMAN as follows (as a dba user, here oracle)

[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 10 11:11:11 2111
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RACDB1 (not mounted)

RMAN> restore controlfile to '+RACDB_DATA' from '+RACDB_DATA/RACDB1/CONTROLFILE/Current.256.709676643';

Starting restore at 10-JUN-2011 11:11:12
using channel ORA_DISK_1
channel ORA_DISK_1: copied control file copy
Finished restore at 10-JUN-2011 11:11:13

RMAN> restore controlfile to '+FRA' from '+FRA/RACDB1/CONTROLFILE/Current.256.709676647';

Starting restore at 10-JUN-2011 12:00:53
using channel ORA_DISK_1
channel ORA_DISK_1: copied control file copy
Finished restore at 10-JUN-2011 12:01:11

RMAN> exit
Recovery Manager complete.

4. Again, check control files on ASM in DATA and FRA (as a grid user)

[grid@rac1 ~]$ asmcmd   
ASMCMD> ls RACDB_DATA/RACDB1/CONTROLFILE/ Current.256.709676643 current.269.753451111   
ASMCMD> ls FRA/RACDB1/CONTROLFILE/ Current.256.709676647 current.261.753451255

Now, we can observe that multiple control files have been created.

5. Next, connect to SQLPlus and create pfile using spfile.

[oracle@rac1 ~]$ sqlplus / as sysdba 

SQL> CREATE pfile FROM spfile; 
File created.   

#Shutdown DATABASE. 

SQL> Shutdown immediate; 
ORA-01507: DATABASE NOT mounted ORACLE instance shut down.

 

6. Edit $ORACLE_HOME/dbs/initracdb11.ora and modify the following control_files parameter:

From:

*.control_files='+RACDB_DATA/racdb1/controlfile/current.256.709676643', '+FRA/racdb1/controlfile/current.256.709676647'

To (one line in editor):

*.control_files='+RACDB_DATA/racdb1/controlfile/current.256.709676643', '+RACDB_DATA/racdb1/controlfile/current.269.753451111', '+FRA/racdb1/controlfile/current.256.709676647', '+FRA/racdb1/controlfile/current.261.753451255'

7. Start Oracle Database using pfile on the first node (rac1)

SQL> startup pfile=/u01/app/oracle/product/11.2.0/db_1/dbs/initracdb11.ora
ORACLE instance started.
...
...
Database mounted.
Database opened.

SQL> create spfile from pfile ;
File created.

8. Restart database on the first node [racdb11]

SQL> startup force
...
...
DATABASE opened.

SQL> SHOW parameter control_files

+RACDB_DATA/racdb1/controlfile/current.256.709676643, 
+RACDB_DATA/racdb1/controlfile/current.269.753451111, 
+FRA/racdb1/controlfile/current.256.709676647, 
+FRA/racdb1/controlfile/current.261.753451255

9. Shutdown database instance on the first node [racdb11]:

SQL> shutdown immediate;

Database closed.

Database dismounted.

Following steps need to be carry out on the second node, here rac2 [racdb12]

10. Start oracle database in nomount state on the second and create pfile from spfile.

SQL> startup nomount 
ORACLE instance started. 
... 
... 
SQL> CREATE pfile FROM spfile; 
File created.

11. Shutdown Oracle database instance [racdb12]

SQL> shutdown immediate; 
DATABASE closed. 
DATABASE dismounted.

12. Edit $ORACLE_HOME/dbs/initracdb12.ora and modify the following control_files parameter:

#from
*.control_files='+RACDB_DATA/racdb1/controlfile/current.256.709676643', '+FRA/racdb1/controlfile/current.256.709676647'

# to (one line in editor)

*.control_files='+RACDB_DATA/racdb1/controlfile/current.256.709676643', '+RACDB_DATA/racdb1/controlfile/current.269.753451111', '+FRA/racdb1/controlfile/current.256.709676647', '+FRA/racdb1/controlfile/current.261.753451255'

13. Start oracle database on the second node using pfile

SQL> startup pfile=/u01/app/oracle/product/11.2.0/db_1/dbs/initracdb12.ora;
DATABASE opened.

--Check the control_files parameter:

SQL> SHOW parameter control_files;

+RACDB_DATA/racdb1/controlfile/current.256.709676643, 
+RACDB_DATA/racdb1/controlfile/current.269.753451111, 
+FRA/racdb1/controlfile/current.256.709676647, 
+FRA/racdb1/controlfile/current.261.753451255

14. Create spfile from pfile and shutdown oracle database instance two [racdb12]

SQL> CREATE spfile FROM pfile; 
File created.   

SQL> shutdown immediate 
DATABASE closed. 
DATABASE dismounted.

16. Finally, start Oracle Cluster Database racdb1 on both nodes.

On the firts node (rac1)

[oracle@rac1 ~]$ srvctl start database -d racdb1 

[oracle@rac1 ~]$ srvctl status database -d racdb1 
Instance racdb11 is running on node rac1 
Instance racdb12 is running on node rac2

Cheers!!