We're here to help!

Manually resync the standby database - network might temporarily be unstable.

Follow

Read our docs This article covers the process of manually syncing the Standby Database after SSD using Dbvisit failed.

Description

Manually synchronize the standby database after the Synchronise Standby Database using Dbvisit failed due to network failure for example.

Steps Performed

1. Dbvisit Synchronise Standby Database failed during transfer of incremental backups onto the standby server.


oracle@dbvlab01[/usr/dbvisit/standby8/standby]: ./dbvctl -d test –sync
*** Dbvisit Standby license will expire in 3 days. Please contact Dbvisit Standby
    (www.dbvisit.com) to obtain license.
 -------------------------------------------------------------------------------
Use RMAN incremental backups to synchronise a physical standby database
with the primary database. RMAN incremental backup of the primary
database will be created, starting at the current SCN of the standby,
which in turn will then be used to roll the standby database forward in time.
RMAN incremental backups can be useful in case the physical standby database:
     Is lagging far behind the primary database.
     Has widespread nologging changes.
     Has nologging changes on a subset of datafiles.
 -------------------------------------------------------------------------------

Continue? <Yes/No> [Yes]:

-------------------------------------------------------------------------------
SUMMARY
-------------------------------------------------------------------------------
SOURCE dbvlab01
Current SCN:                       932225              Time: 2018-08-27:13:26:50

DESTINATION dbvlab03
Next SCN required for recovery:    931668              Time: 2018-08-27:13:18:40

Time difference between SOURCE and DESTINATION: +00:08:10
No nonlogged transactions detected in datafiles on DESTINATION.

-------------------------------------------------------------------------------
=>Synchronize standby database using incremental backups from SCN 931668? [Y]:
 Your input: Y

Is this correct? <Yes/No> [Yes]:

-------------------------------------------------------------------------------
TRANSPORTABLE MEDIA can be used to transfer the database backup to the standby
server.
Transportable media is an external device such as a USB drive that is first
plugged into the primary server and then manually transferred to the standby
site and plugged into the standby server to continue the process.
It can be used for large databases or slow networks.
Specifying No means the network will be used to transfer the database backup.

=>Do you want to use TRANSPORTABLE MEDIA? [N]:
Your input: N

Is this correct? <Yes/No> [Yes]:

-------------------------------------------------------------------------------
A temporary location must be specified on dbvlab01 where the database will be
backed up to first.
This location must be big enough to hold RMAN incremental backup of the primary
database).

=>Specify the location on dbvlab01: [/usr/dbvisit/standby8/standby/tmp]:
Your input: /usr/dbvisit/standby8/standby/tmp

Is this correct? <Yes/No> [Yes]:

-------------------------------------------------------------------------------
A temporary location must be specified on dbvlab03 where the backup will be
copied to before being applied.
This location must be big enough to hold RMAN incremental backup of the primary
database).

=>Specify the location on dbvlab03: [/usr/dbvisit/standby8/standby/tmp]:
Your input: /usr/dbvisit/standby8/standby/tmp

Is this correct? <Yes/No> [Yes]:

Synchronising Standby Database
 -------------------------------------------------------------------------------

>>> Deleting previous incremental backup... done

>>> Creating incremental backup of primary database... done

>>> Creating standby control file... done

>>> Transferring backup to standby server... done
^C
Dbvisit Standby terminated...
Error Code: 2000

Tracefile from server: dbvlab01 (PID:17227)
17227_dbvctl_sync_test_201808271327.trc
oracle@dbvlab01[/usr/dbvisit/standby8/standby]: 

2. Get the current SCN of the Standby database:

SQL> SELECT CURRENT_SCN FROM V$DATABASE;
CURRENT_SCN
-----------
     931667

3. Check and compare RMAN backup files on Primary and Standby:

oracle@dbvlab01[/usr/dbvisit/standby8/standby/tmp]: ll
total 11164
-rw-r----- 1 oracle asmadmin  499712 Aug 27 13:27 dbv_test_sync_07tbjve8_1_1.rman
-rw-r----- 1 oracle asmadmin 1097728 Aug 27 13:27 dbv_test_sync_08tbjveb_1_1.rman
-rw-r--r-- 1 oracle oinstall    2839 Aug 27 13:27 dbv_test_sync_info.json
-rw-r----- 1 oracle asmadmin 9797632 Aug 27 13:27 dbv_test_sync_stdby.ctl
oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]: ll
total 11152
-rw-r--r-- 1 oracle oinstall  499712 Aug 27 13:27 dbv_test_sync_07tbjve8_1_1.rman
-rw-r--r-- 1 oracle oinstall 1097728 Aug 27 13:27 dbv_test_sync_08tbjveb_1_1.rman
-rw-r--r-- 1 oracle oinstall    2839 Aug 27 13:27 dbv_test_sync_info.json
-rw-r--r-- 1 oracle oinstall 9797632 Aug 27 13:27 dbv_test_sync_stdby.ctl
oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]:

4. Start the Standby database in nomount

oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]: sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Mon Aug 27 13:30:24 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area  801701888 bytes
Fixed Size		    2257520 bytes
Variable Size		  272633232 bytes
Database Buffers	  524288000 bytes
Redo Buffers		    2523136 bytes
SQL> exit

5. Restore the Standby Controlfile and startup mount:

oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]: rman

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Aug 27 13:30:47 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target
connected to target database: TEST (not mounted)

RMAN> run {
2> restore standby controlfile from '/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_stdby.ctl';
3> release channel C_DBVISIT;
4> }

Starting restore at 27/08/2018:13:31:42
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/test/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/test/control02.ctl
Finished restore at 27/08/2018:13:31:43

released channel: C_DBVISIT
RMAN> exit
oracle@dbvlab03[/u01/app/oracle/fast_recovery_area/test]: sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Mon Aug 27 13:33:19 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database mount;
Database altered.

SQL> exit

6. Catalog the incremental backup pieces in RMAN:

oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]: rman
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Aug 27 13:35:20 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target
connected to target database: TEST (DBID=2283412895, not open)

RMAN> catalog backuppiece '/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_07tbjve8_1_1.rman';

Starting implicit crosscheck backup at 27/08/2018:13:36:08
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=24 device type=DISK
Crosschecked 1 objects
Finished implicit crosscheck backup at 27/08/2018:13:36:08

Starting implicit crosscheck copy at 27/08/2018:13:36:08
using channel ORA_DISK_1
Finished implicit crosscheck copy at 27/08/2018:13:36:08

searching for all files in the recovery area
cataloging files...
no files cataloged

cataloged backup piece
backup piece handle=/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_07tbjve8_1_1.rman RECID=7 STAMP=985268168

RMAN> catalog backuppiece '/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_08tbjveb_1_1.rman';

cataloged backup piece
backup piece handle=/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_08tbjveb_1_1.rman RECID=8 STAMP=985268196
RMAN>

7. List the backup tag.

RMAN> list backup tag'dbv_test_sync';

List of Backup Sets
===================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7       Incr    480.00K    DISK        00:00:00     27/08/2018:13:27:36
        BP Key: 7   Status: AVAILABLE  Compressed: YES  Tag: DBV_TEST_SYNC
        Piece Name: /usr/dbvisit/standby8/standby/tmp/dbv_test_sync_07tbjve8_1_1.rman
  List of Datafiles in backup set 7
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Incr 932293     27/08/2018:13:27:36 /u01/app/oracle/oradata/test/system01.dbf
  2       Incr 932293     27/08/2018:13:27:36 /u01/app/oracle/oradata/test/sysaux01.dbf
  3       Incr 932293     27/08/2018:13:27:36 /u01/app/oracle/oradata/test/undotbs01.dbf
  4       Incr 932293     27/08/2018:13:27:36 /u01/app/oracle/oradata/test/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
8       Incr    1.03M      DISK        00:00:00     27/08/2018:13:27:39
        BP Key: 8   Status: AVAILABLE  Compressed: YES  Tag: DBV_TEST_SYNC
        Piece Name: /usr/dbvisit/standby8/standby/tmp/dbv_test_sync_08tbjveb_1_1.rman
  Control File Included: Ckp SCN: 932294       Ckp time: 27/08/2018:13:27:39

8. Recover Standby database

oracle@dbvlab03[/usr/dbvisit/standby8/standby/tmp]: rman
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Aug 27 13:39:58 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

RMAN> connect target
connected to target database: TEST (DBID=2283412895, not open)

RMAN> run {
2> allocate channel C_DBVISIT DEVICE TYPE DISK ;
3> recover database noredo from tag'dbv_test_sync';
4> release channel C_DBVISIT;
5> }

using target database control file instead of recovery catalog
allocated channel: C_DBVISIT
channel C_DBVISIT: SID=19 device type=DISK

Starting recover at 27/08/2018:13:41:01
channel C_DBVISIT: starting incremental datafile backup set restore
channel C_DBVISIT: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/oracle/oradata/test/system01.dbf
destination for restore of datafile 00002: /u01/app/oracle/oradata/test/sysaux01.dbf
destination for restore of datafile 00003: /u01/app/oracle/oradata/test/undotbs01.dbf
destination for restore of datafile 00004: /u01/app/oracle/oradata/test/users01.dbf
channel C_DBVISIT: reading from backup piece /usr/dbvisit/standby8/standby/tmp/dbv_test_sync_07tbjve8_1_1.rman
channel C_DBVISIT: piece handle=/usr/dbvisit/standby8/standby/tmp/dbv_test_sync_07tbjve8_1_1.rman tag=DBV_TEST_SYNC
channel C_DBVISIT: restored backup piece 1
channel C_DBVISIT: restore complete, elapsed time: 00:00:01

Finished recover at 27/08/2018:13:41:02
released channel: C_DBVISIT
RMAN>

9. Sync archlogs with -R option from Primary

oracle@dbvlab01[/usr/dbvisit/standby8/standby]: ./dbvctl -d test -R
=============================================================
Dbvisit Standby Database Technology (8.0.22_0_g863e41e4) (pid 18042)
dbvctl started on dbvlab01: Mon Aug 27 14:18:17 2018
=============================================================

*** Dbvisit Standby license will expire in 3 days. Please contact Dbvisit Standby
    (www.dbvisit.com) to obtain license.

Note FORCE_LOGGING is disabled in the primary database.

>>> Resynch option given. Dbvisit Standby configuration will be copied to dbvlab03...
>>> No new logs to transfer to dbvlab03 for test. LOGSWITCH=N

=============================================================
dbvctl ended on dbvlab01: Mon Aug 27 14:18:21 2018
=============================================================

10. Manually run Dbvisit on Primary to transfer archived logs

oracle@dbvlab01[/usr/dbvisit/standby8/standby]: ./dbvctl -d test
=============================================================
Dbvisit Standby Database Technology (8.0.22_0_g863e41e4) (pid 18131)
dbvctl started on dbvlab01: Mon Aug 27 14:19:10 2018
=============================================================

*** Dbvisit Standby license will expire in 3 days. Please contact Dbvisit Standby
    (www.dbvisit.com) to obtain license.
>>> Obtaining information from standby database (RUN_INSPECT=Y)... done
    Thread: 1 Archive log gap: 0. Transfer log gap: 0

Note FORCE_LOGGING is disabled in the primary database.

>>> Performing a log switch... done
>>> Transferring Log file(s) from test on dbvlab01 to dbvlab03 for thread 1:

    thread 1 sequence 4 (o1_mf_1_4_fr6qx2l9_.arc)

=============================================================
dbvctl ended on dbvlab01: Mon Aug 27 14:19:18 2018
=============================================================

11. Manually run Dbvisit on Standby to apply archived logs

oracle@dbvlab03[/usr/dbvisit/standby8/standby]: ./dbvctl -d test
=============================================================
Dbvisit Standby Database Technology (8.0.22_0_g863e41e4) (pid 14706)
dbvctl started on dbvlab03: Mon Aug 27 14:20:20 2018
=============================================================

>>> Applying Log file(s) from dbvlab01 to test on dbvlab03:

    thread 1 sequence 4 (1_4_985266463.arc)
    thread 1 sequence 5 (1_5_985266463.arc)
    Last applied log(s):
    thread 1 sequence 5

    Next SCN required for recovery 935323 generated at 2018-08-27:14:20:02 +12:00.
    Next required log thread 1 sequence 6

=============================================================
dbvctl ended on dbvlab03: Mon Aug 27 14:20:23 2018
=============================================================
Have more questions? Submit a request

Comments