1. Introduction
From Dbvisit standby MultiPlatform version 11.3, all the command line operations for Oracle can be performed like the previous version (Standby 10.2,9.0.20) with the exception of Automated standby update. This is to provide customers using only CLI to be the ability to upgrade to the latest version without needing to use GUI.
Even though all operations can be performed using CLI, it is mandatory to install both agentmanager and control center (The control center needs to be installed only once).
The automatic send and apply archivelogs are enabled by default when DDC is created. Below code snippet shows the listener process running.
[oracle@dbvel81 oracle]$ ps -ef | grep dbv oracle 14173 1 0 19:40 ? 00:00:03 /opt/dbvisit/standbymp/bin/dbvagentmanager service run oracle 14295 14173 0 19:40 ? 00:00:02 /opt/dbvisit/standbymp/bin/dbvhelper -agentManagerId 3p2hxo81yz3le -directorId 2ysxxuki73qm3 -hostAddress dbvel81.qadev.cz -natsAddress dbvel82 -natsPort 5533 -configurationType Oracle -helperProcessKey oracle:3p2hxo81yz3le oracle 39705 14295 0 20:44 ? 00:00:01 /opt/dbvisit/standbymp/oracle/dbvctl -d TEST01 --listener start --mode GUI oracle 40306 14295 0 20:55 ? 00:00:02 /opt/dbvisit/standbymp/oracle/dbvctl -d TEST01 -D run --mode GUI oracle 40444 15071 0 21:03 pts/0 00:00:00 grep --color=auto dbv
As soon as the standby database is created, the listener process would start sending archivelogs from primary to standby, and the listener process on the standby would apply the archivelogs using the default time gap of 600sec. This can be changed by editing the dbv_<DDC>.env file with the parameter DMN_DBVISIT_INTERVAL on the primary from 600 to desired value. The parameter must be modified only from the file on the primary server. The default location of the file is under /usr/dbvisit/standbymp/oracle/conf directory on Linux and c:\Program Files\dbvisit\standbymp\oracle\conf directory on the Windows.
This method is a stop gap measure for version 11.3. From the next release the automatic standby update can be directly controlled from dbvagentmanager command line.
2. Creating a Dbvisit Standby Configuration (DDC) File - Command Line
2.1. Creating a DDC - Using Filesystem-Based Storage
Below is a summary of the environment that will be used in this example:
This environment will not be using ASM for database storage
Primary Server: dbvel81
Standby Server: dbvel82
Primary Database Name: TEST01
Primary Database Unique Name: TEST01
Standby Database Unique Name and SID will be the same: TEST01
Dbvisit Standby ARCHSOURCE location on the primary server: /u01/app/oracle/dbvisit_arch/TEST01
Dbvisit Standby ARCHDEST location on standby server: /u01/app/oracle/dbvisit_arch/TEST01
The Dbvisit Base directory is /opt/dbvisit
Dbvisit Standby Multiplatform is already installed on both the primary and standby servers
[oracle@dbvel81 oracle]$ ./dbvctl -o setup ========================================================= Dbvisit Standby Database Technology (11.3.0) http://www.dbvisit.com ========================================================= =>dbvctl only needs to be run on the primary server. Is this the primary server? <Yes/No> [Yes]: The following Dbvisit Database configuration (DDC) file(s) found on this server: DDC === 1) Create New DDC 2) Cancel Please enter choice [] : 1 Is this correct? <Yes/No> [Yes]: ========================================================= Dbvisit Standby setup begins. ========================================================= The following Oracle instance(s) have been found on this server: SID ORACLE_HOME === =========== 1) TEST01 /u01/app/oracle/product/21c/dbhome_1 2) Enter own ORACLE_SID and ORACLE_HOME Please enter choice [] : 1 Is this correct? <Yes/No> [Yes]: =>ORACLE_SID will be: TEST01 =>ORACLE_HOME will be: /u01/app/oracle/product/21c/dbhome_1 ------------------------------------------------------------------------------ Enter the primary server name. Note: The hostname is case sensitive on UNIX based systems. =>SOURCE is [dbvel81]: Your input: dbvel81 Is this correct? <Yes/No> [Yes]: Choice is dbvel81 ------------------------------------------------------------------------------ Please enter a filesystem directory that Dbvisit Standby use to store (archive) log files. This directory is not the same as the database recovery area or archive destinations and should not be located in these areas. The ARCHSOURCE directory is located on the primary server and will become the ARCHDEST location when the primary database is converted to a standby database during a Graceful Switchover operation. This directory will ONLY contain (archive) log files related to this database. It should not contain any other (non archive log) files. Please ensure that this directory exists on =>ARCHSOURCE is [/u01/app/oracle/dbvisit_arch/TEST01]: Your input: /u01/app/oracle/dbvisit_arch/TEST01 Is this correct? <Yes/No> [Yes]: Choice is /u01/app/oracle/dbvisit_arch/TEST01 ------------------------------------------------------------------------------ Specify the DBVNET port number on the primary server. If unsure leave at default =>NETPORT is [7890]: Your input: 7890 Is this correct? <Yes/No> [Yes]: Choice is 7890 ------------------------------------------------------------------------------ Enter the standby database hostname. If the standby database will be Oracle RAC enabled: Enter the the Virtual Hostname (linked to a Virtual IP) for standby database. This virtual hostname is attached to a VIP that will be able to move between the RAC nodes. Dbvisit Standby will only run on the server where this virtual hostname (VIP) resource is running. The Virtual Hostname (and VIP) should be configured as a resouce in clusterware and must be enabled and started on one of the nodes before yo continue with the setup. If you are not using a Virtual Hostname (Highly Recommended), Dbvisit Standby can only be configured to run on one dedicated node in the RAC configuration - specify the hosts name here if you do not have a Virtual Hostname (attached to VIP) for the cluster configured. For non-RAC configurations specify the standby database server name here. =>DESTINATION is []: dbvel82 Your input: dbvel82 Is this correct? <Yes/No> [Yes]: Choice is dbvel82 ------------------------------------------------------------------------------ Specify the DBVNET port number on the standby server. If unsure leave at default =>NETPORT_DR is [7890]: Your input: 7890 Is this correct? <Yes/No> [Yes]: Choice is 7890 ------------------------------------------------------------------------------ Enter Dbvisit Standby installation directory on the standby server =>DBVISIT_BASE_DR is [/opt/dbvisit/standbymp]: Your input: /opt/dbvisit/standbymp Is this correct? <Yes/No> [Yes]: Choice is /opt/dbvisit/standbymp ------------------------------------------------------------------------------ Enter ORACLE_HOME directory on the standby server =>ORACLE_HOME_DR is [/u01/app/oracle/product/21c/dbhome_1]: Your input: /u01/app/oracle/product/21c/dbhome_1 Is this correct? <Yes/No> [Yes]: Choice is /u01/app/oracle/product/21c/dbhome_1 ------------------------------------------------------------------------------ Enter DB_UNIQUE_NAME on the standby server =>DB_UNIQUE_NAME_DR is [TEST01]: Your input: TEST01 Is this correct? <Yes/No> [Yes]: Choice is TEST01 ------------------------------------------------------------------------------ Please enter the directory where Dbvisit Standby will transfer the (archive) log files to on standby server. This directory is not the same as the database recovery area or archive destinations and should not be located in these areas. This directory should ONLY contain (archive) log files related to this database. It should not contain any other (non archive log) files. Please ensure that this directory exists on the standby server =>ARCHDEST is [/u01/app/oracle/dbvisit_arch/TEST01]: Your input: /u01/app/oracle/dbvisit_arch/TEST01 Is this correct? <Yes/No> [Yes]: Choice is /u01/app/oracle/dbvisit_arch/TEST01 ------------------------------------------------------------------------------ Enter ORACLE_SID on the standby server =>ORACLE_SID_DR is [TEST01]: Your input: TEST01 Is this correct? <Yes/No> [Yes]: Choice is TEST01 ------------------------------------------------------------------------------ Enter ASM instance name on the standby server, if your standby is using ASM. If you are not using ASM on the standby or standby is ACFS leave the value null. =>ORACLE_SID_ASM_DR is []: Is this correct? <Yes/No> [Yes]: Choice is null ------------------------------------------------------------------------------ Please specify the name of the Dbvisit Database configuration (DDC) file. The DDC file is a plain text file that contains all the Dbvisit Standby settings. =>ENV_FILE is [TEST01]: Your input: TEST01 Is this correct? <Yes/No> [Yes]: Choice is TEST01 ------------------------------------------------------------------------------ Provide license key. =>LICENSE_KEY is []: 4jo70-qwp4l-7gplh-g1eif-xfj3t-09lb6-dlep0 Your input: 4jo70-qwp4l-7gplh-g1eif-xfj3t-09lb6-dlep0 Is this correct? <Yes/No> [Yes]: Choice is 4jo70-qwp4l-7gplh-g1eif-xfj3t-09lb6-dlep0 ------------------------------------------------------------------------------ Below are the list of configuration variables provided during the setup process: Configuration Variable Value Provided ====================== ============== ORACLE_SID TEST01 ORACLE_HOME /u01/app/oracle/product/21c/dbhome_1 SOURCE dbvel81 ARCHSOURCE /u01/app/oracle/dbvisit_arch/TEST01 NETPORT 7890 DESTINATION dbvel82 NETPORT_DR 7890 DBVISIT_BASE_DR /opt/dbvisit/standbymp ORACLE_HOME_DR /u01/app/oracle/product/21c/dbhome_1 DB_UNIQUE_NAME_DR TEST01 RAC_DR N ARCHDEST /u01/app/oracle/dbvisit_arch/TEST01 ORACLE_SID_DR TEST01 ENV_FILE TEST01 LICENSE_KEY 4jo70-qwp4l-7gplh-g1eif-xfj3t-09lb6-dlep0 Are these variables correct? <Yes/No> [Yes]: >>> Dbvisit Database configuration (DDC) file TEST01 created. >>> Dbvisit Database repository (DDR) TEST01 created. Repository Version 11.0 Software Version 11.0 Repository Status VALID >>> Created a matching configuration in the Control Center. PID:15111 TRACE:dbvisit_install.log [oracle@dbvel81 oracle]$
3. Setting up Disaster Recovery Database
3.1 Creating a Standby Database for filesystem-based Storage
[oracle@dbvel81 oracle]$ ./dbvctl -d TEST01 --csd *** Dbvisit Standby license will expire in 3 days. Please contact Dbvisit Standby (www.dbvisit.com) to obtain license. >>> Running pre-checks please wait... done What would you like to do: 1 - Create standby database (and optionally save settings in template) 2 - Help 3 - Terminate processing Please enter your choice [1]: 1 ------------------------------------------------------------------------------- =>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. [N]: Your input: N Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Do you want to use SHARED SPACE to backup the database? Shared space is a location accessible on both SOURCE and DESTINATION. Backup will not need to be transfered from SOURCE to DESTINATION. [N]: Your input: N Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Do you want to perform backup, transfer and restore operations in parallel when possible? [Y]: Your input: Y Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Do you want to ship archive logs from the primary database while creating the standby database? [Y]: Your input: Y Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvel81 where the database will be backed up to first. This location must be big enough to hold RMAN backup of the whole database (3.58GB). =>Specify the location on this server: [/usr/tmp]: Your input: /usr/tmp Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- A temporary location must be specified on dbvel82 where the database backup will be copied to before moving to specified locations. =>Specify location on remote server: [/usr/tmp]: Your input: /usr/tmp Is this correct? <Yes/No> [Yes]: The following oracle database parameters will be set in the standby database pfile or spfile: ------------------------------------------------------------------------------- SID NAME VALUE * audit_file_dest /u01/app/oracle/admin/TEST01/adump * compatible 21.0.0 * control_files /u02/app/oracle/oradata/TEST01/control01.ctl,/u02/app/oracle/fast_recovery_area/TEST01/control02.ctl * db_block_size 8192 * db_name TEST01 * db_recovery_file_dest /u02/app/oracle/fast_recovery_area * db_recovery_file_dest_size 5368709120 * db_unique_name TEST01 * diagnostic_dest /u01/app/oracle * dispatchers (PROTOCOL=TCP) (SERVICE=TEST01XDB) * enable_pluggable_database true * instance_mode READ-WRITE * nls_language AMERICAN * nls_territory AMERICA * open_cursors 300 * pga_aggregate_target 804257792 * processes 320 * remote_login_passwordfile EXCLUSIVE * sga_target 2412773376 * spfile OS default * undo_tablespace UNDOTBS1 ------------------------------------------------------------------------------- What would you like to do: 1 - Proceed with creating the standby database 2 - Edit oracle database parameters for the standby database pfile/spfile 3 - Terminate processing Please enter your choice [1]: 1 Validating oracle database parameters... please wait =>SUCCEEDED ------------------------------------------------------------------------------- =>Create standby database template for TEST01 using provided answers? [Y]: Your input: Y Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Continue with creating a standby database? (If No processing will terminate, the saved template will be available for future use) [Y]: Your input: 1 Is this correct? <Yes/No> [Yes]: >>> We will now run a pre-flight check before 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 dbvctl 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 >>> Creating standby control file... done ====================================================== WARNING: FORCE_LOGGING is disabled in the primary database! ====================================================== >>> Total database size for TEST01 is 3.58GB >>> Started logship process (pid 37810) >>> Backing up primary database... Backing up datafile 1... done Backing up datafile 3... done Backing up datafile 4... done Backing up datafile 5... done Backing up datafile 6... done Backing up datafile 7... done Backing up datafile 8... done Backing up datafile 9... done Backing up datafile 10... done Backing up datafile 11... done Backing up datafile 12... done >>> Transferring backup from dbvel81 to dbvel82... Transferring /usr/tmp/DBV_TEST01_CSD_DBF_1_051pbtoq_5_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_3_071pbtqb_7_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_4_091pbtqt_9_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_5_0b1pbtr2_11_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_6_0d1pbtrk_13_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_7_0f1pbtrv_15_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_8_0h1pbts4_17_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_9_0j1pbts8_19_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_10_0l1pbtsq_21_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_11_0n1pbtt5_23_1_1.RMAN... done Transferring /usr/tmp/DBV_TEST01_CSD_DBF_12_0p1pbtt9_25_1_1.RMAN... done >>> Starting standby database TEST01 on dbvel82 mount... done >>> Restoring datafiles on dbvel82... Restoring datafile 1... done Restoring datafile 3... done Restoring datafile 4... done Restoring datafile 5... done Restoring datafile 6... done Restoring datafile 7... done Restoring datafile 8... done Restoring datafile 9... done Restoring datafile 10... done Restoring datafile 11... done Restoring datafile 12... done >>> Renaming standby redo logs and tempfiles on dbvel82... done >>> Completing standby database creation... done >>> Standby database created. >>> Performing checkpoint and archiving logs... done >>> Synchronising standby... done PID:37335
Automatic standby update gets enabled automatically
[oracle@dbvel81 oracle]$ ps -ef | grep dbv oracle 14173 1 0 19:40 ? 00:00:03 /opt/dbvisit/standbymp/bin/dbvagentmanager service run oracle 14295 14173 0 19:40 ? 00:00:02 /opt/dbvisit/standbymp/bin/dbvhelper -agentManagerId 3p2hxo81yz3le -directorId 2ysxxuki73qm3 -hostAddress dbvel81.qadev.cz -natsAddress dbvel82 -natsPort 5533 -configurationType Oracle -helperProcessKey oracle:3p2hxo81yz3le oracle 39705 14295 0 20:44 ? 00:00:01 /opt/dbvisit/standbymp/oracle/dbvctl -d TEST01 --listener start --mode GUI oracle 40306 14295 0 20:55 ? 00:00:02 /opt/dbvisit/standbymp/oracle/dbvctl -d TEST01 -D run --mode GUI oracle 40444 15071 0 21:03 pts/0 00:00:00 grep --color=auto dbv
4. GracefulSwitchover
[oracle@dbvel81 oracle]$ ./dbvctl -d TEST01 -o switchover ============================================================= Dbvisit Standby Database Technology (11.3.0) (pid 50249) dbvctl started on dbvel81: Wed Apr 12 19:03:53 2023 ============================================================= >>> Starting Switchover between dbvel81 and dbvel82 Running pre-checks ... done =>Enter Custom User Script to run after Switchover is complete on dbvel81 (leave blank for no script): []: /home/oracle/scripts/switchover.sh =>Enter Custom User Script to run after Switchover is complete on dbvel82 (leave blank for no script): []: /home/oracle/scripts/switchover.sh =>Do you want to proceed with Graceful Switchover? [no]: yes Your input: 1 Is this correct? <Yes/No> [Yes]: Pre processing ... done Processing primary ... done Processing standby ... done Converting standby ... done Converting primary ... done Completing ... done Synchronizing ... done Post processing ... done >>> Graceful switchover completed. Primary Database Server: dbvel82 Standby Database Server: dbvel81 >>> Dbvisit Standby can be run as per normal: dbvctl -d TEST01 As part of the Switchover process, the primary and standby controlfiles have been exchanged.Unless you are using RMAN catalog database, you may need to cross-check all backups and review RMAN settings using the SHOW ALL command on the new Primary/Standby databases. Confirm the path set for the SNAPSHOT CONTROLFILE NAME TO setting is valid on both sides. PID:50249 TRACE:50249_dbvctl_switchover_TEST01_202304121903.trc ============================================================= dbvctl ended on dbvel81: Wed Apr 12 19:07:09 2023 =============================================================
5. DR Testing
[oracle@dbvel82 oracle]$ ./dbvctl -d TEST01 -o dr_test ============================================================= Dbvisit Standby Database Technology (11.3.0) (pid 41621) dbvctl started on dbvel82: Wed Apr 12 19:30:37 2023 ============================================================= >>> Running pre-checks please wait... done ------------------------------------------------------------------------------- =>Do you want to backup the standby database prior to activation? [yes]: Your input: 1 Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Specify backup type: 1 for image copy, 2 for backupset [1]: 2 Your input: 2 Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Specify backup location: []: /ust/tmp Your input: /ust/tmp Is this correct? <Yes/No> [Yes]: Directory /ust/tmp does not exist and cannot be created Enter valid location ------------------------------------------------------------------------------- =>Specify backup location: []: /usr/tmp Your input: /usr/tmp Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Specify backup format: [%U.bkp]: Your input: %U.bkp Is this correct? <Yes/No> [Yes]: ------------------------------------------------------------------------------- =>Do you want to be prompted to confirm activation on successful completion of the backup? [yes]: Your input: 1 Is this correct? <Yes/No> [Yes]: >>> Standby database size is 3.59GB. Backing up database might take some time. >>> Backing up standby database... done >>> Validating backup of the standby database... done ------------------------------------------------------------------------------- Standby Backup summary ------------------------------------------------------------------------------- tag DBV_TEST01_41621 location /usr/tmp type backupset db_unique_name TEST01 server dbvel82 resetlogs_id 1090236030 resetlogs_time 2021-12-02:11:20:30 created_on 2023-04-12 19:34:26 created_on_utc 2023-04-12 23:34:26 status VALID Files: DBV_TEST01_41621_0v1pee68_31_1_1.bkp DBV_TEST01_41621_101pee7v_32_1_1.bkp DBV_TEST01_41621_111pee8o_33_1_1.bkp DBV_TEST01_41621_CONTROL.CTL ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- =>Do you want to proceed with activating the standby database? [no]: yes Your input: 1 Is this correct? <Yes/No> [Yes]: >>> Activating now... >>> Activation complete. Please ensure a backup of this Database is made >>> Old archives from before the activation should be removed to avoid mix-up between new and old archive logs >>> Process complete ============================================================= dbvctl ended on dbvel82: Wed Apr 12 19:35:34 2023 =============================================================
Status of Standby Database
[oracle@dbvel82 oracle]$ ./dbvctl -d TEST01 -o status ============================================================= Dbvisit Standby Database Technology (11.3.0) (pid 42525) dbvctl started on dbvel82: Wed Apr 12 19:37:17 2023 ============================================================= Database Instance TEST01 on dbvel82 status: Regular database open in read write mode CON_ID NAME OPEN_MODE BYTES 2 PDB$SEED READ ONLY 765460480 3 PDB1 READ WRITE 916258816 ============================================================= dbvctl ended on dbvel82: Wed Apr 12 19:37:17 2023 =============================================================
Reinstate
[oracle@dbvel82 oracle]$ ./dbvctl -d TEST01 -o reinstate ============================================================= Dbvisit Standby Database Technology (11.3.0) (pid 42544) dbvctl started on dbvel82: Wed Apr 12 19:39:15 2023 ============================================================= >>> Running pre-checks please wait... >>> Validating backup of the standby database... done done ------------------------------------------------------------------------------- Standby Backup summary ------------------------------------------------------------------------------- tag DBV_TEST01_41621 location /usr/tmp type backupset db_unique_name TEST01 server dbvel82 resetlogs_id 1090236030 resetlogs_time 2021-12-02:11:20:30 created_on 2023-04-12 19:34:26 created_on_utc 2023-04-12 23:34:26 status VALID Files: DBV_TEST01_41621_0v1pee68_31_1_1.bkp DBV_TEST01_41621_101pee7v_32_1_1.bkp DBV_TEST01_41621_111pee8o_33_1_1.bkp DBV_TEST01_41621_CONTROL.CTL ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- >>> Reinstating standby will result in permanent removal of all current database files. =>Proceed with reinstating? [no]: yes Your input: 1 Is this correct? <Yes/No> [Yes]: >>> Shutting down the database... done >>> Removing database files... done >>> Restoring standby control file... done >>> Starting standby database... done >>> Restoring standby database... done Standby database reinstated. ============================================================= dbvctl ended on dbvel82: Wed Apr 12 19:42:01 2023 =============================================================