Search This Blog

Wednesday, February 8, 2023

Roll Forward Physical Standby Using RMAN Incremental Backup in Single Command (almost :))




 












In this post, les see how we can roll forward the Physical standby database when there is a huge gap in standby database sync. 

Whenever there is a hug gap in Physical standby database, we can simply roll forward it and bring the physical standby database in sync with primary with incremental backup that we can take it in the primary database and apply it to the standby database.

For 11g , we can use the below document

11g Steps to perform for Rolling Forward a Physical Standby Database using RMAN Incremental Backup. (Doc ID 836986.1)

For 12.1 and 12.2, we can use below document.
12c How to Roll Forward a Standby Database Using Recover Database From Service (Doc ID 2850185.1) 

For versions 18c and above, refer to this document.
Roll Forward Physical Standby Using RMAN Incremental Backup in Single Command (Doc ID 2431311.1)

Since our version is 19c, we are going to use below document .
Roll Forward Physical Standby Using RMAN Incremental Backup in Single Command (Doc ID 2431311.1)

Primary Source Environment setup

RAC Database : RENODBPR ( renodbpr1 & renodbpr2)
GRID Home : /u01/app/19.3.0.0/grid
RDBMS Home    : /u01/app/oracle/product/19.3.0.0/db_1
Version         : Oracle Database 19c EE - Production Version 19.17.0.0.0
hosts : labhost01
                          labhost02

Standby database environment setup
RAC Database : RENODBDR ( renodbdr1 & renodbdr2)
GRID Home : /u01/app/19.3.0.0/grid
RDBMS Home    : /u01/app/oracle/product/19.3.0.0/dbhome_1
Version         : Oracle Database 19c EE - Production Version 19.17.0.0.0
hosts : labdrhost01
                          labdrhost02

Both the primary database and standby database have 19.18 RU applied.

Primary database patch set level.
[oracle@labhost01 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
34768559;OCW RELEASE UPDATE 19.18.0.0.0 (34768559)
34765931;DATABASE RELEASE UPDATE : 19.18.0.0.230117 (REL-JAN230131) (34765931)
OPatch succeeded.

[oracle@labhost01 ~]$

Standby database patchset level.
[oracle@labdrhost01 trace]$ cd
[oracle@labdrhost01 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
34768559;OCW RELEASE UPDATE 19.18.0.0.0 (34768559)
34765931;DATABASE RELEASE UPDATE : 19.18.0.0.230117 (REL-JAN230131) (34765931)
OPatch succeeded.
[oracle@labdrhost01 ~]$

if we check the standby database for lag, we can see that its beyond the Primary database and its waiting for the log, 







From the alert log of the standby database, we can see that its waiting for log sequence 62-87 







Lets see how to re-sync the physical standby database with the steps mentioned in the below document.

Roll Forward Physical Standby Using RMAN Incremental Backup in Single Command (Doc ID 2431311.1)

1.  Stop the RAC database and start only one instance in mount mode.



2. Stop the Managed recovery process if its started

SQL> select name,open_mode from gv$database;
NAME OPEN_MODE
--------- --------------------
RENODBPR MOUNTED

SQL> ALTER DATABASE RECOVER managed standby database cancel;
Database altered.

SQL>

3.  Test connecting the primary database from the phsyical standby database using its service name.




4. Connect to the RMAN target and recover the phsycial standby database using below command 

"RECOVER STANDBY DATABASE FROM SERVICE"
In our case command will be '"RECOVER STANDBY DATABASE FROM RENODBPR"

[oracle@labdrhost01 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Feb 8 15:50:31 2023
Version 19.18.0.0.0

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

connected to target database: RENODBPR (DBID=68216390, not open)

RMAN> RECOVER STANDBY DATABASE FROM SERVICE RENODBPR;

Starting recover at 08-FEB-23
using target database control file instead of recovery catalog
Oracle instance started

Total System Global Area    3053450480 bytes

Fixed Size                     9168112 bytes
Variable Size                687865856 bytes
Database Buffers            2348810240 bytes
Redo Buffers                   7606272 bytes

contents of Memory Script:
{
   restore standby controlfile from service  'RENODBPR';
   alter database mount standby database;
}
executing Memory Script

Starting restore at 08-FEB-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=58 instance=renodbdr1 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/RENODBDR/CONTROLFILE/current.258.1128095897
output file name=+DATA/RENODBDR/CONTROLFILE/current.259.1128095897
Finished restore at 08-FEB-23

released channel: ORA_DISK_1
Statement processed

contents of Memory Script:
{
set newname for tempfile  1 to
 "+DATA/RENODBDR/TEMPFILE/temp.316.1128097179";
set newname for tempfile  2 to
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/TEMPFILE/temp.317.1128097183";
set newname for clone tempfile  3 to new;
   switch tempfile all;
set newname for datafile  1 to
 "+DATA/RENODBDR/DATAFILE/system.260.1128095905";
set newname for datafile  3 to
 "+DATA/RENODBDR/DATAFILE/sysaux.261.1128095911";
set newname for datafile  4 to
 "+DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919";
set newname for datafile  5 to
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/system.263.1128095923";
set newname for datafile  6 to
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/sysaux.264.1128095925";
set newname for datafile  7 to
 "+DATA/RENODBDR/DATAFILE/users.265.1128095929";
set newname for datafile  8 to
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/undotbs1.266.1128095929";
set newname for datafile  9 to
 "+DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933";
set newname for datafile  10 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933";
set newname for datafile  11 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937";
set newname for datafile  12 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941";
set newname for datafile  13 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941";
set newname for datafile  14 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943";
set newname for datafile  15 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943";
set newname for datafile  16 to
 "+DATA/RENODBDR/DATAFILE/tbs123.274.1128095945";
set newname for datafile  17 to
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947";
   catalog datafilecopy  "+DATA/RENODBDR/DATAFILE/system.260.1128095905",
 "+DATA/RENODBDR/DATAFILE/sysaux.261.1128095911",
 "+DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919",
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/system.263.1128095923",
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/sysaux.264.1128095925",
 "+DATA/RENODBDR/DATAFILE/users.265.1128095929",
 "+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/undotbs1.266.1128095929",
 "+DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943",
 "+DATA/RENODBDR/DATAFILE/tbs123.274.1128095945",
 "+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947";
   switch datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting implicit crosscheck backup at 08-FEB-23
allocated channel: ORA_DISK_1
Crosschecked 6 objects
Finished implicit crosscheck backup at 08-FEB-23

Starting implicit crosscheck copy at 08-FEB-23
using channel ORA_DISK_1
Finished implicit crosscheck copy at 08-FEB-23

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +DATA/RENODBDR/AUTOBACKUP/2023_02_07/s_1128178754.344.1128178953
File Name: +DATA/RENODBDR/AUTOBACKUP/2023_02_06/s_1128096941.328.1128097767
File Name: +DATA/RENODBDR/AUTOBACKUP/2023_02_06/s_1128098761.333.1128098763
File Name: +DATA/RENODBDR/TEMPFILE/temp.316.1128097179
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_55.345.1128213443
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_56.346.1128249453
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_44.347.1128249455
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_57.348.1128249455
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_45.349.1128249461
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_58.350.1128249461
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_59.351.1128249461
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_60.352.1128249465
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_46.353.1128249467
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_61.354.1128249603
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_47.355.1128249605
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_88.356.1128250035
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_61.357.1128250039
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_89.358.1128250039
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_90.359.1128250043
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_62.360.1128250045
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_91.361.1128250045
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_63.362.1128250047
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_92.363.1128250049
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_64.364.1128250051
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_93.365.1128250051
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_65.366.1128250053
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_94.367.1128250055
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_66.368.1128250057
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_95.369.1128250057
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_67.370.1128250059
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_96.371.1128250061
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_68.372.1128250063
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_97.373.1128250063
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_69.374.1128250067
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_98.375.1128250067
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_99.376.1128250071
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_70.377.1128250073
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_100.378.1128250073
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_1_seq_101.379.1128250075
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_08/thread_2_seq_71.380.1128250075
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_1_seq_52.338.1128153619
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_2_seq_41.339.1128153621
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_1_seq_53.340.1128178355
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_2_seq_42.341.1128178355
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_2_seq_43.342.1128178357
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_07/thread_1_seq_54.343.1128178359
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_35.300.1128096773
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_36.301.1128096775
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_24.302.1128096777
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_25.303.1128096779
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_37.304.1128096881
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_38.305.1128096883
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_39.306.1128096887
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_40.307.1128096929
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_41.308.1128096931
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_42.309.1128096935
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_43.310.1128096937
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_44.311.1128096941
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_26.312.1128096943
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_27.313.1128096943
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_28.314.1128096945
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_29.315.1128096947
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_45.318.1128097511
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_46.319.1128097545
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_30.320.1128097729
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_31.321.1128097731
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_32.322.1128097731
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_33.323.1128097733
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_34.324.1128097735
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_35.325.1128097735
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_36.326.1128097737
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_37.327.1128097737
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_47.329.1128098421
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_38.330.1128098421
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_39.331.1128098447
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_48.332.1128098447
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_49.334.1128099489
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_50.335.1128099489
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_2_seq_40.336.1128099491
File Name: +DATA/RENODBDR/ARCHIVELOG/2023_02_06/thread_1_seq_51.337.1128099523
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943
File Name: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947
File Name: +DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/TEMPFILE/temp.317.1128097183
File Name: +DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/system.263.1128095923
File Name: +DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/sysaux.264.1128095925
File Name: +DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/undotbs1.266.1128095929
File Name: +DATA/RENODBDR/DATAFILE/system.260.1128095905
File Name: +DATA/RENODBDR/DATAFILE/sysaux.261.1128095911
File Name: +DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919
File Name: +DATA/RENODBDR/DATAFILE/users.265.1128095929
File Name: +DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933
File Name: +DATA/RENODBDR/DATAFILE/tbs123.274.1128095945

renamed tempfile 1 to +DATA/RENODBDR/TEMPFILE/temp.316.1128097179 in control file
renamed tempfile 2 to +DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/TEMPFILE/temp.317.1128097183 in control file
renamed tempfile 3 to +DATA in control file

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

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

executing command: SET NEWNAME

executing command: SET NEWNAME

cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/sysaux.261.1128095911 RECID=20 STAMP=1128268275
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/system.260.1128095905 RECID=21 STAMP=1128268275
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919 RECID=22 STAMP=1128268281
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/system.263.1128095923 RECID=23 STAMP=1128268281
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/sysaux.264.1128095925 RECID=24 STAMP=1128268287
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/users.265.1128095929 RECID=25 STAMP=1128268287
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/undotbs1.266.1128095929 RECID=26 STAMP=1128268293
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933 RECID=27 STAMP=1128268293
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933 RECID=28 STAMP=1128268299
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937 RECID=29 STAMP=1128268299
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941 RECID=30 STAMP=1128268305
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941 RECID=31 STAMP=1128268305
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943 RECID=32 STAMP=1128268312
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943 RECID=33 STAMP=1128268312
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/DATAFILE/tbs123.274.1128095945 RECID=34 STAMP=1128268318
cataloged datafile copy
datafile copy file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947 RECID=35 STAMP=1128268318

datafile 1 switched to datafile copy
input datafile copy RECID=21 STAMP=1128268275 file name=+DATA/RENODBDR/DATAFILE/system.260.1128095905
datafile 3 switched to datafile copy
input datafile copy RECID=20 STAMP=1128268275 file name=+DATA/RENODBDR/DATAFILE/sysaux.261.1128095911
datafile 4 switched to datafile copy
input datafile copy RECID=22 STAMP=1128268281 file name=+DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919
datafile 5 switched to datafile copy
input datafile copy RECID=23 STAMP=1128268281 file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/system.263.1128095923
datafile 6 switched to datafile copy
input datafile copy RECID=24 STAMP=1128268287 file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/sysaux.264.1128095925
datafile 7 switched to datafile copy
input datafile copy RECID=25 STAMP=1128268287 file name=+DATA/RENODBDR/DATAFILE/users.265.1128095929
datafile 8 switched to datafile copy
input datafile copy RECID=26 STAMP=1128268293 file name=+DATA/RENODBDR/F2960A86AEBC354FE0530A0278C09105/DATAFILE/undotbs1.266.1128095929
datafile 9 switched to datafile copy
input datafile copy RECID=27 STAMP=1128268293 file name=+DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933
datafile 10 switched to datafile copy
input datafile copy RECID=28 STAMP=1128268299 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933
datafile 11 switched to datafile copy
input datafile copy RECID=29 STAMP=1128268299 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937
datafile 12 switched to datafile copy
input datafile copy RECID=30 STAMP=1128268305 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941
datafile 13 switched to datafile copy
input datafile copy RECID=31 STAMP=1128268305 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941
datafile 14 switched to datafile copy
input datafile copy RECID=32 STAMP=1128268312 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943
datafile 15 switched to datafile copy
input datafile copy RECID=33 STAMP=1128268312 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943
datafile 16 switched to datafile copy
input datafile copy RECID=34 STAMP=1128268318 file name=+DATA/RENODBDR/DATAFILE/tbs123.274.1128095945
datafile 17 switched to datafile copy
input datafile copy RECID=35 STAMP=1128268318 file name=+DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_1.263.1126471369' to '+DATA/RENODBDR/ONLINELOG/group_1.276.1128095951'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_1.266.1126471371' to '+DATA/RENODBDR/ONLINELOG/group_1.277.1128095951'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_2.264.1126471369' to '+DATA/RENODBDR/ONLINELOG/group_2.278.1128095951'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_2.265.1126471371' to '+DATA/RENODBDR/ONLINELOG/group_2.279.1128095951'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_3.273.1126472631' to '+DATA/RENODBDR/ONLINELOG/group_3.280.1128095951'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_3.274.1126472631' to '+DATA/RENODBDR/ONLINELOG/group_3.281.1128095953'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_4.275.1126472631' to '+DATA/RENODBDR/ONLINELOG/group_4.282.1128095953'
Executing: alter database rename file '+DATA/RENODBPR/ONLINELOG/group_4.276.1126472631' to '+DATA/RENODBDR/ONLINELOG/group_4.283.1128095953'

contents of Memory Script:
{
  recover database from service  'RENODBPR';
}
executing Memory Script

Starting recover at 08-FEB-23
using channel ORA_DISK_1
skipping datafile 5; already restored to SCN 3943135
skipping datafile 6; already restored to SCN 3943135
skipping datafile 8; already restored to SCN 3943135
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00001: +DATA/RENODBDR/DATAFILE/system.260.1128095905
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00003: +DATA/RENODBDR/DATAFILE/sysaux.261.1128095911
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00004: +DATA/RENODBDR/DATAFILE/undotbs1.262.1128095919
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00007: +DATA/RENODBDR/DATAFILE/users.265.1128095929
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00009: +DATA/RENODBDR/DATAFILE/undotbs2.267.1128095933
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00010: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/system.268.1128095933
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00011: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/sysaux.269.1128095937
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00012: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undotbs1.270.1128095941
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00013: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/undo_2.271.1128095941
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00014: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/users.272.1128095943
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00015: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs1.273.1128095943
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00016: +DATA/RENODBDR/DATAFILE/tbs123.274.1128095945
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: using network backup set from service RENODBPR
destination for restore of datafile 00017: +DATA/RENODBDR/F29636F2F7466178E0530A0278C024A1/DATAFILE/tbs2.275.1128095947
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

starting media recovery

media recovery complete, elapsed time: 00:00:00
Finished recover at 08-FEB-23
Finished recover at 08-FEB-23

RMAN>

Once the restore is completed ,I saw that the standby database is all synced up. But I also saw that the standby redo logs in the standby database were incorrect one(they are the ones from Primary database)

Errors in file /u01/app/oracle/diag/rdbms/renodbdr/renodbdr1/trace/renodbdr1_rsm0_5984.trc:
ORA-00313: open failed for members of log group 5 of thread 1
ORA-00312: online log 5 thread 1: '+DATA/RENODBPR/ONLINELOG/group_5.335.1128095697'
ORA-17503: ksfdopn:2 Failed to open file +DATA/RENODBPR/ONLINELOG/group_5.335.1128095697
ORA-15012: ASM file '+DATA/RENODBPR/ONLINELOG/group_5.335.1128095697' does not exist
2023-02-08T16:44:06.725386-06:00
Errors in file /u01/app/oracle/diag/rdbms/renodbdr/renodbdr1/trace/renodbdr1_rsm0_5984.trc:
ORA-00313: open failed for members of log group 6 of thread 1
ORA-00312: online log 6 thread 1: '+DATA/RENODBPR/ONLINELOG/group_6.336.1128095703'
ORA-17503: ksfdopn:2 Failed to open file +DATA/RENODBPR/ONLINELOG/group_6.336.1128095703
ORA-15012: ASM file '+DATA/RENODBPR/ONLINELOG/group_6.336.1128095703' does not exist

So I had perform extra step of dropping the Standby redo logs and adding them back in the Standby database. Once I did this , I was able to open the Standby database in 'READ ONLY' mode with MRP apply running .

5. On Standby database, drop and recreate the standby redo logs

SQL> select group#, thread#, bytes/1024/1024 MB  from  v$standby_log;

    GROUP#    THREAD#         MB
---------- ---------- ----------
         5          1        200
         6          1        200
         7          1        200
         8          2        200
         9          2        200
        10          2        200

6 rows selected.

SQL> ALTER DATABASE RECOVER  managed standby database cancel;
Database altered.

SQL> alter database drop standby logfile group 5;
Database altered.
SQL> alter database drop standby logfile group 6;
Database altered.
SQL> alter database drop standby logfile group 7;
Database altered.
SQL> alter database drop standby logfile group 8;
Database altered.
SQL> alter database drop standby logfile group 9;
Database altered.
SQL> alter database drop standby logfile group 10;
Database altered.
SQL> alter database add standby logfile thread 1 group 5 ('+DATA') size 209715200;
Database altered.
SQL>  alter database add standby logfile thread 1 group 6 ('+DATA') size 209715200;
Database altered.
SQL>  alter database add standby logfile thread 1 group 7 ('+DATA') size 209715200;
Database altered.
SQL>  alter database add standby logfile thread 1 group 8 ('+DATA') size 209715200;
Database altered.
SQL>  alter database add standby logfile thread 1 group 9 ('+DATA') size 209715200;
Database altered.
SQL> alter database add standby logfile thread 1 group 10 ('+DATA') size 209715200;
Database altered.

SQL>  select group#, thread#, bytes/1024/1024 MB  from  v$standby_log;

    GROUP#    THREAD#         MB
---------- ---------- ----------
         5          1        200
         6          1        200
         7          1        200
         8          1        200
         9          1        200
        10          1        200

6 rows selected.

SQL> 

6. Stop the Standby database and start it 
[oracle@labdrhost01 ~]$ srvctl stop database -d renodbdr
[oracle@labdrhost01 ~]$ srvctl start database -d renodbdr


7. Check the Lag in standby database and see if the MRP is applying the logs to keep it in sync.











You can also check the alert log of the standby database and see the MRP is applying the logs 









I liked this one step of recovery as the old method (until 12c) when compared to what we used to do for older version where we had to perform few more steps to re-sync the physical standby database using 'Rolling forward using Incremental backup" approach.

Hope this helps.



Thanks
Sambaiah Sammeta

No comments:

Post a Comment