Saturday, November 11, 2017

Dataguard Rebuild- Active RMAN Clone

Dataguard Rebuild- Active RMAN Clone

#######################################################
#README_DG_Rebuild.txt                               #
# 1. amxd - /home/scripts/README_DG_Rebuild.txt #
#######################################################

In order to rebuild DG on amxd:

1.  Shutdown DG
              sqlplus “/as sysdba”
              shut immediate

2.  Clean up the following directories:
               cd /DG/data01/controlfiles
                --rm *.ctl
               cd /DG/data01/DG/datafile
                --rm –rf *.dbf
               cd /DG/reco01/archivelogs/DG/archivelog
                --rm –rf *.arc


3.  Start up the database DG in NOMOUNT:
                   sqlplus “/as sysdba”
                   startup nomount
                    exit

4.    check that rman connectivity happens  between PROD and DR prior rebuild


[oracle@amxd:/home/oracle]
[DG]-->rman TARGET sys/*******@PROD1 AUXILIARY sys/******@DG

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Oct 20 03:57:12 2017

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

connected to target database: PROD (DBID=2031510687)
connected to auxiliary database: PROD (DBID=2031510687, not open)

RMAN>

5.  Run the rman duplicate script as NOHUP and in backgound:

    [DG]-->  nohup /home/oracle/rman_DG_duplicate.sh > /home/oracle/rman_DG_duplicate.log 2>&1 &
   
SQL> !more rman_GDG_duplicate_node3.sh

======================================
export NLS_DATE_FORMAT='dd-Mon-yy hh24:mi'

rman TARGET sys/elcaro1@GPRD1 AUXILIARY sys/elcaro1@GDG > /home/oracle/rman_GDG_duplicate_node3.log 2>&1 << EOF
run
 {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate channel prmy5 type disk;
allocate channel prmy6 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
DUPLICATE TARGET DATABASE
   FOR STANDBY
   FROM ACTIVE DATABASE
   DORECOVER
   NOFILENAMECHECK;
}
 EXIT;
EOF

echo "DG RMAN Duplicate completed. Check for errors." | mailx -a /home/oracle/rman_DG_duplicate_node3.log -s "DG@AMXD CLONE" database@email.com
=========================================

6.  Upon completion, verify no errors occurred during the duplicate.

7.  Shutdown the database DG
    SQL> shutdown immediate;

8.  Startup the database DG in MOUNT:
    SQL> startup mount;

9.  Start MRP (Managed Resource Process):
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

10. Verify the Alert log for errors/warnings during the MRP start:
    /u01/app/oracle/diag/rdbms/DG/DG/trace/alert_DG.log






No comments:

Post a Comment