This section will show you an example of creating a standby database. This Create Standby Database process (setup) is also referred to as CSD.
Note | ||
---|---|---|
| ||
Creating a standby database is performed on the primary server (primary node). If you are using Oracle RAC, you only need to run the Create Standby Database (CSD) process from one of the primary nodes (1st node recommended). But you must have a DDC file already created on both primary nodes. |
The example below will show you how to create a standby database running on standby server "dbvlin102" from the primary database called "proddb" running on the primary server "dbvlin101".
...
Windows only:
Start the "Dbvisit Standby command console" from the Start Menu ->Programs -> Dbvisit -> Standby.
This will start a Command Line with your session already in the DBVISIT_BASE/standby directory.
...
Note |
---|
It is possible to create a standby database using a normal filesystem while the primary database is making use of ASM. Please check: "Section - Primary on ASM and Standby using Filesystem" For critical production (primary) and standby environments it is always recommended to create the standby environment the same as the primary. |
...
In the above example, we agree with the parameters as specified, and specify option 1 after which the parameters are reviewed. If you do want to adjust the parameter use option 2 to edit specific parameters. Remember you can always adjust some of the parameters once the standby database creation is complete.
Step 9:
It is possible to use TRANSPORTABLE MEDIA for very large databases or slow networks. When using this option, a backup of the primary database will be created on local storage (can be attached storage such as an external drive, but this must be mounted/made available by the system administrator). Once the backup is complete, it can be shipped (courier or other methods) to the standby site where it is then attached to the standby server. Once attached you can restart the Dbvisit Standby creation to complete the creation of the standby using this backup. This method is recommended for very large databases as well as when there is an extremely slow network between the primary and standby servers.
No Format |
---|
-------------------------------------------------------------------------------
Do you want to use TRANSPORTABLE MEDIA 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.
[No]: No
Transportable media will be used: N
Is this correct? <Yes/No> [Yes]: Yes |
In this example we specify not to use Transportable Media and confirm our selection.
Step 10:
To create the standby database temporary locations on both primary and standby server must be specified, to hold a database backup.
Note |
---|
Make sure this temporary backup location exist on both the primary and standby servers and can hold a full compressed (RMAN Compressed) backup of the primary database |
No Format |
---|
Note |
When running a primary database using ASM and you are looking at creating a standby database using a normal Filesystem based storage, you need to make sure you review the following parameters:
When using ASM these values can be set to specific ASM disk groups on the primary server. But when you are creating the standby database, you need to update these parameters to reflect the standby filesystem structure. Example, this is the parameters on a primary database using ASM:
Now when creating the standby database, you will lets say use d:\oracle\oradata as your primary datafile location (the database files will be created in d:\oracle\oradata\DB_NAME example d:\oracle\oradata\prod where prod is the database name). And with regards to the Flash/Fast recovery area you might be using d:\oracle\fast_recovery_area. The following adjustments to the db_create_file_dest and db_recovery_file_dest should be made:
If you have the db_create_online_log_dest_n values set you have to adjust them as well.
|
Step 9:
It is possible to use TRANSPORTABLE MEDIA for very large databases or slow networks. When using this option, a backup of the primary database will be created on local storage (can be attached storage such as an external drive, but this must be mounted/made available by the system administrator). Once the backup is complete, it can be shipped (courier or other methods) to the standby site where it is then attached to the standby server. Once attached you can restart the Dbvisit Standby creation to complete the creation of the standby using this backup. This method is recommended for very large databases as well as when there is an extremely slow network between the primary and standby servers.
No Format |
---|
----------------------------------------------------------------------------------- ADo temporaryyou locationwant mustto beuse specifiedTRANSPORTABLE onMEDIA dbvlin101to wheretransfer the database willbackup beto backedthe upstandby toserver? first.Transportable Thismedia locationis mustan beexternal bigdevice enoughsuch toas holda RMANUSB backupdrive ofthat theis wholefirst database (1.36GB). Specify the location on this server: [/usr/tmp]: /backup/proddb Directory for temporary location will be: /backup/proddb Is this correct? <Yes/No> [Yes]: Yes ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin102 where the database backup will be copied to before moving to specified locations. Specify location on remote server: [/backup/proddb]: /backup/proddb Directory for temporary will be: /backup/proddb Is this correct? <Yes/No> [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. [No]: No Transportable media will be used: N Is this correct? <Yes/No> [Yes]: Yes |
In this example we are using the temporary backup location which exist on both the primary and standby servers called /backup/proddb. specify not to use Transportable Media and confirm our selection.
Step 10:
To create the standby database, temporary locations on both primary and standby server must be specified.
Note |
---|
Make sure this directory exist and has the correct permission. |
Step 11:
...
temporary backup location exist on both the primary and standby servers and can hold a full compressed (RMAN Compressed) backup of the primary database |
No Format |
---|
------------------------------------------------------------------------------- TheA creationtemporary oflocation themust standbybe database consists of 2 parts: 1) Backup database to temporary location. 2) Transfer backup from temporary location to standby server. The process can be stopped after step 1 and then continued with step 2 at a later date. Do you want to the process to stop between these 2 steps? [No]: No Process will stop between steps: N specified on dbvlin101 where the database will be backed up to first. This location must be big enough to hold RMAN backup of the whole database (1.36GB). Specify the location on this server: [/usr/tmp]: /backup/proddb Directory for temporary location will be: /backup/proddb Is this correct? <Yes/No> [Yes]: Yes |
In the above example we choose not to stop between the two steps (recommended) and confirm our selection.
Step 12:
It is possible to specify the locations of standby datafiles, redo logs and tempfiles different as primary server. The next few questions shows you the recommended location. You can adjust the locations by using option 2. In the examples below we want to have the standby database the same as the primary one and we accept the default values provided by the setup:
No Format |
---|
Primary database contains non-OMF datafiles and/or tempfiles. Creation of non-OMF standby datafiles and/or tempfiles requires valid filesystem locations on the standby server. Review and confirm standby locations to create standby non-OMF datafiles and tempfiles. -------------------- ------------------------------------------------------------------------------- A temporary location must be specified on dbvlin102 where the database backup will be copied to before moving to specified locations. Specify location on remote server: [/backup/proddb]: /backup/proddb Directory for temporary will be: /backup/proddb Is this correct? <Yes/No> [Yes]: Yes |
In this example we are using the temporary backup location which exist on both the primary and standby servers called /backup/proddb.
Note |
---|
Make sure this directory exist and has the correct permission. |
Step 11:
The process of creating a standby database can be broken into two steps. You can stop between these steps if required.
No Format |
---|
----------------------------------------------------------- Primary ===> Standby ------------------------------------------------------------------------------- /u01/app/oracle/oradata/proddb ===> /u01/app/oracle/oradata/proddb ------------------------------------------------------------------------------- What would you like to do: 1 - Confirm standby location(s) are correct and continue 2 - Provide different standby location(s) Please enter your choice [1]: 1 Standby locations validated. Primary database contains non-OMF redo logs. Creation of non-OMF redo logs Dbvisit Standby requires valid -------------------- The creation of the standby database consists of 2 parts: 1) Backup database to temporary location. 2) Transfer backup from temporary location to standby server. The process can be stopped after step 1 and then continued with step 2 at a later date. Do you want to the process to stop between these 2 steps? [No]: No Process will stop between steps: N Is this correct? <Yes/No> [Yes]: Yes |
In the above example we choose not to stop between the two steps (recommended) and confirm our selection.
Step 12:
It is possible to specify the locations of standby datafiles, redo logs and tempfiles different as primary server. The next few questions shows you the recommended location. You can adjust the locations by using option 2. In the examples below we want to have the standby database the same as the primary one and we accept the default values provided by the setup:
No Format |
---|
Primary database contains non-OMF datafiles and/or tempfiles. Creation of non-OMF standby datafiles and/or tempfiles requires valid filesystem locations on the standby server. Review and confirm standby locations to create standby non-OMF datafiles redoand logstempfiles. ------------------------------------------------------------------------------- Primary ===> Standby ------------------------------------------------------------------------------- /u01/app/oracle/fast_recovery_area/PRODDB/onlinelogoradata/proddb ===> /u01/app/oracle/fast_recovery_area/PRODDB/onlinelogoradata/proddb ------------------------------------------------------------------------------- What would you like to do: 1 - Confirm standby location(s) are correct and continue 2 - Provide different standby location(s) Please enter your choice [1]: 1 Standby locations validated. |
Once the selections are made they are verified.
Step 13:
Provided answers can be stored as a template for future use (re-running creating of a standby database):
No Format |
---|
Primary database contains non-OMF redo logs. Creation of non-OMF redo logs Dbvisit Standby requires valid filesystem locations on the standby server. Review and confirm standby locations to create standby non-OMF redo logs. ------------------------------------------------------------------------------- =>Create standby database template for proddb using provided answers? <Yes/No> [Yes]: Yes |
In this example we specify "Yes" to save the above steps as a template so we can re-use this template at a later stage if needed.
Step 14:
The final step is to confirm the start of the Create Standby Database (CSD) process. Once you specify yes (option 1) to continue the standby creation process will start.
The first part of the CSD process is to run a "Pre-Flight Check". What this process does is to create a spfile and start an instance on the standby server. This is to double check that the standby server is ready for the creation of the standby database.
No Format |
---|
What would you like to do: 1 - Continue with creating a standby database 2 - Terminate creating a standby database. The saved template will be available for future use Primary ===> Standby ------------------------------------------------------------------------------- /u01/app/oracle/fast_recovery_area/PRODDB/onlinelog ===> /u01/app/oracle/fast_recovery_area/PRODDB/onlinelog ------------------------------------------------------------------------------- What would you like to do: 1 - Confirm standby location(s) are correct and continue 2 - Provide different standby location(s) Please enter your choice [1]: 1 Standby >>> Dbvisit will now run a pre-flight check for standby database creation. An attempt will be made to create a standby (s)pfile using oracle standby database parameters, followed by trying to start the standby instance. If this step fails, then please double-check the following items before re-running Dbvisit again: 1) Review the standby database parameters you have supplied and provide valid values unless a template is used. 2) Recreate the template to provide valid values for standby database parameters if a template is used. Runninglocations validated. |
Once the selections are made they are verified.
Step 13:
Provided answers can be stored as a template for future use (re-running creating of a standby database):
No Format |
---|
-------------------------------------------------------------------------------
=>Create standby database template for proddb using provided answers? <Yes/No>
[Yes]: Yes |
In this example we specify "Yes" to save the above steps as a template so we can re-use this template at a later stage if needed.
Step 14:
The final step is to confirm the start of the Create Standby Database (CSD) process. Once you specify yes (option 1) to continue the standby creation process will start.
The first part of the CSD process is to run a "Pre-Flight Check". What this process does is to create a spfile and start an instance on the standby server. This is to double check that the standby server is ready for the creation of the standby database.
No Format |
---|
What would you like to do: 1 - Continue with creating a standby database 2 - Terminate creating a standby database. The saved template will be available for future use Please enter your choice [1]: 1 >>> Dbvisit will now run a pre-flight check for standby database creation, please wait... - done. |
Once the "Pre-Flight Check" completes, the Create Standby Database (CSD) process start.
Detail output of the Standby Creation is displayed:
No Format |
---|
>>> Backing up primary database... Backing up datafile 1... - done. Backing up datafile 2... - done. Backing up datafile 3... - done. Backing up datafile 4... - done. >>> Creating standby control file... - done. Backup of primary database completed. >>> Transferring backup from dbvlin101 to dbvlin102... > Transferring 'dbv_proddb_csd_dbf_1_0jov5bt8_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [9398 KB/s] - done. > Transferring 'dbv_proddb_csd_dbf_1_0kov5bul_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [10659 KB/s] - done. > Transferring 'dbv_proddb_csd_dbf_2_0lov5bur_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [10537 KB/s] - done. An attempt will be made to create a standby (s)pfile using oracle standby database parameters, followed by trying to start the standby instance. If this step fails, then please double-check the following items before re-running Dbvisit again: 1) Review the standby database parameters you have supplied and provide valid values unless a template is used. 2) Recreate the template to provide valid values for standby database parameters if a template is used. Running pre-flight check for standby creation, please wait... - done. |
Once the "Pre-Flight Check" completes, the Create Standby Database (CSD) process start.
Detail output of the Standby Creation is displayed:
No Format |
---|
>>> Backing up primary database... Backing up datafile 1... - done. Backing up datafile 2... - done. Backing up datafile 3... - done. Backing up datafile 4... - done. >>> Creating standby control file... - done. Backup of primary database completed. >>> Transferring backup from dbvlin101 to dbvlin102... > Transferring 'dbv_proddb_csd_dbf_31_0mov5bvp0jov5bt8_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [106449398 KB/s] - done. > Transferring 'dbv_proddb_csd_dbf_41_0nov5c040kov5bul_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [1037910659 KB/s] - done. >>>> Restoring standby control files... - done. >>> Starting standby database proddb on dbvlin102 mount... - done. >>> Restoring datafiles on dbvlin102... Restoring datafile 1 Transferring 'dbv_proddb_csd_dbf_2_0lov5bur_1_1.rman' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [10537 KB/s] - done. > Restoring datafile 2 - done.Transferring 'dbv_proddb_csd_dbf_3_0mov5bvp_1_1.rman' to server dbvlin102:7890 Restoring datafile 3Progress: 0%...20%...40%...60%...80%...100% [10644 KB/s] - done. > Transferring Restoring datafile 4 - done. >>> Renaming standby redo logs and tempfiles on dbvlin102... - done. >>> Performing checkpoint and archiving logs... - done. >>> Finishing standby database creation... - done. Standby database created. To complete creating standby database please run Dbvisit on the primary server first, then on the standby server, to ensure the standby database is in sync with the primary database. Please press <Enter> to continue... |
Step 15:
The standby database has been created, the next steps are highlighted, which is to run dbvisit standby on the primary server, followed by running it on the standby server. This is done by running the "dbvisit <DDC>" command first on primary then the standby.
No Format |
---|
'dbv_proddb_csd_dbf_4_0nov5c04_1_1.rman' to server dbvlin102:7890
Progress: 0%...20%...40%...60%...80%...100% [10379 KB/s] - done.
>>> Restoring standby control files... - done.
>>> Starting standby database proddb on dbvlin102 mount... - done.
>>> Restoring datafiles on dbvlin102...
Restoring datafile 1 - done.
Restoring datafile 2 - done.
Restoring datafile 3 - done.
Restoring datafile 4 - done.
>>> Renaming standby redo logs and tempfiles on dbvlin102... - done.
>>> Performing checkpoint and archiving logs... - done.
>>> Finishing standby database creation... - done.
Standby database created.
To complete creating standby database please run Dbvisit on the primary server first,
then on the standby server, to ensure the standby database is in sync with the primary
database.
Please press <Enter> to continue...
|
Step 15:
The standby database has been created, the next steps are highlighted, which is to run dbvisit standby on the primary server, followed by running it on the standby server. This is done by running the "dbvisit <DDC>" command first on primary then the standby.
No Format |
---|
=========================================================
Standby Database creation on dbvlin102 completed.
Next steps:
1) Exit out of dbvisit_setup.
2) Run Dbvisit on this server with command:
dbvisit database_name
3) Run Dbvisit on standby server with command:
dbvisit database_name
Once Dbvisit has been tested, schedule Dbvisit on primary and standby servers
using cron or other scheduling tool.
=========================================================
Please press <Enter> to continue... |
Step 16:
The Dbvisit Standby Setup menu is displayed. Press "E" to exit the menu.
No Format |
---|
=========================================================
Dbvisit Standby Database Technology (7.0.04.11726)
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 : |
Step 17:
Run Dbvisit first on the primary server as normal. On first run you will get an error message "No License Key Found", similar as to the one below indicating that you need to apply your license key:
No Format |
---|
=============================================================
Dbvisit Standby Database Technology (7.0.04.11735) (pid 11239)
dbvisit started on dbvlin101: Mon Jan 27 22:44:06 2014 ()
=============================================================
201401272244 - No license key found for Dbvisit Standby version: . Please contact Dbvisit Standby (www.dbvisit.com) to obtain a current license. Run the Dbvisit Standby license command (dbvisit -lic) to update the license.
Dbvisit Standby terminated.
Return code = 2006
(Tracefile required if contacting Dbvisit Standby support: /usr/dbvisit/standby/trace/11239_dbvisit_proddb_201401272244.trc (server:dbvlin101))
No Mail sent as SEND_MAIL_FLAG = N |
Apply your license key (or the demo licence key provided on software download):
No Format |
---|
oracle@dbvlin101[/usr/dbvisit/standby]: ./dbvisit -lic proddb EB57I-DYK7K-9PI2V-1SH0D-AAWGR-2WEDY-ZJJ0F
=============================================================
Dbvisit Standby Database Technology (7.0.04.11735) (pid 11331)
dbvisit started on dbvlin101: Mon Jan 27 22:46:59 2014 ()
=============================================================
Dbvisit Standby license information for: proddb
customer_seq=1
customer_key_seq=0
license_type=DEMO (0)
expiry_date=2014-02-10
=>Update with license key: EB57I-DYK7K-9PI2V-1SH0D-AAWGR-2WEDY-ZJJ0F? <Yes/No> [Yes]: Yes
License updated.
Status: Valid
=============================================================
dbvisit ended on dbvlin101: Mon Jan 27 22:47:03 2014
============================================================= |
Note |
---|
The key needs to be applied only on Primary and above is just an example/demo key. |
Once the license key is applied, run Dbvisit Standby as normal on Primary:
No Format |
---|
oracle@dbvlin101[/usr/dbvisit/standby]: ./dbvisit proddb ============================================================= Dbvisit Standby Database Technology (7.0.04.11735) (pid 11392) dbvisit started on dbvlin101: Mon Jan 27 22:47:56 2014 () ============================================================= Standby Database creation on dbvlin102 completed. Next>>> steps:Obtaining 1)information Exitfrom outstandby ofdatabase dbvisit_setup(RUN_INSPECT=Y)... 2) Run Dbvisit>>> onSending this server with command:heartbeat message... - done. >>> dbvisit database_name 3) Run Checking Dbvisit onStandby standbyfor serverconfigurational withdifferences command:between dbvlin101 and dbvlin102... dbvisit database_name Once Dbvisit has beenNo tested,configurational schedule Dbvisit on primary and standby servers using cron or other scheduling tool. ========================================================= Please press <Enter> to continue... |
Step 16:
The Dbvisit Standby Setup menu is displayed. Press "E" to exit the menu.
No Format |
---|
========================================================= Dbvisit Standby Database Technology (7.0.04.11726) 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 differences found between dbvlin101 and dbvlin102. >>> Log file(s) for proddb will be transferred from dbvlin101 to dbvlin102... > Transferring 'o1_mf_1_35_9gdb7647_.arc.gz' to server dbvlin102:7890 Progress: 0%...20%...40%...60%...80%...100% [7551 KB/s] - done. 1 archive log transfer to dbvlin102 for proddb completed. Last sequence was 35. No Mail sent as SEND_MAIL_FLAG = N >>> Dbvisit Archive Management Module (AMM) Config: number of archives to keep = 0 Config: number of days to keep archives = 7 Config: archive backup count = 0 Config: diskspace full threshold = 80% Current disk percent full (/u01/app/oracle/fast_recovery_area) = 67% Number of archive logs deleted = 0 ============================================================= dbvisit ended on dbvlin101: Mon Jan 27 22:48:32 2014 ============================================================= |
Step 18:
The second last step is to run Dbvisit Standby on the Standby server :
No Format |
---|
oracle@dbvlin102[/usr/dbvisit/standby]: ./dbvisit proddb =========================================================== Please enter choice : |
Step 17:
Run Dbvisit first on the primary server as normal. On first run you will get an error message "No License Key Found", similar as to the one below indicating that you need to apply your license key:
No Format |
---|
== Dbvisit Standby Database Technology (7.0.04.11735) (pid 31798) dbvisit started on dbvlin102: Mon Jan 27 22:50:11 2014 () ============================================================= >>> Sending heartbeat message... - done. >>> Log file(s) for proddb from dbvlin101 will be applied to dbvlin102 201401272250 - Log seq 35 thread 1 applied to standby database proddb. No Mail sent as SEND_MAIL_FLAG_DR = N >>> Dbvisit Archive Management Module (AMM) Config: number of archives to keep =========== Dbvisit Standby Database Technology (7.0.04.11735) (pid 11239) dbvisit started on dbvlin101: Mon Jan 27 22:44:06 2014 () ======= 0 Config: number of days to keep archives = 7 Config: diskspace full threshold = 80% Processing /u01/app/oracle/archive/proddb... Archive log dir: /u01/app/oracle/archive/proddb Total number of archive files : 7 Number of archive logs deleted = 1 Current Disk percent full : 63% ====================================================== 201401272244 - No license key found for Dbvisit Standby version: . Please contact Dbvisit Standby (www.dbvisit.com) to obtain a current license. Run the Dbvisit Standby license command (dbvisit -lic) to update the license. Dbvisit Standby terminated. Return code = 2006 (Tracefile required if contacting Dbvisit Standby support: /usr/dbvisit/standby/trace/11239_dbvisit_proddb_201401272244.trc (server:dbvlin101)) No Mail sent as SEND_MAIL_FLAG = N |
Apply your license key (or the demo licence key provided on software download), example:
...
=======
dbvisit ended on dbvlin102: Mon Jan 27 22:50:18 2014
=============================================================
|
Step 19:
Schedule Dbvisit Standby to run on a regular basis on the primary and standby server.
The options available for scheduling are:
- Using Unix CRON schedule
- Using Windows Schedular
- Using Dbvserver (Web Based Interface) Built in Schedular