Tutorial Objectives
- Simulate a ZDLRA site/server failure scenario by shutting down the secondary ZDLRA catalog database
- Perform RMAN incremental level 1 backup and verify backup completes successfully by connecting to primary ZDLRA catalog database which is up and running
- Verify replication of database and archive log backups from Primary to Secondary ZDLRA servers after failure scenario has been resolved
CREATE THE RMAN INCREMENTAL LEVEL 1 BACKUP SCRIPT
[oracle@prdb01 ~]$ cat rman_bkp.rcv
{
allocate channel sbt1 device type sbt
format '%d_%U'
PARMS="SBT_LIBRARY=/u01/app/oracle/product/19.0.0.0/dbhome_2/lib/libra.so,
ENV=(RA_WALLET='location=file:/u01/app/oracle/product/19.0.0.0/dbhome_2/network/admin/server_wallet
credential_alias=dr_zdlra_pr')";
allocate channel sbt2 device type sbt
format '%d_%U'
PARMS="SBT_LIBRARY=/u01/app/oracle/product/19.0.0.0/dbhome_2/lib/libra.so,
ENV=(RA_WALLET='location=file:/u01/app/oracle/product/19.0.0.0/dbhome_2/network/admin/server_wallet
credential_alias=dr_zdlra_pr')";
backup
cumulative incremental level 1
filesperset 1
section size 64g
database
plus archivelog
not backed up
filesperset 32
delete input;
}
STORE THE BACKUP SCRIPT IN EACH CATALOG
PRIMARY ZDLRA CATALOG
[oracle@prdb01 ~]$ rman target / catalog /@dr_zdlra_pr
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Sep 13 20:11:22 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB (DBID=829695276)
connected to recovery catalog database
recovery catalog schema version 21.01.00.00. is newer than RMAN version
RMAN> create script backup_database from file '/home/oracle/rman_bkp.rcv';
script commands will be loaded from file /home/oracle/rman_bkp.rcv
created script backup_database
SECONDARY ZDLRA CATALOG
[oracle@prdb01 ~]$ rman target / catalog /@dr_zdlra_se
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Sep 13 20:04:22 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB (DBID=829695276)
connected to recovery catalog database
recovery catalog schema version 21.01.00.00. is newer than RMAN version
RMAN> create script backup_database from file '/home/oracle/rman_bkp.rcv';
script commands will be loaded from file /home/oracle/rman_bkp.rcv
created script backup_database
SIMULATE SECONDARY ZDLRA FAILURE BY SHUTTING DOWN CATALOG DATABASE (SECONDARY)
[oracle@sezdlra01 ~]$ srvctl stop database -d SEZDRDB -o immediate
EXECUTE BACKUP SCRIPT – CONNECTS TO PRIMARY ZDLRA THIS TIME BECAUSE SECONDARY IS NOT AVAILABLE
[oracle@prdb01 ~]$ rman target / catalog /@dr_zdlra
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Sep 13 20:15:02 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB (DBID=829695276)
connected to recovery catalog database
recovery catalog schema version 21.01.00.00. is newer than RMAN version
RMAN> run {execute script backup_database;}
executing script: backup_database
allocated channel: sbt1
channel sbt1: SID=3150 device type=SBT_TAPE
channel sbt1: RA Library (PRZDRDB) SID=CBDEBDC4D20F2009E0537C01360A9F54
allocated channel: sbt2
channel sbt2: SID=611 device type=SBT_TAPE
channel sbt2: RA Library (PRZDRDB) SID=CBDEBDCAACA4200BE0537C01360AA508
Starting backup at 13-SEP-21
current log archived
channel sbt1: starting archived log backup set
channel sbt1: specifying archived log(s) in backup set
input archived log thread=1 sequence=72 RECID=147 STAMP=1083183316
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3e09046l_110_1_1 tag=TAG20210913T201517 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:15
channel sbt1: deleting archived log(s)
RMAN-08137: warning: archived log not deleted, needed for standby or upstream capture process
archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2021_09_13/o1_mf_1_72_jmy95n89_.arc thread=1 sequence=72
Finished backup at 13-SEP-21
Starting backup at 13-SEP-21
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00003 name=/u01/app/oracle/oradata/CDB2/sysaux01.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt2: starting incremental level 1 datafile backup set
channel sbt2: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/CDB2/system01.dbf
channel sbt2: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3f090476_111_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oracle/oradata/CDB2/undotbs01.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3h090477_113_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00010 name=/u01/app/oracle/oradata/CDB2/pdb1/CDB2/CB6357DD582A7625E0537C01360A4B1A/datafile/o1_mf_sysaux_jmg3mdyf_.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3i090478_114_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/CDB2/pdbseed/o1_mf_sysaux_j23p0nok_.dbf
skipping datafile 00006 because it has not changed
channel sbt1: backup cancelled because all files were skipped
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/CDB2/pdbseed/o1_mf_system_j23p0hvr_.dbf
skipping datafile 00005 because it has not changed
channel sbt1: backup cancelled because all files were skipped
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00009 name=/u01/app/oracle/oradata/CDB2/pdb1/CDB2/CB6357DD582A7625E0537C01360A4B1A/datafile/o1_mf_system_jmg3mdy9_.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3l090479_117_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00008 name=/u01/app/oracle/oradata/CDB2/pdbseed/o1_mf_undotbs1_j23tn2pf_.dbf
skipping datafile 00008 because it has not changed
channel sbt1: backup cancelled because all files were skipped
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00011 name=/u01/app/oracle/oradata/CDB2/pdb1/CDB2/CB6357DD582A7625E0537C01360A4B1A/datafile/o1_mf_undotbs1_jmg3mdyf_.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3n09047a_119_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: starting incremental level 1 datafile backup set
channel sbt1: specifying datafile(s) in backup set
input datafile file number=00007 name=/u01/app/oracle/oradata/CDB2/users01.dbf
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3o09047b_120_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt2: finished piece 1 at 13-SEP-21
piece handle=CDB2_3g090476_112_1_1 tag=TAG20210913T201532 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt2: backup set complete, elapsed time: 00:00:13
Finished backup at 13-SEP-21
Starting backup at 13-SEP-21
current log archived
channel sbt1: starting archived log backup set
channel sbt1: specifying archived log(s) in backup set
input archived log thread=1 sequence=73 RECID=150 STAMP=1083183347
channel sbt1: starting piece 1 at 13-SEP-21
channel sbt1: finished piece 1 at 13-SEP-21
piece handle=CDB2_3p09047k_121_1_1 tag=TAG20210913T201547 comment=API Version 2.0,MMS Version 19.0.0.1
channel sbt1: backup set complete, elapsed time: 00:00:01
channel sbt1: deleting archived log(s)
archived log file name=/u01/app/oracle/fast_recovery_area/CDB2/archivelog/2021_09_13/o1_mf_1_73_jmy96m0y_.arc RECID=150 STAMP=1083183347
Finished backup at 13-SEP-21
Starting Control File and SPFILE Autobackup at 13-SEP-21
piece handle=c-829695276-20210913-02 comment=API Version 2.0,MMS Version 19.0.0.1
Finished Control File and SPFILE Autobackup at 13-SEP-21
released channel: sbt1
released channel: sbt2
RMAN>
TEST REDO TRANSPORT FAILOVER
[oracle@prdb01 ~]$ sqlplus sys as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Sep 13 20:18:03 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.10.0.0.0
SQL> alter system switch logfile;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 44
Next log sequence to archive 46
Current log sequence 46
SQL> quit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.10.0.0.0
ARCHIVE LOG BACKUP AUTOMATICALLY CREATED IN PRIMARY ZDLRA
[oracle@prdb01 dbs]$ rman target / catalog /@dr_zdlra
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Sep 20 14:18:56 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB (DBID=2200216847)
connected to recovery catalog database
recovery catalog schema version 21.01.00.00. is newer than RMAN version
RMAN> list backup of archivelog sequence 45;
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
114925 6.00K SBT_TAPE 00:00:00 20-SEP-21
BP Key: 114926 Status: AVAILABLE Compressed: YES Tag: TAG20210920T141850
Handle: $RSCN_1920977_RTIM_1083613330_THRD_1_SEQ_45_CTKEY_114918_BACKUP Media:
List of Archived Logs in backup set 114925
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 45 3203665 20-SEP-21 3203673 20-SEP-21
CHECK DATA GUARD BROKER CONFIGURATION
[oracle@prdb01 ~]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Sep 13 20:20:26 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect / as sysdg
Connected to "cdb"
Connected as SYSDG.
DGMGRL> show configuration;
Configuration - cdb_dg
Protection Mode: MaxAvailability
Members:
cdb - Primary database
cdb_sb - Physical standby database
zdlra_pr - Recovery appliance (alternate of zdlra_se)
Members Not Receiving Redo:
zdlra_se - Recovery appliance
Fast-Start Failover: Disabled
Configuration Status:
SUCCESS (status updated 44 seconds ago)
START THE SECONDARY ZDLRA DATABASE
[oracle@sezdlra01 ~]$ srvctl start database -d SEZDRDB
CHECK IF EARLIER ARCHIVE LOG BACKUP IS REPLICATED NOW FROM PRIMARY ZDLRA TO SECONDARY ZDLRA
Note: BACKUP WILL NOT BE AVAILABLE IN SECONDARY ZDLRA UNTIL RASYS REPLICATION TASK IS COMPLETED
[oracle@prdb01 ~]$ rman target / catalog /@dr_zdlra
Recovery Manager: Release 19.0.0.0.0 - Production on Mon Sep 13 20:23:27 2021
Version 19.10.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB2 (DBID=829695276)
connected to recovery catalog database
recovery catalog schema version 21.01.00.00. is newer than RMAN version
RMAN> list backup of archivelog all completed after 'sysdate-10/1440';
List of Backup Sets
===================
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
211426 6.00K SBT_TAPE 00:00:00 20-SEP-21
BP Key: 211427 Status: AVAILABLE Compressed: YES Tag: TAG20210920T142606
Handle: $RSCN_1920977_RTIM_1083613330_THRD_1_SEQ_45_CTKEY_211424_BACKUP Media:
List of Archived Logs in backup set 211426
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 45 3203665 20-SEP-21 3203673 20-SEP-21
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
211430 62.00K SBT_TAPE 00:00:00 20-SEP-21
BP Key: 211431 Status: AVAILABLE Compressed: YES Tag: TAG20210920T142608
Handle: $RSCN_1920977_RTIM_1083613330_THRD_1_SEQ_44_CTKEY_211423_BACKUP Media:
List of Archived Logs in backup set 211430
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 44 3203345 20-SEP-21 3203665 20-SEP-21
...
...
...