Synchronize a Standby Database using the CLI
Following steps need to be performed to synchronize standby database using the Dbvisit Standby Command Line Interface (CLI).
Step 1: On the Primary Node execute the “dbvsit_setup” command (If this is part of a RAC environment, this step can be done on any of the primary nodes):
cd /usr/local/dbvisit/standby/ ./dbvisit_setup
Step 2: Once this is executed on the Primary node, you will be presented with the following menu from which you can select option 8, “Synchronize Standby Database”
========================================================= Dbvisit Standby Database Technology (6.0.34.9322) http://www.dbvisit.com Dbvisit Database setup Default values will be shown in [] Options: 1) New Dbvisit Database setup (combines options 2,3,4) 1a) New Dbvisit RAC Instance setup (combines options 2,3,4) 2) New Dbvisit Database configuration (DDC) file setup 3) New Dbvisit Archive Management Module (AMM) setup 4) New Dbvisit Database repository (DDR) setup 5) Manage Dbvisit Database repository (DDR) 6) Update Dbvisit Database configuration (DDC) file 7) Create Standby Database (and template) 8) Synchronize Standby Database 9) Uninstall Dbvisit Database repository (DDR) E) Exit ========================================================= Please enter choice : 8
Step 3: Once you select option 8, you will be asked to confirm the database environment (DDC).
In this example, prmary database name and DDC name is testdb.
------------------------------------------------------------------------------ =>Sync Standby Database. Primary database will NOT be shutdown. Choose database: The following Oracle database(s) have a
Dbvisit Database configuration (DDC) file on this server: DDC === 1) testdb 2) Return to menu Please enter choice : 1 Is this correct? <Yes/No> [Yes]: Yes Database proddb is up. ------------------------------------------------------------------------------- Use RMAN incremental backups to synchronize a physical standby
database with the primary database.RMAN incremental backup of the primary
database will be created, that starts at the current SCN of the standby,
which can then be used to roll the standby database forward in time. RMAN incremental backups may be useful
because the physical standby database either: Lags far behind the primary database Has widespread nologging changes Has nologging changes on a subset of datafiles ------------------------------------------------------------------------------- Continue? <Yes/Cancel> [Yes]: Yes
Once you have confirmed that you want to continue with the re-synchronization of the standby database, Dbvisit Standby will extract information from both the primary and standby databases and display it for your review.
Querying database... Please wait... ------------------------------------------------------------------------------- SUMMARY ------------------------------------------------------------------------------- PRIMARY Current SCN: 2579852 Time: 20120725-15:14:03 Current sequence(s): Thread 1 Sequence 1879 Last archived sequence(s): Thread 1 Sequence 1878 STANDBY Current SCN: 2578548 Time: 20120725-14:34:42 Next SCN required for recovery: 2578549 Time: 20120725-14:34:42 Sequence(s) required for recovery: Thread 1 Sequence 1879 Nonlogged transactions detected in the following standby datafiles: File id First nonlogged SCN First nonlogged time 5 2578473 20120725-14:33:56 -------------------------------------------------------------------------------
At this point in time, you can select to synchronize standby database using incremental backups from SCN or to synchronize standby database to address nologging changes. You can also select both options as well. It also asks for temporary location on primary and standby server to to store the incremental RMAN backups that will be created from the primary, which will then be applied to the standby.
Synchronize standby database using incremental backups from SCN 2578549? [Yes]:No Is this correct? <Yes/No> [Yes]: Yes Synchronize standby database to address nologging changes? [Yes]: Yes Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin201 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 dbvlin201: [/u02/backups]: /backup/rman Directory for temporary location will be: /backup/rman Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin202 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 dbvlin202: [/u02/backups]: /backup/rman Directory for temporary location will be: /backup/rman Is this correct? <Yes/No> [Yes]: Yes
------------------------------------------------------------------------------- Synchronize Standby Database ------------------------------------------------------------------------------- Step 1 - Delete previous incremental backup...done Step 2 - Create incremental backup of primary database...done Step 3 - Create standby controlfile...done Step 4 - Transfer backup to the standby server...done Step 5 - Restore new standby controlfile...done Step 6 - Catalog incremental backup in RMAN catalog...done Step 7 - Apply incremental backup to the standby database...done Step 8 - Perform log switch on primary...Waiting 3 seconds for log switch completion...done Step 9 - Obtain sync summary...done Step 10 - Update Dbvisit repository...done ------------------------------------------------------------------------------- SUMMARY ------------------------------------------------------------------------------- PRIMARY Current SCN: 2580284 Time: 20120725-15:23:42 Current sequence(s): Thread 1 Sequence 1880 Last archived sequence(s): Thread 1 Sequence 1879 STANDBY Current SCN: 2580217 Time: 20120725-15:22:27 Next SCN required for recovery: 2578549 Time: 20120725-14:34:42 Sequence(s) required for recovery: Thread 1 Sequence 1879 No nonlogged transactions detected in standby datafiles. ------------------------------------------------------------------------------- To complete standby database sync run dbvisit on the primary, then on the standby. Please press <Enter> to continue...
Once standby database is synchronised, run default command first on the primary(send archive) and then on the standby(apply archive) servers.
Example when using an Oracle RAC environment
The example below is showing the running of the Synchronise Standby database in a RAC environment.
The process is run from only one of the RAC nodes and is the same as when you would run it for a single instance environment
oracle@dbvrlin301[/usr/dbvisit/standby]: ./dbvisit_setup ========================================================= Dbvisit Standby Database Technology (7.0.36.13688) http://www.dbvisit.com ========================================================= =>dbvisit_setup only needs to be run on the primary server. Is this the primary server? <Yes/No> [Yes]: ========================================================= Dbvisit Standby Database Technology (7.0.36.13688) http://www.dbvisit.com Dbvisit Database setup Default values will be shown in [] Options: 1) New Dbvisit Database setup (combines options 2,3,4) 1a) New Dbvisit RAC Instance setup (combines options 2,3,4) 2) New Dbvisit Database configuration (DDC) file setup 3) New Dbvisit Archive Management Module (AMM) setup 4) New Dbvisit Database repository (DDR) setup 5) Manage Dbvisit Database repository (DDR) 6) Update Dbvisit Database configuration (DDC) file 7) Create Standby Database (and template) 8) Synchronize Standby Database 9) Uninstall Dbvisit Database repository (DDR) E) Exit ========================================================= Please enter choice : 8 ------------------------------------------------------------------------------ =>Sync Standby Database. Primary database will NOT be shutdown. Choose database: The following Oracle database(s) have a Dbvisit Database configuration (DDC) file on this server: DDC === 1) TSTRAC1 2) Return to menu Please enter choice : 1 Is this correct? <Yes/No> [Yes]: Database TSTRAC1 is up. ------------------------------------------------------------------------------- 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/Cancel> [Yes]: Querying database... Please wait... ------------------------------------------------------------------------------- SUMMARY ------------------------------------------------------------------------------- PRIMARY Current SCN: 1777279 Time: 2015-03-03:15:50:03 Current sequence(s): Thread 1 Sequence 44 Thread 2 Sequence 21 Last archived sequence(s): Thread 1 Sequence 43 Thread 2 Sequence 20 STANDBY Current SCN: 1770746 Time: 2015-03-03:15:11:13 Next SCN required for recovery: 1770747 Time: 2015-03-03:15:11:13 Sequence(s) required for recovery: Thread 1 Sequence 39 Thread 2 Sequence 20 No nonlogged transactions detected in standby datafiles. ------------------------------------------------------------------------------- Synchronize standby database using incremental backups from SCN 1770747? [Yes]: Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvrlin301 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 dbvrlin301: [/usr/tmp]: Directory for temporary location will be: /usr/tmp Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvrlin305 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 dbvrlin305: [/usr/tmp]: Directory for temporary location will be: /usr/tmp Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- Synchronising Standby Database ------------------------------------------------------------------------------- Step 1 - Deleting previous incremental backup... - done. Step 2 - Creating incremental backup of primary database... - done. Step 3 - Creating standby control file... - done. Step 4 - Transferring backup to standby server... - done. Step 5 - Restoring standby control file... - done. Step 6 - Cataloguing incremental backup in RMAN catalogue... - done. Step 7 - Applying incremental backup to the standby database... - done. Step 8 - Performing log switch on primary... - done. Step 9 - Obtaining sync summary... - done. Step 10 - Updating Dbvisit repository... - done. ------------------------------------------------------------------------------- SUMMARY ------------------------------------------------------------------------------- PRIMARY Current SCN: 1777519 Time: 2015-03-03:15:52:43 Current sequence(s): Thread 1 Sequence 45 Thread 2 Sequence 22 Last archived sequence(s): Thread 1 Sequence 44 Thread 2 Sequence 21 STANDBY Current SCN: 1777442 Time: 2015-03-03:15:51:15 Next SCN required for recovery: 1777381 Time: 2015-03-03:15:50:53 Sequence(s) required for recovery: Thread 1 Sequence 44 Thread 2 Sequence 21 No nonlogged transactions detected in standby datafiles. ------------------------------------------------------------------------------- To complete standby database sync run dbvisit on all primary nodes, then on the standby. If a primary node was down during sync operation, you need to run dbvisit with -R option on this node. Please press <Enter> to continue...