Using Command Line Interface with dbvctl

 

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]$

 

2.2.  Creating a DDC - Using ASM Based Storage

To create a DDC file from the command line interface you will be using the “dbvctl -o setup” command. 

Below is a summary of the environment that will be used in this example:

  • This environment will be using ASM for database storage

  • Primary Server: kiwi701

  • Standby Server: kiwi702

  • Primary Database Name: TEST01

  • Primary Database Unique Name: TEST01

  • Standby Database Unique Name and SID will be the same: TEST01

  • Dbvnet will be used for network communication

  • Dbvnet default PORT of 7890 will be used

  • Dbvisit Standby ARCHSOURCE location on the primary server: /u01/app/oracle/dbvisit_archdest/TEST01

  • Dbvisit Standby ARCHDEST location on standby server: /u01/app/oracle/dbvisit_archdest/TEST01

  • The Dbvisit Base directory is /opt/dbvisit

  • Dbvisit Standby is already installed on both the primary and standby servers

  • Both Primary and Standby database servers are running Grid Infrastructure 18.3.0.0 and have an ASM instance named +ASM

[oracle@kiwi701 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/18.3.0.0/db1-base 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/18.3.0.0/db1-base ------------------------------------------------------------------------------ Enter the primary server name. Note: The hostname is case sensitive on UNIX based systems. =>SOURCE is [kiwi701]: Your input: kiwi701 Is this correct? <Yes/No> [Yes]: Choice is kiwi701 ------------------------------------------------------------------------------ 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 []: kiwi702 Your input: kiwi702 Is this correct? <Yes/No> [Yes]: Choice is kiwi702 ------------------------------------------------------------------------------ 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/18.3.0.0/db1-base]: Your input: /u01/app/oracle/18.3.0.0/db1-base Is this correct? <Yes/No> [Yes]: Choice is /u01/app/oracle/18.3.0.0/db1-base ------------------------------------------------------------------------------ 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 []: +ASM Your input: +ASM Is this correct? <Yes/No> [Yes]: Choice is +ASM ------------------------------------------------------------------------------ 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-g1ehy-icjxm-2199s-330al Your input: 4jo70-qwp4l-7gplh-g1ehy-icjxm-2199s-330al Is this correct? <Yes/No> [Yes]: Choice is 4jo70-qwp4l-7gplh-g1ehy-icjxm-2199s-330al ------------------------------------------------------------------------------ Below are the list of configuration variables provided during the setup process: Configuration Variable Value Provided ====================== ============== ORACLE_SID TEST01 ORACLE_HOME /u01/app/oracle/18.3.0.0/db1-base SOURCE kiwi701 ARCHSOURCE /u01/app/oracle/dbvisit_arch/TEST01 NETPORT 7890 DESTINATION kiwi702 NETPORT_DR 7890 DBVISIT_BASE_DR /opt/dbvisit/standbymp ORACLE_HOME_DR /u01/app/oracle/18.3.0.0/db1-base DB_UNIQUE_NAME_DR TEST01 RAC_DR N ARCHDEST /u01/app/oracle/dbvisit_arch/TEST01 ORACLE_SID_DR TEST01 ORACLE_SID_ASM_DR +ASM ENV_FILE TEST01 LICENSE_KEY 4jo70-qwp4l-7gplh-g1ehy-icjxm-2199s-330al 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:67284 TRACE:dbvisit_install.log

3. Setting up Disaster Recovery Database

 

3.1 Creating a Standby Database for filesystem-based Storage

 

 

Automatic standby update gets enabled automatically

 

3.2 Creating a Standby Database for ASM-based Storage

 

4. GracefulSwitchover

 

ASM → ASM

 

5. DR Testing

 

 

Status of Standby Database

 

 

Reinstate