Dbvisit Standby Command Line Interface (CLI)
1. Introduction
This section will provide you with more information on using the Dbvisit Standby version 10 command line interface.
2. "dbvctl" Help
The first command you need to be familiar with is the "dbvctl -h" command which will display the syntax and usage options for the Dbvisit Standby command line interface.
You might find it strange that this is the first option to discuss, but it is actually one of the most important. It is a quick and easy way for you to find out the correct command syntax before executing it.
There are a number of help options available to you:
HELP
- dbvctl -f # display system info
- dbvctl -h # display full help
- dbvctl -h -f # display functions list
- dbvctl -h -f <function> # display help on <function>
- dbvctl -h --csd # display help on CSD
- dbvctl -h --sync # display help on SYNC
- dbvctl -h -o # display help on -o options
- dbvctl -h -L # display license agreement
- dbvctl -V # display Dbvisit version
On this page:
2.1. The Quick (short) help
The short or quick help option can be obtained by executing the "dbvctl" command without any arguments.
Example:
[oracle@dbv1 standby]$ ./dbvctl Dbvisit Standby Version 10.0.0RC_20_g5a288041 USAGE: dbvctl -d <ddc> [--suppress] [-v] dbvctl -d <ddc> -i [--silent] dbvctl -d <ddc> -l [<new_license_key>] [--force] dbvctl -d <ddc> -R dbvctl -d <ddc> -r sequence# -t thread# dbvctl -d <ddc> -c dbvctl -d <ddc> -C dbvctl -d <ddc> -o status dbvctl -d <ddc> -o start|stop|restart [--database] dbvctl -d <ddc> -o open|read [--database] dbvctl -d <ddc> -o ro_test dbvctl -d <ddc> -o activate [--mode CLI|BATCH|GUI] [--force] [--noprompt] dbvctl -d <ddc> -o dr_test [--mode CLI|BATCH|GUI] [--backup --backup_type image|backupset --backup_location bck_dir] [--noprompt] dbvctl -d <ddc> -o reinstate [--mode CLI|BATCH|GUI] [--switch] [--noprompt] dbvctl -d <ddc> -o switchover [--logswitch] dbvctl -d <ddc> -o update_ddc_file|update_dbenv_file dbvctl -d <ddc> -o upgrade [--noprompt] [--force] dbvctl [-d <ddc>] -o setup [--mode CLI|GUI] [--nolic] [--noprompt] [--action new|install|uninstall] [-j json_file] dbvctl -d <ddc> --csd [--mode CLI|BATCH|GUI] [--restart] [--noprompt] [-j json_file] [--dump_template] dbvctl -d <ddc> --sync [--mode CLI|BATCH|GUI] [--tmp_dir <tmp_dir>] [--tmp_dir_dest <tmp_dir_dest>] [--sync_lag] [--sync_nologging] [-j json_file] dbvctl -d <ddc> -D start|stop|status dbvctl [-d <ddc>] -f <function> [-a <key=value>]...[-a <key=value>] [-j <json_file_name>] dbvctl -d <ddc> -f support_package [-a pid=<pid>] HELP dbvctl -f # display system info dbvctl -h # display full help dbvctl -h -f # display functions list dbvctl -h -f <function> # display help on <function> dbvctl -h --csd # display help on CSD dbvctl -h --sync # display help on SYNC dbvctl -h -o # display help on -o options dbvctl -h -L # display license agreement dbvctl -V # display Dbvisit version
2.2. Listing the installed Dbvctl version
There are two ways to list the installed version of the Dbvisit Standby command line interface "dbvctl". The two options are:
- dbvctl -V (short version)
- dbvctl -f (detailed version)
Example:
[oracle@dbv1 standby]$ ./dbvctl -V 10.0.0RC_20_g5a288041 [oracle@dbv1 standby]$ ./dbvctl -f ============================================================= Dbvisit Standby Database Technology (www.dbvisit.com) dbvctl: 10.0.0RC_20_g5a288041 Dbvisit Standby time is: 202011281401 (YYYYMMDDHH24MI) Current user is: oracle Server name is: dbv1 Linux 4.19.76-linuxkit CPU count: 6 2600 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:01:09 2020 ============================================================= [oracle@dbv1 standby]$
2.3. Creating a Support Package
There are multiple options to create a support package:
- Creating a general support package
- Creating a support package for a specific process (PID) - which is for a task that was already executed.
The command to execute the support package is:
dbvctl -d <ddc> -f support_package [-a pid=<pid>]
Once the support package is created, it will be located in the DBVISIT_BASE/standby/support directory.
Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -f support_package -a pid=485 Support package /usr/dbvisit/standby/support/485_DEV_202011281401.tar.gz created. [oracle@dbv1 standby]$ ls -lrt /usr/dbvisit/standby/support/485_DEV_202011281401.tar.gz -rw-r--r-- 1 oracle oinstall 527260 Nov 28 14:01 /usr/dbvisit/standby/support/485_DEV_202011281401.tar.gz [oracle@dbv1 standby]$
3. Sending and Applying Logs
3.1. Sending Logs
Sending archive logs to the standby database can be done by running the following command: ./dbvctl -d <DDC>
3.1.1. Example 1: Single Instance Environment
[oracle@dbv1 standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1764) dbvctl started on dbv1: Sat Nov 28 14:02:25 2020 ============================================================= >>> Obtaining information from standby database (RUN_INSPECT=Y)... done Thread: 1 Archive log gap: 0. Transfer log gap: 0 Note FORCE_LOGGING is disabled in the primary database. >>> Sending heartbeat message... skipped >>> Performing a log switch... done >>> Transferring Log file(s) from DEV on dbv1 to dbv2: thread 1 sequence 11 (o1_mf_1_11_hw38f4yn_.arc)... done ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:02:32 2020 =============================================================
3.1.1. Example 2: Oracle RAC Primary Environment
When running Dbvisit Standby on an Oracle RAC primary Dbvisit Standby will send logs for all Oracle RAC threads to the standby site. From Dbvisit Standby version 8, it is recommended to make use of shared storage and run Dbvisit Standby off only one of the Oracle RAC nodes.
In the example below, all Dbvisit Standby processes are running on node 1 in the cluster:
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 15564) dbvctl started on kiwi812-vip: Wed Dec 16 19:16:33 2020 ============================================================= >>> Obtaining information from standby database (RUN_INSPECT=Y)... done Thread: 1 Archive log gap: 1. Transfer log gap: 0 Thread: 2 Archive log gap: 2. Transfer log gap: 0 Note FORCE_LOGGING is disabled in the primary database. >>> Performing a log switch... done >>> Transferring Log file(s) from MYDEV1 on kiwi812-vip to kiwi912-vip: thread 2 sequence 90 (thread_2_seq_90.518.1059333407)... done thread 1 sequence 141 (thread_1_seq_141.521.1059333403)... done ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:16:55 2020 =============================================================
3.2. Applying Logs
Applying archive logs on the standby database run the following command: ./dbvctl -d <DDC>
Example:
[oracle@dbv2 standby]$ ./dbvctl -d DEV ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1602) dbvctl started on dbv2: Sat Nov 28 14:02:57 2020 ============================================================= >>> Applying Log file(s) from dbv1 to DEV on dbv2: thread 1 sequence 11 (1_11_1004372670.arc)... done Last applied log(s): thread 1 sequence 11 Next SCN required for recovery 1128071 generated at 2020-11-28:14:02:28 +13:00. Next required log thread 1 sequence 12 ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:02:59 2020 =============================================================
RAC Environment
oracle@kiwi91[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 6838) dbvctl started on kiwi912-vip: Wed Dec 16 19:17:42 2020 ============================================================= >>> Applying Log file(s) from kiwi812-vip to MYDEV1 on kiwi912-vip: thread 1 sequence 140 (1_140_1009025610.arc)... done thread 2 sequence 88 (2_88_1009025610.arc)... done thread 2 sequence 89 (2_89_1009025610.arc)... done thread 1 sequence 140 (1_140_1009025610.arc)... done thread 2 sequence 90 (2_90_1009025610.arc)... done thread 1 sequence 140 (1_140_1009025610.arc)... done thread 1 sequence 141 (1_141_1009025610.arc)... done thread 2 sequence 90 (2_90_1009025610.arc)... done Last applied log(s): thread 1 sequence 141 thread 2 sequence 90 Next SCN required for recovery 1919315 generated at 2020-12-16:19:16:43 +13:00. Next required log thread 1 sequence 142 ============================================================= dbvctl ended on kiwi912-vip: Wed Dec 16 19:17:49 2020 =============================================================
IMPORTANT: Regarding Scheduling or running the Dbvisit Standby version 9 Daemon (Background process) please see Dbvisit Standby Scheduling#4.RunningDbvisitStandbyintheBackground
4. The log gap report
To ensure the primary and standby databases are up to date, you can run the Log Gap Report using the following command from the primary database server:./dbvctl -d <DDC> -i
4.1. Single Instance Environment
Below is an example of running a Log Gap report in a Single Instance Primary environment. In Dbvisit Standby Version 10 the log gap report has details like source/target SCN and timestamp specified in tabular format.
Information for only one thread will be shown.
[oracle@dbv1 standby]$ ./dbvctl -d DEV -i ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1858) dbvctl started on dbv1: Sat Nov 28 14:03:30 2020 ============================================================= Dbvisit Standby log gap report for DEV at 202011281403: ------------------------------------------------------------- Description | SCN | Timestamp ------------------------------------------------------------- Source 1128118 2020-11-28:14:03:29 +13:00 Destination 1128071 2020-11-28:14:02:28 +13:00 Standby database time lag (DAYS-HH:MI:SS): +00:01:01 Report for Thread 1 ------------------- SOURCE Current Sequence 12 Last Archived Sequence 11 Last Transferred Sequence 11 Last Transferred Timestamp 2020-11-28 14:02:32 DESTINATION Next Required Recovery Sequence 12 Transfer Log Gap 0 Apply Log Gap 0 ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:03:33 2020 =============================================================
4.2. Oracle RAC Primary Environment
Running the log gap report in an Oracle RAC environment will list information about all the threads in the Oracle RAC cluster.
The command to be executed is the same, but the result as you can see below will include information for all threads.
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -i ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 16743) dbvctl started on kiwi812-vip: Wed Dec 16 19:19:09 2020 ============================================================= Dbvisit Standby log gap report for MYDEV at 202012161919: ------------------------------------------------------------- Description | SCN | Timestamp ------------------------------------------------------------- Source 1919426 2020-12-16:19:19:12 +13:00 Destination 1919315 2020-12-16:19:16:43 +13:00 Standby database time lag (DAYS-HH:MI:SS): +00:02:29 Report for Thread 1 ------------------- SOURCE Current Sequence 142 Last Archived Sequence 141 Last Transferred Sequence 141 Last Transferred Timestamp 2020-12-16 19:16:55 DESTINATION Next Required Recovery Sequence 142 Transfer Log Gap 0 Apply Log Gap 0 Report for Thread 2 ------------------- SOURCE Current Sequence 91 Last Archived Sequence 90 Last Transferred Sequence 90 Last Transferred Timestamp 2020-12-16 19:16:54 DESTINATION Next Required Recovery Sequence 90 Transfer Log Gap 0 Apply Log Gap 1 ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:19:16 2020 =============================================================
5. Start a Database
5.1. Start a Primary Database
To start the Primary Database in read-write mode run the command "dbvctl -d <DDC> -o start". Dbvisit uses RMAN to start a database. Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -o start ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1978) dbvctl started on dbv1: Sat Nov 28 14:05:44 2020 ============================================================= Starting instance DEV... Primary Database DEV started on dbv1. ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:05:52 2020 =============================================================
5.2. Start a Standby Database
To start a standby database, run the command "dbvctl -d <DDC> -o start". Dbvisit uses RMAN to start a database. The standby database will be started in a mounted state, ready for recovery, for example:
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o start ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1743) dbvctl started on dbv2: Sat Nov 28 14:06:12 2020 ============================================================= Starting instance DEV... Standby Database DEV started on dbv2. ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:06:19 2020 =============================================================
5.3. Start an Oracle RAC database
To start an Oracle RAC database run the command "dbvctl -d <DDC> -o start --database". Dbvisit uses SRVCTL utility to start an Oracle RAC database.
To start a local RAC database instance run the command "dbvctl -d <DDC> -o start".
You can also use the SRVCTL utility, for example: "srvctl start database -d DEV".
For more detail on the SRVCTL utility, please see the Oracle Documentation or the command line help of the utility by running: "srvctl start database -h"
When starting a standby Oracle RAC database using SRVCTL utility, you must specify the "-o mount" option to start the standby database in a mounted state, where it will be ready for recovery.
6. Restart a Database
6.1. Restart a Primary Database
The primary database can be restarted using the command "dbvctl -d <DDC> -o restart". Dbvisit Standby will detect based on the DDC file if the database is to be started as a primary or standby based on the SOURCE and DESTINATION values and taking into account on which system the command is being executed. This command will restart the primary database into a read/write open state.
Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -o restart ============================================================= Dbvisit Standby Database Technology (9.0.0_1271_g4b00fb49) (pid 3078) dbvctl started on dbv1: Mon Apr 29 11:38:54 2019 ============================================================= Stopping instance DEV... Primary Database DEV shutdown successfully on dbv1. Starting instance DEV... Primary Database DEV started on dbv1. ============================================================= dbvctl ended on dbv1: Mon Apr 29 11:39:12 2019 =============================================================
6.2. Restart a Standby Database
To restart the standby database, use the following command: "dbvctl -d <DDC> -o restart". Dbvisit Standby will detect based on the DDC file if the database is to be started as a primary or standby based on the SOURCE and DESTINATION values and taking into account on which system the command is being executed. The standby database will be restarted into a mounted state, ready for recovery. Example:
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o restart ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1833) dbvctl started on dbv2: Sat Nov 28 14:06:44 2020 ============================================================= Stopping instance DEV... Standby Database DEV shutdown successfully on dbv2. Starting instance DEV... Standby Database DEV started on dbv2. ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:06:53 2020 =============================================================
7. Stop a Database
7.1. Stop a Primary Database
To stop the primary database, execute the command: "dbvctl -d <DDC> -o stop". A shutdown immediate command will be used to stop the database. Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -o stop ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2098) dbvctl started on dbv1: Sat Nov 28 14:07:11 2020 ============================================================= Stopping instance DEV... Primary Database DEV shutdown successfully on dbv1. ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:07:20 2020 =============================================================
7.2. Stop a Standby Database
To stop the standby database, execute the command: "dbvctl -d <DDC> -o stop". A shutdown abort command will be used to stop the database. Example:
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o stop ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 1937) dbvctl started on dbv2: Sat Nov 28 14:07:35 2020 ============================================================= Stopping instance DEV... Standby Database DEV shutdown successfully on dbv2. ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:07:37 2020 =============================================================
7.3. Stop an Oracle RAC database
To stop an Oracle RAC database run the command "dbvctl -d <DDC> -o stop -database". Dbvisit uses SRVCTL utility to stop an Oracle RAC database.
To stop a local RAC database instance run the command "dbvctl -d <DDC> -o stop".
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -o stop --database ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 17201) dbvctl started on kiwi812-vip: Wed Dec 16 19:20:18 2020 ============================================================= Stopping database MYDEV... Primary Database MYDEV shutdown successfully on kiwi812-vip. ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:20:43 2020 ============================================================= oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -o start --database ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 17643) dbvctl started on kiwi812-vip: Wed Dec 16 19:21:13 2020 ============================================================= Starting database MYDEV... Primary Database MYDEV started on kiwi812-vip. ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:21:46 2020 ============================================================= oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -o status ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 18261) dbvctl started on kiwi812-vip: Wed Dec 16 19:21:55 2020 ============================================================= Instance MYDEV1 is running on node kiwi81. Instance status: Open. Instance MYDEV2 is running on node kiwi82. Instance status: Open. Database Instance MYDEV1 on kiwi812-vip status: Regular database open in read write mode ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:21:58 2020 ============================================================= oracle@kiwi81[/acfs/dbvisit/standby]: srvctl status database -d MYDEV -v Instance MYDEV1 is running on node kiwi81. Instance status: Open. Instance MYDEV2 is running on node kiwi82. Instance status: Open. oracle@kiwi81[/acfs/dbvisit/standby]:
You can also use the SRVCTL utility, for example: "srvctl stop database -d DEV".
For more detail on the SRVCTL utility, please see the Oracle Documentation or the command line help of the utility by running: "srvctl start database -h"
8. Open Standby Database Read-only
If a standby database is in a consistent state, you should be able to open the standby database into a read-only state.
The examples below show the attempt to enable read-only when the standby database is down. This checks the database is down and bring the database up in READ-ONLY mode.
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o stop ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2058) dbvctl started on dbv2: Sat Nov 28 14:08:23 2020 ============================================================= Stopping instance DEV... Standby Database DEV shutdown successfully on dbv2. ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:08:25 2020 ============================================================= [oracle@dbv2 standby]$ ./dbvctl -d DEV -o open ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2086) dbvctl started on dbv2: Sat Nov 28 14:08:29 2020 ============================================================= >>> Running pre-checks please wait... done Open Standby instance DEV in READ ONLY mode... Standby instance DEV on dbv2 opened in READ ONLY mode. Log files cannot be applied to Database while in READ ONLY mode. Database tempfile(s) may need to be added to this database. ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:08:36 2020 =============================================================
8.1. Open Read-only for Multitenant Database
The following only applies to Oracle 12.1.0.2 or newer.
When opening the multitenant standby database Dbvisit Standby doesn't interfere with PDBs, but respects the user's settings from the primary database.
Generally, when opening CDB, Oracle uses PDB's SAVE STATE option to determine the required open mode for each and every PDB. By default SAVE STATE option is not set for PDBs, hence PDBs are opened in MOUNT state. Run the following query to determine primary database settings:
SQL> select a.con_id,a.name,a.open_mode,a.restricted,b.state as saved_state from v$pdbs a, cdb_pdb_saved_states b where a.con_id=b.con_id(+); CON_ID NAME OPEN_MODE RES SAVED_STATE ---------- -------------------- ---------- --- -------------- 2 PDB$SEED READ ONLY NO 3 PDBX MOUNTED
If you require "dbvctl -d <DDC> -o open" to open certain PDB in READ ONLY you need to instruct the standby database to do so:
On primary open the PDB in READ ONLY and then run:
SQL> alter pluggable database <pdb_name> save state; SQL> select a.con_id,a.name,a.open_mode,a.restricted,b.state as saved_state from v$pdbs a, cdb_pdb_saved_states b where a.con_id=b.con_id(+); CON_ID NAME OPEN_MODE RES SAVED_STATE ---------- -------------------- ---------- --- -------------- 3 PDBX READ ONLY NO OPEN READ ONLY 2 PDB$SEED READ ONLY NO
Dbvisit Standby will apply these settings to the standby database. Next time you open the standby database using "dbvctl -d <DDC> -o open" the standby PDB will be opened in READ ONLY mode.
9. Database Status Check
The Dbvisit Standby CLI command to check the status of the databases is: "dbvctl -d <DDC> -o status"
9.1. Status Check Example - Primary
[oracle@dbv1 standby]$ ./dbvctl -d DEV -o status ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2249) dbvctl started on dbv1: Sat Nov 28 14:09:21 2020 ============================================================= Database Instance DEV on dbv1 status: Regular database open in read write mode ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:09:21 2020 =============================================================
9.2. Status Check Example - Standby
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o status ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2285) dbvctl started on dbv2: Sat Nov 28 14:10:01 2020 ============================================================= Database Instance DEV on dbv2 status: Standby Database in recovery mode ============================================================= dbvctl ended on dbv2: Sat Nov 28 14:10:01 2020 =============================================================
9.3. Status Checks in an Oracle RAC configuration
Check the status of the local database instance using dbvctl:
oracle@kiwi81[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -o status ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 18261) dbvctl started on kiwi812-vip: Wed Dec 16 19:21:55 2020 ============================================================= Instance MYDEV1 is running on node kiwi81. Instance status: Open. Instance MYDEV2 is running on node kiwi82. Instance status: Open. Database Instance MYDEV1 on kiwi812-vip status: Regular database open in read write mode ============================================================= dbvctl ended on kiwi812-vip: Wed Dec 16 19:21:58 2020 =============================================================
Check the status of all database instances using SRVCTL:
Example to check the status for a Primary Oracle RAC cluster database:
oracle@kiwi81[/acfs/dbvisit/standby]: srvctl status database -d MYDEV -v Instance MYDEV1 is running on node kiwi81. Instance status: Open. Instance MYDEV2 is running on node kiwi82. Instance status: Open.
Example to check the status for a Standby Oracle RAC cluster database:
oracle@kiwi91[/acfs/dbvisit/standby]: srvctl status database -d MYDEV -v Instance MYDEV1 is running on node kiwi91. Instance status: Mounted (Closed). Instance MYDEV2 is running on node kiwi92. Instance status: Mounted (Closed). oracle@kiwi91[/acfs/dbvisit/standby]: oracle@kiwi91[/acfs/dbvisit/standby]: ./dbvctl -d MYDEV -o status ============================================================= Dbvisit Standby Database Technology (10.0.0RC_23_gca959724) (pid 9756) dbvctl started on kiwi912-vip: Wed Dec 16 19:23:43 2020 ============================================================= Instance MYDEV1 is running on node kiwi91. Instance status: Mounted (Closed). Instance MYDEV2 is running on node kiwi92. Instance status: Mounted (Closed). Database Instance MYDEV1 on kiwi912-vip status: Standby Database in recovery mode ============================================================= dbvctl ended on kiwi912-vip: Wed Dec 16 19:23:46 2020 ============================================================= oracle@kiwi91[/acfs/dbvisit/standby]:
9.2.4. Status Check for Multitenant Database
When running a status check on a 12c Multitenant database you will see a status update for the pluggable databases listed as well.
The example below is from a 12c Database running on a Linux-based system.
[oracle@kiwi701 /usr/dbvisit/standby]$ ./dbvctl -d DEV1 -o status ============================================================= Dbvisit Standby Database Technology (9.0.0_1271_g4b00fb49) (pid 3040) dbvctl started on kiwi701: Mon Apr 29 12:07:16 2019 ============================================================= Database DEV is running. Instance status: Open. Database Instance DEV on kiwi701 status: Regular database open in read write mode CON_ID NAME OPEN_MODE 1 CDB$ROOT READ WRITE 2 PDB$SEED READ ONLY 3 DEVPDB1 READ WRITE ============================================================= dbvctl ended on kiwi701: Mon Apr 29 12:07:19 2019 =============================================================
10. Activate a Standby Database (Failover)
Activating a standby database is also known as performing a failover. This is totally different than performing a Graceful Switchover.
During Activation an "open resetlogs" is performed on the standby database while an attempt is made to open the standby database read-write.
If the database is in a consistent state, activation should be possible. A quick way to test the state is by opening the standby database read-only. If that is possible, you will be able to activate the standby database.
The command to activate the standby database is: "dbvctl -d <DDC> -o activate"
Check the Activate (Failover) as Standby Database page for the latest options for performing DR Test and also Read-Only Test
Activating a standby database will result in it becoming a primary database. If the original primary database is still fully functional and you are only performing a DR test, it is recommended to back up the standby database prior to the activation. Once the standby database is activated, you must either restore from a backup on the standby database, or you have to recreate the standby database.
Data loss is possible when performing an activation if you have not been able to apply all redo from the primary to the standby database.
Dbvisit Standby cannot operate in the Zero Data loss mode.
The command to Activate a Standby database is:
[oracle@dbv2 standby]$ ./dbvctl -d DEV -o activate ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2606) dbvctl started on dbv2: Sat Nov 28 14:17:24 2020 ============================================================= >>> Running pre-checks please wait... done ------------------------------------------------------------------------------- Next required SCN 1129362 generated at 2020-11-28:14:17:08 +13:00 ------------------------------------------------------------------------------- =>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 dbv2: Sat Nov 28 14:17:42 2020 =============================================================
11. Copy DDC file to the standby
If changes were made to the DDC file, you can run the following command on the primary system to copy the DDC file to the standby server. Remember the DDC file on the primary server is considered the "master copy" : "dbvctl -d <DDC> -c". If you use -C instead of -c then the DDC copy will happen only if there is any difference between primary and standby DDC
Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -c ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2286) dbvctl started on dbv1: Sat Nov 28 14:10:41 2020 ============================================================= >>> Dbvisit Standby configuration copied to dbv2... ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:10:42 2020 ============================================================= [oracle@dbv1 standby]$ ./dbvctl -d DEV -C ============================================================= Dbvisit Standby Database Technology (10.0.0RC_20_g5a288041) (pid 2341) dbvctl started on dbv1: Sat Nov 28 14:10:55 2020 ============================================================= >>> No configurational differences found between dbv1 and dbv2 ============================================================= dbvctl ended on dbv1: Sat Nov 28 14:10:57 2020 =============================================================
12. Refresh a Standby datafile from the Primary
It is possible to refresh one specific datafile on the standby database server from the primary. The command to do this is: "dbvctl -f refresh_datafile -d DEV -a file_id=<file_id>"
[oracle@dbv1 standby]$ ./dbvctl -d DEV -f refresh_datafile -h FUNCTION refresh_datafile Refresh a standby datafile from primary dbvctl -f refresh_datafile -d <ddc> -a file_id=<file_id> [-a tmp_dir=<tmp_dir> -a tmp_dir_dr=<tmp_dir_dr>]
Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -f refresh_datafile -a file_id=3 >>> Back up datafile 3... done >>> Transfer backup of datafile 3 to standby server... done >>> Catalog backup... done >>> Restore datafile 3... done >>> Datafile 3 refresh complete From: /u01/app/oracle/oradata/DEV/undotbs01.dbf on dbv1 To : /u01/app/oracle/oradata/DEV/undotbs01.dbf on dbv2
13. Cleanup repository
The Dbvisit Standby repository tables DBV_TRANSFER_LOG and DBV_SEQUENCE_LOG can be clean up if necessary. Below are the global variables and their default values.
REPO_MAINTAIN_DAYS = 1 (default value)
REPO_KEEP_DAYS = 30 (default value)
The cleanup function is called during the first run of the day on the primary server. If any records have been deleted, it will attempt to copy the repository to the standby server. If the copy fails, processing still continues.
A new repository table DBV_MAINTAIN_REPO is introduced as well which logs the information of the cleanup function.
To run the repo maintenance function manually, use below syntax:
dbvctl -d <DDC> -f repo_maintain [-a days2keep=N]
Example:
oracle@dbvlab01[/usr/dbvisit/standby]: ./dbvctl -d DEV -f repo_maintain -a days2keep=1
14. Export DBV_TRANSFER_LOG into JSON
In Dbvisit Standby version 8.0.14 a new function was introduced to export the DBV_TRANSFER_LOG table into JSON output.
The command is:
dbvctl -d <DDC> -f repo_export_table -a table=DBV_TRANSFER_LOG -a out=json
Example:
[oracle@dbv1 standby]$ ./dbvctl -d DEV -f repo_export_table -a table=DBV_TRANSFER_LOG -a out=json { "DBV_TRANSFER_LOG" : [ { "start_epoch" : 1606524964, "source_host" : "DBV1", "process_completed" : "Y", "thread_num" : 1, "sequence" : 10, "process" : "TRANSFER", "end_timestamp" : "2020-11-28 13:56:05", "size_in_bytes" : 34024960, "checksum" : "0", "destination_host" : "DBV2", "id" : 1, "start_timestamp" : "2020-11-28 13:56:04", "db_unique_name" : "DEV", "process_id" : 485, "archive_name" : "/u01/app/oracle/fast_recovery_area/DEV/archivelog/2020_11_28/o1_mf_1_10_hw380w57_.arc", "log_id" : 1004372670, "oracle_sid" : "DEV", "db_unique_name_dr" : "DEV" }, { "log_id" : 1004372670, "oracle_sid" : "DEV", "archive_name" : "/u01/app/oracle/fast_recovery_area/DEV/archivelog/2020_11_28/o1_mf_1_11_hw38f4yn_.arc", "db_unique_name_dr" : "DEV", "id" : 2, "start_timestamp" : "2020-11-28 14:02:32", "destination_host" : "DBV2", "process_id" : 1764, "db_unique_name" : "DEV", "end_timestamp" : "2020-11-28 14:02:32", "process" : "TRANSFER", "checksum" : "0", "size_in_bytes" : 622592, "start_epoch" : 1606525352, "process_completed" : "Y", "thread_num" : 1, "source_host" : "DBV1", "sequence" : 11 } ] } [oracle@dbv1 standby]$
15. Videos on how to use some of the Command Line Interface commands
Part 1
Part 2
Part 3