8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Dbvisit Standby Installation on Oracle Linux 5 and 6
Dbvisit Standby is an alternative to Oracle Data Guard for creating and managing standby databases. Although I normally stick to core Oracle technologies, I thought it was worth investigating because Dbvisit Standby works equally well on Standard Edition databases, unlike Data Guard, which is an Enterprise Edition option.
The Dbvisit Standby User Guide 6.0 provides detailed information for the installation of the product on Linux, Windows and various flavors of UNIX. In this article I will be focusing on the Linux installation only.
- Assumptions
- Common Setup
- Standby Creation
- Automating Service Startup
- Scheduling Dbvisit
- Startup/Shutdown of Databases
- Read-Only
- Switchover
- Failover
- Reporting
Assumptions
- You are using version 6.0.16 of the Dbvisit Standby product.
- You have two servers (physical or VMs) with an operating system and Oracle installed on them. In this case I've used Oracle Linux 5.7 and Oracle Database 11.2.0.3.
- The primary server has a database running in archivelog mode.
- The standby server has a software only installation.
The following information may help you to tailor the installation for your own installation.
ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ORACLE_SID=PROD Primary hostname: dbvisit1 Standby hostname: dbvisit2
For more complex installations, like those involving RAC, check out the Dbvisit Standby User Guide 6.0.
Common Setup
Unless otherwise stated, the following setup should be done on both the primary and standby server. I find it easier if I do them at the same time, step-for-step.
Create a location for the Dbvisit Standby software by running the following commands as the "root" user.
mkdir /usr/local/dbvisit chown oracle:dba /usr/local/dbvisit
From this point on, all operations will be performed as the "oracle" user.
Unzip and install the Dbvisit Standby software.
su - oracle cd /host/software/oracle/dbvisit unzip -d /usr/tmp dbvisit-standby6.0.16_linux.zip cd /usr/tmp tar -xvf dbvisit-standby6.0.16.tar cd dbvisit chmod 750 dbvisit_install # Accept all defaults for the following. ./dbvisit_install
Configure user equivalence by isuing the following sequence of commands. Generate keys on both servers.
# Accept all defaults for the following. ssh-keygen cd $HOME/.ssh
Copy the keys between servers.
# Run on Primary only. scp oracle@dbvisit2:/home/oracle/.ssh/id_rsa.pub /home/oracle/.ssh/authorized_keys # Run on Standby only. scp oracle@dbvisit1:/home/oracle/.ssh/id_rsa.pub /home/oracle/.ssh/authorized_keys
Create directories to hold logs and archive files on both servers.
mkdir -p /u01/app/oracle/admin/PROD/dbvisit mkdir -p /u01/app/oracle/oraarch/PROD
On the standby server, set up the directories necessary to run the standby database. This is essentially any paths reverenced in the spfile of the primary database.
mkdir -p /u01/app/oracle/admin/PROD/adump mkdir -p /u01/app/oracle/oradata/PROD mkdir -p /u01/app/oracle/fast_recovery_area/PROD mkdir -p /u01/app/oracle/diag/rdbms/prod/PROD/trace mkdir -p /u01/app/oracle/diag/rdbms/prod/PROD/cdump
The configuration of both servers is now complete.
Standby Creation
There are two ways to create and manage the standby database:
- Command Line Interface (CLI): Initiated using the "/usr/local/dbvisit/standby/dbvisit_setup" command on the primary server.
Web Interface: Initiated from a browser pointing to the relevant URL of the service on the primary server, in this case "http://dbvisit1:8081" URL on the primary server.
Both methods ask a number of questions regarding the setup of the primary and standby servers. For the most part they are pretty self explanatory. If you need more information, check out the PDF document that ships with the software, or read it online here.
Once complete, run the following command on each server to make sure they are in sync.
/usr/local/dbvisit/standby/dbvisit PROD
Alternatively, use the "Run Interactive" screen on the web interface to to this (Home > Run > Run Interactive).
Automating Service Startup
To configure the service to start automatically on server startup, simply copy the sample script provided in the software directory using the following commands, issued as the "root" user.
cp /usr/local/dbvisit/dbvserver/etc/init.d/redhat/dbvserverd /etc/init.d chkconfig --add dbvserverd
In addition to starting automatically on server startup, the service can be manually stopped and started with the following commands issued by the "root" user.
service dbvserverd stop service dbvserverd start
Scheduling Dbvisit
Archived redo logs are transported from the primary to the standby server when the dbvisit
command is called. So this must be scheduled on the both the primary and standby servers. The frequency you choose depends on a number of factors including server and network load etc. If you want to transfer the files every 10 minutes you might use the following schedule in the crontab for the "oracle" user on the primary server.
00,10,20,30,40,50 * * * * /usr/local/dbvisit/standby/dbvisit PROD >>/dev/null 2>&1
You need to configure the same call on the standby server, but it makes sense to run it a little later to allow for time it takes to ship the logs.
05,15,25,35,45,55 * * * * /usr/local/dbvisit/standby/dbvisit PROD >>/dev/null 2>&1
If you don't want to use the operating system scheduler, you can use the internal scheduler, configurable using the web interface (Home > Run > Schedule).
Startup/Shutdown of Databases
The dbv_oraStartStop
command is used to stop, start or restart the primary or standby database on the relevant server.
$ /usr/local/dbvisit/standby/dbv_oraStartStop stop PROD $ /usr/local/dbvisit/standby/dbv_oraStartStop start PROD $ /usr/local/dbvisit/standby/dbv_oraStartStop restart PROD
It is also used to check the status of the database.
$ /usr/local/dbvisit/standby/dbv_oraStartStop status PROD
Read-Only
To open the standby database in redo-only mode, simply issue the following command as the "oracle" user.
$ /usr/local/dbvisit/standby/dbv_oraStartStop open PROD
When you need to switch it back to regular standby mode, either stop and start the standby database, or do a restart.
$ /usr/local/dbvisit/standby/dbv_oraStartStop restart PROD
Switchover
To run a graceful (and reversible) Switchover, issue the following command on both the primary and standby servers.
$ /usr/local/dbvisit/standby/dbv_oraStartStop switchover PROD [key]
The "key" is a piece of text that must match on both servers. If it is omitted from the command line, you will be prompted to enter it before you can proceed.
Failover
Failover should only be used if you need to activate the standby database in the absence of the primary database. A failover is initiated using the following command on the standby server.
$ /usr/local/dbvisit/standby/dbv_oraStartStop activate PROD
Reporting
The web interface provides some graphical reports of the standby and transfer process (Home > Reporting).
For more information see:
- Dbvisit.com
- Dbvisit Standby 6.0 User Guide
- Dbvisit Replicate Installation on Oracle Linux 5 and 6
- Dbvisit Reporting Installation on Oracle Linux 5 and 6
Hope this helps. Regards Tim...