Thursday, August 30, 2012

RAC 11.2 + ASM: Multiplex control files


To add new control file after RAC installation with ASM storage:

1. View current control_files parameter (as oracle owner)

[oracle@oracle-node-1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 30 10:29:53 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/oradb/controlfile/curren
                                                 t.260.792506879
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

2. Stop RAC database

[oracle@oracle-node-1 ~]$ srvctl stop database -d oradb

3. Start database in nomount

[oracle@oracle-node-1 ~]$ srvctl start database -d  oradb  -o nomount

4. Copy the current controlfile in new location with RMAN

[oracle@oracle-node-1 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Aug 30 10:32:57 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORADB (not mounted)

RMAN> restore controlfile to '+FRA' from '+DATA/ oradb /controlfile/current.260.792506879';

Starting restore at 30-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=351 instance= oradb 1 device type=DISK

channel ORA_DISK_1: copied control file copy
Finished restore at 30-AUG-12

RMAN> exit


Recovery Manager complete.

5. View location and name of the new control file with asmcmd (as grid owner)


[grid@oracle-node-1 ~]$ asmcmd
ASMCMD> ls


DATA/
FRA/
ASMCMD> cd fra/ oradb /controlfile
ASMCMD> ls -l
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  UNPROT  FINE     AUG 30 10:00:00  Y    current.270.792671641
ASMCMD> exit


6. Alter parameter control_files to contain both control files names

[oracle@oracle-node-1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 30 10:36:01 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> alter system set control_files='+DATA/oradb/controlfile/current.260.792506879','+FRA/  oradb/controlfile/current.270.792671641' scope=spfile;

System altered.

SQL> startup force;
ORACLE instance started.

Total System Global Area 4008546304 bytes
Fixed Size                  2234560 bytes
Variable Size             838862656 bytes
Database Buffers         3154116608 bytes
Redo Buffers               13332480 bytes
Database mounted.
Database opened.
SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/ oradb /controlfile/curren
                                                 t.260.792506879, +FRA/ oradb /co
                                                 ntrolfile/current.270.79267164
                                                 1
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining, Oracle Database Vault and Real Application Testing options

7. View RAC database status (as grid owner)


[grid@oracle-node-1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
......................
ora.oradb.db
      1        ONLINE  ONLINE       oracle-node-1            Open
      2        ONLINE  INTERMEDIATE oracle-node-2            Dismounted
....................


8. Restart RAC database

[oracle@oracle-node-1 ~]$ srvctl stop database -d oradb
[oracle@oracle-node-1 ~]$ srvctl start database -d oradb

9. Check new setting of parameter control_files

[oracle@oracle-node-1 ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 30 10:40:38 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL> show parameter control

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/oradb/controlfile/curren
                                                 t.260.792506879, +FRA/oradb/co
                                                 ntrolfile/current.270.79267164
                                                 1
control_management_pack_access       string      DIAGNOSTIC+TUNING
SQL>

No comments:

Post a Comment