Multiple Standby Databases
Setting up for multiple standby databases
It is possible to run more than one standby database for the same primary database when using Dbvisit Standby.
These standby databases must all share the same db_name, but the instance name (or ORACLE_SID) and service_names may be different. The standby databases are normally located on different standby servers, but it is also possible to have multiple standby databases on the same standby server.
Each standby database must have its own unique Dbvisit Standby Database Configuration (DDC) file (dbv_<DDC>.env).
Because the database name (ORACLE_SID) will normally be the same for multiple standby databases, a unique number can be added to each DDC file to make it unique. For example to have 3 different standby databases for the same primary database called w112g:
- dbv_w112g.env (The original DDC file for primary database and first standby database).
- dbv_w112g2.env (A new DDC file for primary database and second standby database).
- dbv_w112g3.env (A new DDC file for primary database and third standby database)
etc.
To setup for multiple standby DDC files please follow the following steps:
1. Copy the DDC file and give it a new name.
Example: copy dbv_w112g.env dbv_w112g2.env
Where w112g is the name of the database.
2. Edit the new DDC file and change the DESTINATION variable. This must be set to the second standby server that is running the second standby database. Do not change the ORACLE_SID.
Example: DESTINATION=dbvisit13
Where dbvisit13 is the second standby server.
3. If any of the other standby database settings are different, these must be edited as well. The variables that can be changed are:
ORACLE_SID_DEST* ORACLE_BASE_DR LOGDIR_DR ARCHDEST MAX_TIMES_TRIED LEAVE_COMPRESS_DEST ADD_DATAFILE
For a multiple standby database on the same node the ORACLE_SID_DEST must be different unique
4. Dbvisit Standby must be scheduled for each multiple standby database separately on the primary server.
5. It is possible to have a different schedule for each standby database. For example the disaster recovery standby database runs every 15 minutes, but the reporting standby database only runs every hour from 7pm to 7am.
6. On each standby server, Dbvisit Standby needs to be scheduled. Note that the correct DDC file needs to be specified.
Dbvisit Standby must be installed on All servers that will be used (Primary server and all the standby servers).
The Dbvnet Password must be the same on all nodes
Creating multiple standby databases
When the DDC files have been copied and updated for the new standby databases, dbvisit_setup can be run to create the new standby databases. Each unique DDC file will be listed as a separate SID. In our example we assume that 3 DDC files have been created as shown above (dbv_w112g.env, dbv_w112g2.env and dbv_w112g3.env).
dbvisit_setup
7) Create Standby Database
------------------------------------------------------------------------------
=>Creating Standby Database.
For which primary database do you want to create a standby database?
The following Oracle database(s) have a Dbvisit Database configuration (DDC)
file on this server:
SID
===
1) w112g
2) w112g2
3) w112g3
4) Return to menu
Please enter choice : 2
Choose the SID that corresponds to the new standby database. In the above example w112g2 and w112g3 represent the new standby databases. Choosing option 2 will create the new standby database that is represented by w112g2, and choosing option 3 creates the new standby database that is represented by w112g3.
Initially running Dbvisit Standby for multiple standby databases
The first time that Dbvisit Standby is executed for a new standby database, run Dbvisit Standby with the resynch option.
dbvisit -R w112g2
Where dbvisitp2 is the DDC for the new standby database.
This ensures that the Dbvisit Standby Database Configuration (DDC) file (and software if necessary) is copied over to the standby server. Subsequently run Dbvisit Standby as per normal.
Example - Configuring Dbvisit Standby for multiple standby databases
The following example will show how to configure Dbvisit Standby for 3 standby databases all being kept in synch from the same primary database.
Assuming that 3 DDC files have been created as shown above (dbv_w112g.env, dbv_w112g2.env and dbv_w112g3.env).
First standby database:
To run Dbvisit Standby on the primary server to keep a first standby database up to date.
dbvisit w112g
Where w112g is the DDC for the first standby database.
To run Dbvisit Standby on the standby server to keep a first standby database up to date.
dbvisit w112g
Where w112g is the DDC for the second standby database.
Second standby database:
To run Dbvisit Standby on the primary server to keep a second standby database up to date.
dbvisit w112g2
Where w112g2 is the DDC for the second standby database.
To run Dbvisit Standby on the standby server to keep a second standby database up to date.
dbvisit w112g2
Where w112g2 is the DDC for the second standby database.
Third standby database:
To run Dbvisit Standby on the primary server to keep a third standby database up to date.
dbvisit w112g3
Where w112g2 is the DDC for the third standby database.
To run Dbvisit Standby on the standby server to keep a third standby database up to date.
dbvisit w112g3
Where w112g2 is the DDC for the third standby database.
These commands can be scheduled in the appropriate scheduler to keep the standby databases in synch.
Graceful Switchover and multiple standby databases
Graceful switchover will change the role of the primary database to a standby database and one of the standby databases to a primary database.
Dbvisit Standby can still be used to keep all the standby databases in synch from the new primary database.
The following manual steps need to be performed to keep the other standby databases in synch with the new primary database.
- Assuming that 3 DDC files have been created as shown above (dbv_w112g.env, dbv_w112g2.env and dbv_w112g3.env).
- Assuming the first standby database has been converted to the new primary database (DDC file dbv_w112g.env).
Second standby database:
Copy the DDC file (dbv_w112g2.env) from the second standby server to the new primary server and edit the DDC file so that SOURCE= the new primary server
Schedule Dbvisit Standby on the new primary server with command:
dbvisit w112g2
Third standby database:
Copy the DDC file (dbv_w112g3.env) from the third standby server to the new primary server and edit the DDC file so that SOURCE= the new primary server.
Schedule Dbvisit Standby on the new primary server with command:
dbvisit w112g3
Dbvisit Standby will now keep all 3 standby databases in synch with the new primary database.