Steps to create active data guard in 11g and up-gradation to 12c using manual method - I

Steps to Create 11 ADG and up-gradation to 12c using manual method

 10 steps will take you through systematic approach to create standby database/ADG (active data guard) followed by activation and up-gradation to 12c using manual method

    1.  11g dummy instance creation for ADG
     2.  Dummy instance cleanup and preparation for rman restore to create standby
     3.  RMAN level 0 restoration initiation
     4.  ADG parameter setting
     5.  Restore archives and apply to standby
     6.  Activating standby
     7.  Pre-requisites of 12c upgrade
     8.  Initiate 12c upgrade
     9.  Time zone upgrade
    10. Post upgrade steps
     A.  Issues Faced

Above approach is best suited to reduce overall downtime involved to application and DB upgrade can be performed within 6 Hrs.

Please refer the setup as below 

testlabdb005a/testlabdb005b -: New two node RAC database hosts to be used for 11g restore/ADG/Upgrade to 12c

testoldlabdb1/testoldlabdb12 -: Old two node RAC database with 11g database TESTDBPRD which acts as a primary db node

TESTDBPRD :- Old 11g Database global name , name to be preserved in ADG
NEWDBPRD :- New 11g ADG database unique name , older name will be preserved as global dbname

 1.   11g dummy instance creation for ADG

We will create a dummy database instance to get db service /ASM/ TNS configuration readily available

[oracle@testlabdb005a ~]$ . ./.bash_profile_11g
[oracle@testlabdb005a ~]$ which sqlplus
/golden/app/oracle/11.2.0.3.0/db/bin/sqlplus
[oracle@testlabdb005a ~]$  export DISPLAY=164.16.18.55:10.0
[oracle@testlabdb005a ~]$ dbca



Oracle RAC Application cluster to be selected  

Supply appropriate physical host name and select all followed by ASM diskgroup selection for Data and FRA location

Set appropriate SGA/PGA and process values

Database instance is available on both hosts now

[oracle@testlabdb005a ~]$ ps -ef | grep -i pmon
oracle    5227     1  0 Mar24 ?        00:04:13 asm_pmon_+ASM1
oracle   15041     1  0 08:23 ?        00:00:00 ora_pmon_NEWDBPRD1
oracle   15479 48767  0 08:23 pts/2    00:00:00 grep --color=auto -i pmon
[oracle@testlabdb005a ~]$ ssh testlabdb005b ps -ef | grep -i pmon
oracle   14788     1  0 Jan27 ?        00:08:15 asm_pmon_+ASM2
oracle   15503     1  0 Jan27 ?        00:06:08 mdb_pmon_-MGMTDB
oracle   17232     1  0 08:23 ?        00:00:00 ora_pmon_NEWDBPRD2


2. Dummy instance cleanup and preparation for rman level 0 restore to create standby


Dummy instance created in step 1 will be cleaned to make way for standby database to be restored from primary 

[oracle@testlabdb005a ~]$ srvctl stop instance -d TESTDBPRD -i NEWDBPRD2

[oracle@testlabdb005a ~]$ srvctl status database -d TESTDBPRD
Instance NEWDBPRD1 is running on node testlabdb005a
Instance NEWDBPRD2 is not running on node testlabdb005b

[oracle@testlabdb005a ~]$ . ./.bash_profile_11g
[oracle@testlabdb005a ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.3.0 Production on Wed JAN 10 08:26:04 2017
sys@TESTDBPRD> show parameter control
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files    string  +DATA/TESTDBPRD/controlfile/current.370.943604411, +FRA/testdbprd/controlfile/current.358.943604411
control_management_pack_access       string      DIAGNOSTIC+TUNING

sys@TESTDBPRD> select * from v$log;
 GROUP#  THREAD#  SEQUENCE# BYTES  BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
------ ------- ------- ------ ------- ------  ------- ----- ------ ---- -------
 1     1   7 52428800  512  2 NO INACTIVE 1026240  10-JAN-17 1031635 10-JAN-17
 2     1   8   52428800  512 2 NO  CURRENT 1031635 10-JAN-17 2.8147E+14
 3     2   1   52428800  512 2 NO  CURRENT 1033793 10-JAN-17 2.8147E+14 10-JAN-17
 4     2   0   52428800  512  2 YES UNUSED    0                     0


sys@TESTDBPRD> show parameter pfile
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/TESTDBPRD/spfileTESTDBPRD.ora

[oracle@testlabdb005a ~]$ srvctl stop instance -d TESTDBPRD -i NEWDBPRD1
[oracle@testlabdb005a ~]$ srvctl status database -d TESTDBPRD
Instance NEWDBPRD1 is not running on node testlabdb005a
Instance NEWDBPRD2 is not running on node testlabdb005b

[oracle@testlabdb005a ~]$ . ./.bash_profile_asm
[oracle@testlabdb005a ~]$ asmcmd

ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N 512 4096  1048576 2150400  2148600  0 2148600  0 N  DATA/
MOUNTED  EXTERN  N 512 4096 1048576 307200 306637    0 306637     0 N  FRA/
MOUNTED  EXTERN  N 512 4096  1048576 10240 5611 0 5611 0   Y  OCR_VOTING/
ASMCMD> cd DATA/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    TESTDBPRD/
                                        Y    NEWDBPR/
                                        N    NEWDBggp/
ASMCMD> cd TESTDBPRD/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type           Redund  Striped  Time             Sys  Name
                                                 Y    CONTROLFILE/
                                                 Y    DATAFILE/
                                                 Y    ONLINELOG/
                                                 Y    PARAMETERFILE/
                                                 Y    TEMPFILE/
PARAMETERFILE  UNPROT  COARSE   JAN 10 08:00:00  N    spfileTESTDBPRD.ora => +DATA/TESTDBPRD/PARAMETERFILE/spfile.280.943604577
ASMCMD> cd DATAFILE/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type      Redund  Striped  Time             Sys  Name
DATAFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    SYSAUX.282.943604343
DATAFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    SYSTEM.281.943604343
DATAFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    UNDOTBS1.283.943604343
DATAFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    UNDOTBS2.279.943604457
DATAFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    USERS.374.943604343
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> cd +DATA/
ASMCMD> ls -lt
Type  Redund  Striped  Time             Sys  Name
                                        N    NEWDBggp/
                                        Y    NEWDBPR/
                                        Y    TESTDBPRD/
ASMCMD> cd TESTDBPRD/
ASMCMD> ls -lt
Type           Redund  Striped  Time             Sys  Name
                                                 Y    TEMPFILE/
                                                 Y    PARAMETERFILE/
                                                 Y    ONLINELOG/
                                                 Y    CONTROLFILE/
PARAMETERFILE  UNPROT  COARSE   JAN 10 08:00:00  N    spfileTESTDBPRD.ora => +DATA/TESTDBPRD/PARAMETERFILE/spfile.280.943604577

ASMCMD> cd TEMPFILE/
ASMCMD> ls -lt
Type      Redund  Striped  Time             Sys  Name
TEMPFILE  UNPROT  COARSE   JAN 10 08:00:00  Y    TEMP.377.943604415
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y


ASMCMD> cd ONLINELOG/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    TESTDBPRD/
                                        Y    NEWDBPR/
                                        N    NEWDBggp/
ASMCMD> cd TESTDBPRD/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type           Redund  Striped  Time             Sys  Name
                                                 Y    CONTROLFILE/
                                                 Y    ONLINELOG/
                                                 Y    PARAMETERFILE/
PARAMETERFILE  UNPROT  COARSE   JAN 10 08:00:00  N    spfileTESTDBPRD.ora => +DATA/TESTDBPRD/PARAMETERFILE/spfile.280.943604577
ASMCMD> cd ONLINELOG/

ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type       Redund  Striped  Time             Sys  Name
ONLINELOG  UNPROT  COARSE   JAN 10 08:00:00  Y    group_1.371.943604413
ONLINELOG  UNPROT  COARSE   JAN 10 08:00:00  Y    group_2.375.943604415
ONLINELOG  UNPROT  COARSE   JAN 10 08:00:00  Y    group_3.278.943604577
ONLINELOG  UNPROT  COARSE   JAN 10 08:00:00  Y    group_4.424.943604577

ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y

ASMCMD> cd +DATA/
ASMCMD> cd TESTDBPRD/
ASMCMD> ls -lt
Type           Redund  Striped  Time             Sys  Name
                                                 Y    PARAMETERFILE/
                                                 Y    CONTROLFILE/
PARAMETERFILE  UNPROT  COARSE   JAN 10 08:00:00  N    spfileTESTDBPRD.ora => +DATA/TESTDBPRD/PARAMETERFILE/spfile.280.943604577
ASMCMD> cd CONTROLFILE/
ASMCMD> ls -lt
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  UNPROT  FINE     JAN 10 08:00:00  Y    Current.370.943604411
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N  512 4096  1048576  2150400  2150227 0 2150227 0 N  DATA/
MOUNTED  EXTERN  N  512 4096  1048576  307200   306637  0 306637 0  N  FRA/
MOUNTED  EXTERN  N  512 4096  1048576  10240     5611   0  5611 0 Y OCR_VOTING/
ASMCMD> cd +DATA/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type  Redund  Striped  Time             Sys  Name
                                        Y    TESTDBPRD/
                                        Y    NEWDBPR/
                                        N    NEWDBggp/
ASMCMD> cd NEWDBggp/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        N    onlinelog/
                                        N    tempfile/
ASMCMD> cd ..
ASMCMD> rm -rf NEWDBggp/
ASMCMD> pwd
+DATA
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    TESTDBPRD/
                                        Y    NEWDBPR/
ASMCMD> cd NEWDBPR/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    CONTROLFILE/
                                        Y    PARAMETERFILE/
                                        Y    PASSWORD/
ASMCMD> cd CONTROLFILE/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  UNPROT  FINE     NOV 29 10:00:00  Y    Current.261.925398497
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> cd ..
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    PARAMETERFILE/
                                        Y    PASSWORD/
ASMCMD> cd PARAMETERFILE/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
PARAMETERFILE  UNPROT  COARSE   JAN 27 14:00:00  Y    spfile.268.925398709
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> cd ..
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'
Type  Redund  Striped  Time             Sys  Name
                                        Y    PASSWORD/
ASMCMD> cd PASSWORD/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   OCT 16     2016  Y    pwdNEWDBpr.256.925398277
ASMCMD> rm *
You JAN delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> cd ..
ASMCMD-8002: entry 'NEWDBPR' does not exist in directory '+DATA/'
ASMCMD> pwd
+DATA/NEWDBPR/PASSWORD
ASMCMD> cd +DATA
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type  Redund  Striped  Time             Sys  Name
                                        Y    TESTDBPRD/
ASMCMD> cd TESTDBPRD/
ASMCMD> ls -lrt
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type           Redund  Striped  Time             Sys  Name
                                                 Y    PARAMETERFILE/
PARAMETERFILE  UNPROT  COARSE   JAN 10 08:00:00  N    spfileTESTDBPRD.ora => +DATA/TESTDBPRD/PARAMETERFILE/spfile.280.943604577
ASMCMD> pwd
+DATA/TESTDBPRD
ASMCMD> exit

[oracle@testlabdb005a ~]$ . ./.bash_profile_11g
[oracle@testlabdb005a ~]$ sqlplus "/ as sysdba"
Connected to an idle instance.
idle> startup nomount
ORACLE instance started.
Total System Global Area 4.8103E+10 bytes
Fixed Size                  2239376 bytes
Variable Size            4429186160 bytes
Database Buffers         4.3621E+10 bytes
Redo Buffers               50479104 bytes

idle> show parameter control
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      +DATA/TESTDBPRD/controlfile/curr
                                                 ent.370.943604411,
+FRA/testdbprd/controlfile/current.358.943604411
control_management_pack_access       string      DIAGNOSTIC+TUNING


  3.   RMAN level 0 restoration initiation


This step will restore database from primary db node to be converted into standby database

Standby control file backup to be taken from old database



[ora11g@testoldlabdb1 ~]$ . ./.bash_profile_TESTADG1
[ora11g@testoldlabdb1 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed JAN 10 14:05:44 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: TESTDBPRD (DBID=1110983454)

RMAN> backup current controlfile for standby format 'stby_ind.cnf';
Starting backup at 10-JAN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2285 instance=TESTADG1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 10-JAN-17
channel ORA_DISK_1: finished piece 1 at 10-JAN-17
piece handle=/oravl01/ora11g/112_RAC/dbs/stby_ind.cnf tag=TAG20170510T140608 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-JAN-17
RMAN>

[ora11g@testoldlabdb1 ~]$ scp -P 22 /oravl01/ora11g/112_RAC/dbs/stby_ind.cnf oracle@164.16.18.55:/export/RMANFULLBACK_09JAN17
oracle@164.16.18.55's password:
stby_ind.cnf                100%   64MB   5.3MB/s   00:12


[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed JAN 10 08:46:02 2017
connected to target database: TESTDBPRD (not mounted)

RMAN> restore standby controlfile from '/export/RMANFULLBACK_09JAN17/stby_ind.cnf';
Starting restore at 10-JAN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=784 instance=NEWDBPRD1 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/TESTDBPRD/controlfile/current.256.943606073
output file name=+FRA/TESTDBPRD/controlfile/current.358.943604411
Finished restore at 10-JAN-17
RMAN>

SQL> alter database mount;
Database altered.

[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed JAN 10 08:49:37 2017
connected to target database: TESTDBPRD (DBID=1110983454, not open)
RMAN>

[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ pwd
/export/RMANFULLBACK_09JAN17
[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ ls -lrt
total 305906748
-rw-------. 1 oracle oinstall   137297920 JAN  9 23:51 ctl_TESTDBPRD_obs3rn3c_1_1
-rw-------. 1 oracle oinstall  6895183872 JAN 10 00:03 dbpnps3rfrr_1_1
-rw-------. 1 oracle oinstall  6973827584 JAN 10 00:14 dbpnqs3rfrs_1_1
-rw-------. 1 oracle oinstall  7141895680 JAN 10 00:27 dbpnrs3rfrs_1_1
-rw-------. 1 oracle oinstall  5915882496 JAN 10 00:36 dbpnss3rfrs_1_1
-rw-------. 1 oracle oinstall  6487970816 JAN 10 00:47 dbpnts3rfrs_1_1
-rw-------. 1 oracle oinstall   223815168 JAN 10 00:47 dbpnus3rgds_1_1
-rw-------. 1 oracle oinstall 26752770048 JAN 10 01:30 dbpo0s3rggt_1_1
-rw-------. 1 oracle oinstall 28019957760 JAN 10 02:16 dbpo1s3rggu_1_1
-rw-------. 1 oracle oinstall 29240369152 JAN 10 03:02 dbpo2s3rggu_1_1
-rw-------. 1 oracle oinstall 27524194304 JAN 10 03:46 dbpo3s3rggu_1_1
-rw-------. 1 oracle oinstall 26314809344 JAN 10 04:27 dbpo4s3rggu_1_1
-rw-------. 1 oracle oinstall 26202578944 JAN 10 05:09 dbpo5s3rjcc_1_1
-rw-------. 1 oracle oinstall 27313512448 JAN 10 05:54 dbpo6s3rje4_1_1
-rw-------. 1 oracle oinstall 26819428352 JAN 10 06:37 dbpo7s3rjhd_1_1
-rw-------. 1 oracle oinstall 30237417472 JAN 10 07:29 dbpo8s3rjig_1_1
-rw-------. 1 oracle oinstall 30980997120 JAN 10 08:23 dbpo9s3rjp8_1_1
-rw-------. 1 oracle oinstall    66584576 JAN 10 08:37 stby_ind.cnf
drwxr-xr-x. 3 oracle oinstall        4096 JAN 10 09:04 archive
[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ pwd
/export/RMANFULLBACK_09JAN17
[oracle@testlabdb005a RMANFULLBACK_09JAN17]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Wed JAN 10 09:49:30 2017
connected to target database: TESTDBPRD (DBID=1110983454, not open)
RMAN> catalog start with '/export/RMANFULLBACK_09JAN17';
Starting implicit crosscheck backup at 10-JAN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
Crosschecked 1227 objects
Finished implicit crosscheck backup at 10-JAN-17
Starting implicit crosscheck copy at 10-JAN-17
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 10-JAN-17
searching for all files in the recovery area
cataloging files...
no files cataloged
searching for all files that match the pattern /export/RMANFULLBACK_09JAN17
List of Files Unknown to the Database
=====================================
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_GG_tts3stid_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_GG_tus3stjk_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_clone_nvs3r8qq_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/GG_NOTREQ/arch_ggg_tjs3r281_1_1.gz
File Name: /export/RMANFULLBACK_09JAN17/archive/GG_NOTREQ/arch_ggg_tks3r2gm_1_1.gz
.
.

File Name: /export/RMANFULLBACK_09JAN17/dbpnts3rfrs_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpnus3rgds_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo0s3rggt_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo1s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo2s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo3s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo4s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo5s3rjcc_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo6s3rje4_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo7s3rjhd_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo8s3rjig_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo9s3rjp8_1_1

Do you really want to catalog the above files (enter YES or NO)? Y
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_clone_nvs3r8qq_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_frs3r0ap_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_fss3r0ni_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_fts3r13l_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_fus3r1gf_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_fvs3r1st_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_g0s3rasb_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_g1s3rb8o_1_1
File Name: /export/RMANFULLBACK_09JAN17/archive/arch_adg_g2s3rbkr_1_1
.
.

File Name: /export/RMANFULLBACK_09JAN17/dbpnus3rgds_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo0s3rggt_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo1s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo2s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo3s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo4s3rggu_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo5s3rjcc_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo6s3rje4_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo7s3rjhd_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo8s3rjig_1_1
File Name: /export/RMANFULLBACK_09JAN17/dbpo9s3rjp8_1_1

RMAN>

    rman_DB_0_level_clone_restore.sh

RUN {
configure device type disk parallelism 5;
ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch02  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch03  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch04  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch05  DEVICE TYPE DISK ;
set newname for datafile 1 to '+DATA';
set newname for datafile 2 to '+DATA';
set newname for datafile 3 to '+DATA';
set newname for datafile 4 to '+DATA';
.
.
.
set newname for datafile 97 to '+DATA';
restore database;
switch datafile all;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
}


o/p:

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 5 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

allocated channel: ch01
channel ch01: SID=287 instance=NEWDBPRD1 device type=DISK
allocated channel: ch02
channel ch02: SID=358 instance=NEWDBPRD1 device type=DISK
allocated channel: ch03
channel ch03: SID=431 instance=NEWDBPRD1 device type=DISK
allocated channel: ch04
channel ch04: SID=501 instance=NEWDBPRD1 device type=DISK
allocated channel: ch05
channel ch05: SID=572 instance=NEWDBPRD1 device type=DISK

executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
..
.
.
.
channel ch01: starting datafile backup set restore
channel ch01: specifying datafile(s) to restore from backup set
channel ch01: restoring datafile 00001 to +DATA
channel ch01: restoring datafile 00018 to +DATA
channel ch01: restoring datafile 00020 to +DATA
channel ch01: restoring datafile 00021 to +DATA
channel ch01: restoring datafile 00022 to +DATA
channel ch01: restoring datafile 00023 to +DATA
channel ch01: restoring datafile 00024 to +DATA
channel ch01: restoring datafile 00029 to +DATA
channel ch01: restoring datafile 00056 to +DATA
channel ch01: restoring datafile 00062 to +DATA
channel ch01: restoring datafile 00074 to +DATA
channel ch01: restoring datafile 00083 to +DATA
channel ch01: restoring datafile 00086 to +DATA
channel ch01: restoring datafile 00091 to +DATA
channel ch01: reading from backup piece /export/RMANFULLBACK_09JAN17/dbpo8s3rjig_1_1
channel ch02: starting datafile backup set restore
channel ch02: specifying datafile(s) to restore from backup set
channel ch02: restoring datafile 00002 to +DATA
channel ch02: restoring datafile 00009 to +DATA
channel ch02: restoring datafile 00034 to +DATA
channel ch02: restoring datafile 00039 to +DATA
channel ch02: restoring datafile 00040 to +DATA
channel ch02: restoring datafile 00051 to +DATA
channel ch02: restoring datafile 00054 to +DATA
channel ch02: restoring datafile 00067 to +DATA
.
.
.
.

input datafile copy RECID=193 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/usr.264.943615617
datafile 91 switched to datafile copy
input datafile copy RECID=194 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/usr.394.943611157
datafile 92 switched to datafile copy
input datafile copy RECID=195 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/usr.260.943611157
datafile 93 switched to datafile copy
input datafile copy RECID=196 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/undotbs2.293.943615617
datafile 94 switched to datafile copy
input datafile copy RECID=197 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/sysaux.290.943615617
datafile 95 switched to datafile copy
input datafile copy RECID=198 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/sysaux.269.943615831
datafile 96 switched to datafile copy
input datafile copy RECID=199 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/users.279.943611155
datafile 97 switched to datafile copy
input datafile copy RECID=200 STAMP=943620733 file name=+DATA/TESTDBPRD/datafile/users.294.943615617
released channel: ch01
released channel: ch02
released channel: ch03
released channel: ch04
released channel: ch05
RMAN>

  4.   ADG parameter setting

This step is not mandatory if you opt to apply archive offline to standby database

On testlabdb005a:

alter database rename file '+FRA/oradata/TESTDBPRD/redo_g1_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g1_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g1_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g1_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g2_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g2_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g2_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g2_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g3_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g3_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g3_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g3_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g4_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g4_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g4_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g4_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g5_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g5_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g5_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g5_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g6_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g6_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g6_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g6_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g7_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g7_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g7_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g7_m02.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g8_m01.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g8_m01.dbf';
alter database rename file '+FRA/oradata/TESTDBPRD/redo_g8_m02.dbf' to '+DATA/TESTDBPRD/onlinelog/redo_g8_m02.dbf';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_9.292.812362187' to '+DATA/TESTDBPRD/onlinelog/group_9.292.812362187';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_9.293.812362187' to '+DATA/TESTDBPRD/onlinelog/group_9.293.812362187';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_10.294.812362321' to '+DATA/TESTDBPRD/onlinelog/group_10.294.812362321';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_10.295.812362323' to '+DATA/TESTDBPRD/onlinelog/group_10.295.812362323';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_11.296.812362331' to '+DATA/TESTDBPRD/onlinelog/group_11.296.812362331';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_11.297.812362333' to '+DATA/TESTDBPRD/onlinelog/group_11.297.812362333';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_12.299.812513579' to '+DATA/TESTDBPRD/onlinelog/group_12.299.812513579';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_12.298.812513581' to '+DATA/TESTDBPRD/onlinelog/group_12.298.812513581';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_13.300.812513589' to '+DATA/TESTDBPRD/onlinelog/group_13.300.812513589';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_13.301.812513591' to '+DATA/TESTDBPRD/onlinelog/group_13.301.812513591';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_14.302.812513721' to '+DATA/TESTDBPRD/onlinelog/group_14.302.812513721';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_14.303.812513723' to '+DATA/TESTDBPRD/onlinelog/group_14.303.812513723';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_15.304.812513735' to '+DATA/TESTDBPRD/onlinelog/group_15.304.812513735';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_15.305.812513737' to '+DATA/TESTDBPRD/onlinelog/group_15.305.812513737';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_16.306.812513745' to '+DATA/TESTDBPRD/onlinelog/group_16.306.812513745';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_16.307.812513747' to '+DATA/TESTDBPRD/onlinelog/group_16.307.812513747';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_17.308.812513765' to '+DATA/TESTDBPRD/onlinelog/group_17.308.812513765';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_17.309.812513767' to '+DATA/TESTDBPRD/onlinelog/group_17.309.812513767';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_18.310.812513775' to '+DATA/TESTDBPRD/onlinelog/group_18.310.812513775';
alter database rename file '+DATA1/TESTDBPRD/onlinelog/group_18.311.812513777' to '+DATA/TESTDBPRD/onlinelog/group_18.311.812513777';

idle> alter system set standby_file_management='AUTO' scope=spfile;
System altered.

idle> alter system set fal_client='NEWDBPRD';
System altered.

idle> alter system set fal_server='TESTADG';
System altered.

idle> alter system set db_create_online_log_dest_1='+DATA' scope=spfile;
System altered.

On testoldlabdb1:


SQL> alter system set log_archive_dest_3='SERVICE=NEWDBPRD ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=NEWDBPRD';

System altered.

SQL> alter system set log_archive_dest_state_3=ENABLE;
System altered.

SQL> alter system set log_archive_config='DG_CONFIG=( TESTDBPRD,TESTADG, NEWDBPRD)' scope=spfile;
System altered.

SQL> alter system set fal_server='TESTDBPRD,NEWDBPRD';
System altered.


 5.   Restore archives and apply to standby


In case real time archive sync not enabled below command can be used to restore archives from primary and applied to standby db

RUN {
configure device type disk parallelism 5;
ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch02  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch03  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch04  DEVICE TYPE DISK ;
ALLOCATE CHANNEL ch05  DEVICE TYPE DISK ;
restore archivelog from sequence 268574  until sequence 268700 thread 2;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
RELEASE CHANNEL ch04;
RELEASE CHANNEL ch05;
}
EOF

>> NEXT_PAGE                                                          Page 1    2    3     4  

No comments:

Post a Comment

Popular Posts