Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Introduction

This section will provide you with an overview of the Synchronize Standby Database (also known as the Sync feature) feature in Dbvisit Standby.

This option is to assist in two particular scenarios:

  • Resolving unrecoverable archive log gaps
    • This can happen when archive logs were lost or deleted by accident before they were transferred and applied to the standby database.  This way we can roll the standby database forward using RMAN incremental backups, instead of recreating it.  


  • Fixing logical corruption on the standby database due to nologging operations that was were performed on the primary
    • When nologging operations are performed on a primary database, there is no redo available that can be used to update the standby database.  The effect is logical corruption on the standby database.  
    • We recommend that FORCE LOGGING be enabled for the primary database

The Sync feature, in summary, does the following:

  1. Detect the current standby database SCN number
  2. Compares this with the Primary database and then starts an incremental backup on the primary for all blocks from this SCN number.
  3. The backup process can take similar time than a full RMAN backup
  4. The backup should, however, be small - depending on the difference between the primary and standby
  5. The backup is then transferred to the standby database server
  6. From there a recovery process is started that will use this incremental backup to roll forward the standby database.
  7. During this process, the standby controlfile is recreated

This process can be executed from either the Command Line Interface (CLI) or the Central Console (GUI).


Panel

On this page:

Table of Contents


2.  Synchronize Standby Database - using CLI

The command to start the Sync feature must be executed on the primary database server.

The command used is:

No Format
dbvctl -d <DDC> --sync


For full detail usage of the Sync feature, run the command "dbvctl --sync -h" 

No Format
[oracle@dbv1 /usr/dbvisit/standby]$ ./dbvctl --sync -h
    Syncronize standby database

    dbvctl -d ddc --sync [--mode CLI|BATCH|GUI] [--tmp_dir <tmp_dir>] [--tmp_dir_dest <tmp_dir_dest>] [--sync_lag] [--sync_nologging]

    --mode           CLI default
    --tmp_dir        Existing tmp directory on primary
    --tmp_dir_dest   Existing tmp directory on standby
    --sync_lag       Sync standby that is lagging behind
    --sync_nologging Sync non logged transactions


Below is an example:

No Format
[oracle@dbv1 /usr/dbvisit/standby]$ ./dbvctl -d DEV --sync
 -------------------------------------------------------------------------------
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 dbv1
Current SCN:                       1108813             Time: 2017-01-11:04:04:30

DESTINATION dbv2
Next SCN required for recovery:    1108169             Time: 2017-01-11:03:44:41

Time difference between SOURCE and DESTINATION: +0:19:49

No nonlogged transactions detected in datafiles on DESTINATION.


-------------------------------------------------------------------------------

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

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

-------------------------------------------------------------------------------
A temporary location must be specified on dbv1 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 dbv1: [/usr/tmp]: /tmp
Your input: /tmp

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

-------------------------------------------------------------------------------
A temporary location must be specified on dbv2 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 dbv2: [/usr/tmp]: /tmp
Your input: /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

>>> Restoring standby control file... done

>>> Cataloguing incremental backup in RMAN catalogue... done

>>> Applying incremental backup to the standby database... done

>>> Performing checkpoint and archiving logs... done

>>> Obtaining sync summary... done

>>> Updating Dbvisit Database repository (DDR)... done

To complete standby database sync run dbvctl on the primary, then on the standby server.


-------------------------------------------------------------------------------
SUMMARY
-------------------------------------------------------------------------------
SOURCE dbv1
Current SCN:                       1109200             Time: 2017-01-11:04:05:34

DESTINATION dbv2
Next SCN required for recovery:    1108880             Time: 2017-01-11:04:04:52

Time difference between SOURCE and DESTINATION: +0:00:42

No nonlogged transactions detected in datafiles on DESTINATION.

-------------------------------------------------------------------------------

PID:1641
TRACE:1641_dbvctl_sync_DEV_201701110404.trc


Once the process is complete, the next step is to run Dbvisit Standby manually on the primary then standby to first ship logs then apply them.  


3.  Synchronize Standby Database - using Central Console

In the section below we will show you how you can run the Sync feature for both option to recover from unrecoverable archive log gap, as well as fixing logical corruption due to nologging operations.

3.1. Recover from Unrecoverable Archivelog Gap

It may happen that an archivelog was removed by backups before it was shipped to the standby, or if the standby database is far behind the primary for some reason - it is then possible to make use of the Synchronize Standby Database feature provided by Dbvisit Standby. This method can be used instead of the traditional rebuild of the standby database using the CSD (Create Standby Database) feature.
During this process, Dbvisit Standby will perform an incremental backup on the primary database backing up the required changed blocks from the SCN number where the standby is currently and then ship this backup to the standby and then use RMAN to recover the standby using this backup. The result is that the standby database is "rolled forward" past this missing archived log. The process is easy and described in the steps below.

Note

Please note that the backup process (step 1) may take the same amount of time as a full backup as the full primary database is scanned for the required blocks to backup. The backup file should be smaller than a full backup. The recovery process should be much faster.


Step 1: Select Synchronize Standby from the main screen


Step 2: From the drop-down option - as pointed by the arrow, select the specified DDC file. In this example, the DDC named DEV2 will be selected.


Step 3: In the next step you will be presented with a screen that will require some input.

The options above marked with arrows and numbers can be summarised as follow:

  1. This is the DDC selected
  2. The primary details are being displayed which include the current SCN number and Date/Time.
  3. The standby details are displayed, this include includes the current SCN the standby database is at and its Date/Time
  4. Difference between primary and standby database is expressed as time in the format HH:MI:SS
  5. By default, the Synchronize Lag option is selected.
  6. Specify the temporary backup location where the incremental backup will be created on the primary database server. It is important that this location must be able to hold at least a full compressed backup of the primary database (RMAN compressed backupset). If you do not have sufficient disk space, the Synchronize Standby process will fail. Note that the backup in most cases will be much smaller than a normal full backup as only the blocks needed to recover the standby database will be backed up. Make sure this location have correct permission and that the Oracle software owner have has full read/-write permission on this folder.
  7. This is the temporary location on the standby database server where the temporary incremental backup will be copied. It is recommended that this location have sufficient space to hold a full compressed backup of the primary database to ensure you do not run into any space-related issues during this process. This location must exist on the standby database server and the Oracle software owner must have full read/write permission on this folder.
  8. Once you have provided the source and destination temporary backup locations, you can click on submit to start the process.

Step 4: An Active task is created for the Synchronize Standby Database task.

Once the task (Synchronize Standby Database) have has been submitted, you will notice a new task appearing on the bottom active task list. If you hover over the task with your mouse you will get updates on the progress. You can also click on the task to get a more detailed update view.

Step 5: Task completion
Once the task is complete, the Active task will have a green check mark checkmark next to it. This indicates a successful completion. If you click on the task you will get a full detail listing.


Once the above process is complete, it is recommended to manually first ship an archive log to the standby and then apply it to make sure the primary and standby database is in sync.
You can then follow this by running an archive log gap report to review the status.

3.2. Fix Logical Corruption (No-logging Operations)

Step 1:  Select the DDC file you want to run the Sync option for


Step 2:  Once selected, if there is are any datafiles affected by nologging operations they will be displayed - see [5] below.  


Step 3:  Monitor the Active Task

Please note that the backup process (step 1) may take the same amount of time as a full backup as the full primary database is scanned for the required blocks to backup. The backup file should be smaller than a full backup. The recovery process should be much faster.