Showing posts with label RMAN. Show all posts
Showing posts with label RMAN. Show all posts

Thursday, August 28, 2014

RMAN Active Duplicate Database from RAC ASM to RAC ASM


Some Tips:

1) Always make sure to have relative soft link to tnsnames.ora & listener.ora in $ORACLE_HOME/network/admin if they are in non-default location (like in Oracle EBS: tnsnames.ora & listener.ora exist in $ORACLE_HOME/network/admin/SID_hostname Directory)

2) Make Appropriate TNS Entry in all RAC (Target / Auxiliary) Nodes, with local listener host and port, so that instance name wise service get registered for active duplicate. (Dynamic registration with SCAN doesn't work)

PREPROD=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=inblrdrdbadm01.tajhotels.com)(PORT=1555))
            (CONNECT_DATA=
                (SERVICE_NAME=PREPROD1)
                (INSTANCE_NAME=PREPROD1)
                 (UR = A)
            )
        )

3) Mention DB_FILE_NAME_CONVERT & LOG_FILE_NAME_CONVERT properly, if there are any datafiles / online redo log files with OMF/Non-OMF and within same Disk Group.

SQL> show parameter convert

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----------------------------------------------------------------------------
db_file_name_convert                 string      +DATA_DR/EBSPRD, +DATA_DR/PREPROD,
log_file_name_convert                string      +DATA_DR/EBSPRD, +RECO_DR/PREPROD, +RECO_DR/EBSPRD, +RECO_DR/PREPROD


References:

STEP BY STEP RMAN DUPLICATE Database From RAC ASM To RAC ASM (Doc ID 1913937.1)

RMAN DUPLICATE / RESTORE including Standby in ASM with OMF / non-OMF / Mixed Name for Datafile / Online Log / Controlfile (Doc ID 1910175.1)

Tuesday, August 19, 2014

Multiplexing Control File 11gR2 RAC with ASM

1. Connect to the database from any one for the RAC node and check the current control file status. Here, I am having my control file in the +DATA_DC disk group and I want to add another disk group +RECO_DC for multiplexing/mirroring.

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------------------------------------------------
control_files                        string      +DATA_DC/PROD/controlfile/current.41119.852341131

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA_DC/PROD/controlfile/current.41119.852341131

2. Add the +RECO_DC Diskgroup to the control file by issuing the below command.

SQL> alter system set control_files='+DATA_DC/PROD/controlfile/current.41119.852341131','+RECO_DC' scope=spfile;

System altered.

3. Shutdown the RAC database and start the database in nomount mode.

[oracle@dbrac1 ~]$ srvctl stop database -d PROD

[oracle@dbrac1 ~]$ srvctl status database -d PROD
Instance PROD1 is not running on node inmumdcdbadm01
Instance PROD2 is not running on node inmumdcdbadm02

4. Connect to the DB and you will see the +RECO_DC being part of the control file.

[oracle@dbrac1 ~]$ sqlplus "/as sysdba"

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1.7103E+10 bytes
Fixed Size                  2245512 bytes
Variable Size            3724545144 bytes
Database Buffers         1.3355E+10 bytes
Redo Buffers               21708800 bytes

SQL> show parameter control_files

NAME                                 TYPE        VALUE
------------------------------------ ----------- --------------------------------------------------------------
control_files                        string      +DATA_DC/PROD/controlfile/current.41119.852341131, +RECO_DC

5. Connect to the RMAN and issuer restore command to create a copy of the control file from the +RECO_DC disk group.

[oracle@dbrac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Aug 19 19:06:13 2014

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

connected to target database: PROD (not mounted)

RMAN> restore controlfile from '+DATA_DC/PROD/controlfile/current.41119.852341131';

Starting restore at 19-AUG-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1415 instance=PROD1 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+DATA_DC/PROD/controlfile/current.41119.852341131
output file name=+RECO_DC/PROD/controlfile/current.3123.856033587
Finished restore at 19-AUG-14

RMAN> exit

6. Connect back to the data base and issue alter command with the exact path of the file that was created by the restore of RMAN.

[oracle@dbrac1 ~]$ sqlplus "/as sysdba"

SQL> alter system set control_files='+DATA_DC/PROD/controlfile/current.41119.852341131','+RECO_DC/PROD/controlfile/current.3123.856033587' scope=spfile;

System altered.

7. Now, shutdown the database and start up. Use the below commands.

SQL> Shutdown immediate;

ORA-01507: database not mounted
ORACLE instance shut down.

[oracle@dbrac1 ~]$ srvctl start database -d PROD
Instance PROD1 is running on node inmumdcdbadm01
Instance PROD2 is running on node inmumdcdbadm02

8. Check by connecting to the RAC database, you will see the two copies of control files in two different disk groups, +DATA_DC and +RECO_DC.

[oracle@dbrac1 ~]$ sqlplus "/ as sysdba"

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA_DC/PROD/controlfile/current.41119.852341131
+RECO_DC/PROD/controlfile/current.3123.856033587

SQL> exit