CONTEXTE
La solution dbvisit standby permet principalement aux bases oracle en Standard Edition de disposer d’une base standby gérée automatiquement par l’outil.
Nous avons ici une base Primaire en 12.1.0.2 en RAC avec une base vierge également en 12.1.0.2 en RAC de l’autre côté.
Le composant dbvserver (outil graphique) ne sera pas installé car tout se fera en ligne de commande.
PRIMAIRE
- HOST : HOST_P_1, HOST_P_2
- INSTANCE : INSTANCE_P_1, INSTANCE_P_2
- ORACLE_SID : EASYDB
- VIP : dbv-prod-vip (10.0.0.100)
STANDBY
- HOST : HOST_S_1, HOST_S_2
- INSTANCE : INSTANCE_S_1, INSTANCE_S_2
- ORACLE_SID : EASYDB
- VIP : dbv-stby-vip (10.0.0.200)
CREATION D'UN REPERTOIRE ACFS
En mode RAC il est indispensable que les binaires dbvisit soient partagés entre chaque nœud du cluster. Nous utiliserons ici la méthode ACFS pour partager les données.
[root]# mkdir /usr/dbvisit
[root]# mkdir /usr/dbvisit/archivelog/EasyDB
[grid]# asmcmd
ASMCMD> volcreate -G DATA -s 25G DBVISITBASE
[root]# mkfs -t acfs /dev/asm/dbvisitbase-XXX
[root]# acfsutil registry -a /dev/asm/dbvisitbase-XXX /usr/dbvisit
[root]# mount -t acfs /dev/asm/dbvisitbase-XXX /usr/dbvisit
[root]# chown -R oracle:oinstall /usr/dbvisit
INSTALLATION DES BINAIRES
Création des VIP
Une VIP dédiée à Dbvisit est indispensable sur chaque cluster pour pointer vers les 2 instances de notre RAC.
[root@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/appvipcfg create -network=1 -ip=10.0.0.100 -vipname=dbv-prod-vip -user=root
[root@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/crsctl setperm resource dbv-prod-vip -u user:oracle:r-x
[root@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/crsctl setperm resource dbv-prod-vip -u user:grid:r-x
[root@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/crsctl start resource dbv-prod-vip -n HOST_P_1
CRS-2672: Attempting to start ‘dbv-prod-vip’ on ‘host_p_1’
CRS-2676 : Start of ‘dbv-prod-vip’ on ‘host_p_1’ succeeded
[root@STANDBY]# /u01/app/12.1.0.2/grid/bin/crsctl setperm resource dbv-stby-vip -u user:oracle:r-x
[root@STANDBY]# /u01/app/12.1.0.2/grid/bin/crsctl setperm resource dbv-stby-vip -u user:grid:r-x
[root@STANDBY]# /u01/app/12.1.0.2/grid/bin/crsctl start resource dbv-stby-vip -n HOST_S_1
CRS-2672: Attempting to start ‘dbv-stby-vip’ on ‘host_s_1’
CRS-2676 : Start of ‘dbv-stby-vip’ on ‘host_s_1’ succeeded
Puis ajouter dans le fichier host :
[root]# vi /etc/hosts
# VIP FOR DBVISIT
10.0.0.100 dbv-prod-vip
10.0.0.200 dbv-stby-vip
Mise à disposition des binaires
Le répertoire de dépôt des binaires doit être différent du répertoire d’installation et sur un FileSystem qui ne soit pas en « noexec ».
[root]# cd /sources/dbvisit_9.0.10/
[root]# unzip dbvisit-standby9.0.10-el6.zip
[root]# tar -xpvf dbvisit-standby9.0.10-el6.tar
[root]# chown -R oracle:oinstall /sources/dbvisit_9.0.10
[root]# ll /sources/dbvisit_9.0.10
total 333844
drwxr-xr-x 9 oracle oinstall 4096 Mar 4 00:15 dbvisit
-rw-r--r-- 1 oracle oinstall 248371200 Mar 4 00:19 dbvisit-standby9.0.10-el6.tar
-rw-r--r-- 1 oracle oinstall 93038123 Apr 3 15:34 dbvisit-standby9.0.10-el6.zip
-rw-r--r-- 1 oracle oinstall 4877 Mar 4 00:15 INSTALL.txt
-rw-r--r-- 1 oracle oinstall 73804 Mar 4 00:15 README.txt
Installation
L’installation n’est à effectuer qu’une seule fois par cluster vu que le répertoire d’installation sera partagé grâce à l’ACFS (/usr/dbvisit).
[oracle@PRIMAIRE]# cd /sources/dbvisit_9.0.10/dbvisit/installer/
[oracle@PRIMAIRE installer]# ./install-dbvisit
———————————————————–
Welcome to the Dbvisit software installer.
———————————————————–
It is recommended to make a backup of our current Dbvisit software
location (Dbvisit Base location) for rollback purposes.
Installer Directory /tmp/TGA/dbvisit
>>> Please specify the Dbvisit installation directory (Dbvisit Base).
The various Dbvisit products and components – such as Dbvisit Standby,
Dbvisit Dbvnet will be installed in the appropriate subdirectories of
this path.
Enter a custom value or press ENTER to accept default [/usr/dbvisit]:
> /usr/dbvisit
DBVISIT_BASE = /usr/dbvisit
———————————————————–
Component Installer Version Installed Version
———————————————————–
standby 9.0.10_0_g064b53e not installed
dbvnet 9.0.10_0_g064b53e not installed
dbvagent 9.0.10_0_g064b53e not installed
dbvserver 9.0.10_0_g064b53e not installed
observer 9.0.10_0_g064b53e not installed
———————————————————–
What action would you like to perform?
1 – Install component(s)
2 – Uninstall component(s)
3 – Exit
Your choice: 1
Choose component(s):
1 – Core Components (Dbvisit Standby Cli, Dbvnet, Dbvagent)
2 – Dbvisit Standby Core (Command Line Interface)
3 – Dbvnet (Dbvisit Network Communication)
4 – Dbvagent (Dbvisit Agent)
5 – Dbvserver (Dbvisit Central Console) – Not available on Solaris/AIX
6 – Dbvisit Observer (Automatic Failover Option) – Not available on Solaris/AIX
Press ENTER to exit Installer
Your choice: 1
———————————————————–
Summary of the Dbvisit STANDBY configuration
———————————————————–
DBVISIT_BASE /usr/dbvisit
Press ENTER to continue
———————————————————–
About to configure DBVISIT DBVNET
———————————————————–
>>> Please specify the Local host name to be used by Dbvnet on this server.
Dbvnet will be listening on the local IP Address on this server which
resolve to the host name specified here.
If using a cluster or virtual IP make sure the host name or alias
specified here resolve to the IP address local to where dbvnet is
installed. The host name should resolve to IPv4 address, if not
you can use an IPv4 IP address instead of host name.
Enter a custom value or press ENTER to accept default [HOST_P_1]:
> dbv-prod-vip
>>> Please specify the Local Dbvnet PORT to be used.
Dbvnet will be listening on the specified port for incoming connections
from remote dbvnet connections. Please make sure that this port is not
already in use or blocked by any firewall. You may choose any value
between 1024 and 65535, however the default of 7890 is recommended.
Enter a custom value or press ENTER to accept default [7890]:
> 7890
>>> Please specify the Dbvnet Passphrase to be used for secure connections.
The passphrase provided must be the same in both the local and remote
Dbvnet installations. It is used to establish a secure (encrypted)
Dbvnet connections
Enter a custom value:
> ***********
———————————————————–
Summary of the Dbvisit DBVNET configuration
———————————————————–
DBVISIT_BASE /usr/dbvisit
DBVNET_LOCAL_HOST dbv-prod-vip
DBVNET_LOCAL_PORT 7890
DBVNET_PASSPHRASE ***********
Press ENTER to continue
———————————————————–
About to configure DBVISIT DBVAGENT
———————————————————–
>>> Please specify the IPv4 address or host name to be used for the Dbvisit Agent.
The Dbvisit Agent (Dbvagent) will be listening on this local address.
Connections from Dbvserver (GUI) will be established to this Dbvagent,
thus the address must be visible from the Dbvserver location.
If using a cluster or virtual IP, make sure the host name or alias
specified here resolves to the IP address local to where the Dbvagent
is installed.
The host name should resolve to an IPv4 address, otherwise you can use
an IPv4 IP address instead of a host name.
Enter a custom value or press ENTER to accept default [HOST_P_1]:
> dbv-prod-vip
>>> Please specify the listening PORT number for Dbvagent.
The Dbvisit Agent (Dbvagent) will be listening on the specified port for
incoming requests from Dbvserver (GUI). Please make sure that this
port is not already in use, and is not blocked by any firewall. You may choose
any value between 1024 and 65535, however the default of 7891 is recommended.
Enter a custom value or press ENTER to accept default [7891]:
> 7891
>>> Please specify the passphrase for Dbvagent
Each Dbvisit Agent must have a passphrase specified. Think of this passphrase
as the password for Dbvserver (GUI) to access each Dbvagent securely.
The passphrase can be unique to each Dbvagent. It will be used to establish a
secure connection between Dbvserver and the Dbvisit Agent.
Enter a custom value:
> ***********
>>> Please specify the IPv4 address or host name to be used for the
Dbvserver Return Address (OPTIONAL)
This is an advanced, and OPTIONAL parameter. If unsure, please accept
the default value, which is blank.
If necessary, you can use this parameter to specify a fixed IPv4 address
for the Dbvisit Dbvserver (GUI). In the overwhelming majority of cases,
our software will handle this for you automatically, and setting
this parameter should NOT be necessary.
If, however, your Dbvserver’s externally-visible address differs from
the locally-resolved address, you can specify it here. The most common
scenario where this can happen is if you have address forwarding set up
on a cloud-deployed environment. If set, Dbvagent will use this address
instead of any other to connect to Dbvserver.
Enter a custom value or press ENTER to accept default [ ]:
>
>>> Please specify the port number to be used as the
Dbvserver Return Port (OPTIONAL)
This is an advanced, and OPTIONAL parameter.
This is the port value to match the OPTIONAL Dbvserver Return Address
parameter immediately above. If unsure, please accept the default value,
which is blank.
Enter a custom value or press ENTER to accept default [ ]:
>
———————————————————–
Summary of the Dbvisit DBVAGENT configuration
———————————————————–
DBVISIT_BASE /usr/dbvisit
DBVAGENT_LOCAL_HOST dbv-prod-vip
DBVAGENT_LOCAL_PORT 7891
DBVAGENT_PASSPHRASE ***********
DBVAGENT_WEBSERVER_HOST
DBVAGENT_WEBSERVER_PORT
Press ENTER to continue
———————————————————–
About to install Dbvisit STANDBY
———————————————————–
NTF repo installed.
Component standby installed.
———————————————————–
About to install Dbvisit DBVNET
———————————————————–
Component dbvnet installed.
———————————————————–
About to install Dbvisit DBVAGENT
———————————————————–
Component dbvagent installed.
———————————————————–
Component Installer Version Installed Version
———————————————————–
standby 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvnet 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvagent 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvserver 9.0.10_0_g064b53e not installed
observer 9.0.10_0_g064b53e not installed
———————————————————–
What action would you like to perform?
1 – Install component(s)
2 – Uninstall component(s)
3 – Exit
Your choice: 3
>>> Installation completed
[oracle@STANDBY]# cd /sources/dbvisit_9.0.10/dbvisit/installer/
[oracle@STANDBY installer]# ./install-dbvisit
———————————————————–
Welcome to the Dbvisit software installer.
———————————————————–
Enter a custom value or press ENTER to accept default [/usr/dbvisit]:
> /usr/dbvisit
———————————————————–
Component Installer Version Installed Version
———————————————————–
standby 9.0.10_0_g064b53e not installed
dbvnet 9.0.10_0_g064b53e not installed
dbvagent 9.0.10_0_g064b53e not installed
dbvserver 9.0.10_0_g064b53e not installed
observer 9.0.10_0_g064b53e not installed
———————————————————–
What action would you like to perform?
1 – Install component(s)
2 – Uninstall component(s)
3 – Exit
Your choice: 1
Choose component(s):
1 – Core Components (Dbvisit Standby Cli, Dbvnet, Dbvagent)
2 – Dbvisit Standby Core (Command Line Interface)
3 – Dbvnet (Dbvisit Network Communication)
4 – Dbvagent (Dbvisit Agent)
5 – Dbvserver (Dbvisit Central Console) – Not available on Solaris/AIX
6 – Dbvisit Observer (Automatic Failover Option) – Not available on Solaris/AIX
Press ENTER to exit Installer
Your choice: 1
———————————————————–
About to configure DBVISIT DBVNET
———————————————————–
>>> Please specify the Local host name to be used by Dbvnet on this server.
> dbv-stby-vip
>>> Please specify the Local Dbvnet PORT to be used.
> 7890
>>> Please specify the Dbvnet Passphrase to be used for secure connections.
> ***********
———————————————————–
About to configure DBVISIT DBVAGENT
———————————————————–
>>> Please specify the IPv4 address or host name to be used for the Dbvisit Agent.
> dbv-stby-vip
>>> Please specify the listening PORT number for Dbvagent.
> 7891
>>> Please specify the passphrase for Dbvagent
> ***********
>>> Please specify the IPv4 address or host name to be used for thenDbvserver Return Address (OPTIONAL)
>
>>> Please specify the port number to be used as the Dbvserver Return Port (OPTIONAL)
>
———————————————————–
Component Installer Version Installed Version
———————————————————–
standby 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvnet 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvagent 9.0.10_0_g064b53e 9.0.10_0_g064b53e
dbvserver 9.0.10_0_g064b53e not installed
observer 9.0.10_0_g064b53e not installed
———————————————————–
What action would you like to perform?
1 – Install component(s)
2 – Uninstall component(s)
3 – Exit
Your choice: 3
>>> Installation completed
CONFIGURATION
La première étape consiste à créer un script d’arrêt/relance pour les process dbvnet et dbvagent.
Création des scripts
[oracle]# vi /usr/dbvisit/dbvnet/actions-script.scr
#!/bin/bash
#
# Dbvnet Action Script
##############################################
# Function to change database environments
# Description:
# Use oraenv to set the environment if needed
# This is optional to set the environment
##############################################
## set following to ensure oraenv is picked up from /usr/local/bin
export PATH=/usr/local/bin:$PATH
set_env ()
{
export ORAENV_ASK=NO
export ORACLE_SID=$1
. oraenv >> /dev/null
export ORAENV_ASK=YES
export USER=oracle
}
#################
## Main Section
#################
# This is logged to CRSD agent log file
echo "`date` Action script '$_CRS_ACTION_SCRIPT' for resource [$_CRS_NAME] called for action $1"
# set environment
set_env EasyDB
cd /usr/dbvisit/dbvnet
case "$1" in
'start')
./dbvnet -d start
RET=0
echo "Running start dbvnet resource with return code $RET"
;;
'stop')
NUM=`ps -ef | grep dbvnet | egrep -v 'grep|action-script|resource' | wc -l`
if [ $NUM = 0 ]; then
## do a cleanup of pid
./dbvnet -d stop
RET=0
else
## now stop the dbvnet
./dbvnet -d stop
NUM=`ps -ef | grep dbvnet | grep -v grep | wc -l`
if [ $NUM = 0 ]; then
RET=0
else
RET=1
fi
fi
echo "Running stop dbvnet resource with return code $RET"
;;
'check')
NUM=`ps -ef | grep dbvnet | egrep -v 'grep|action-script|resource' | wc -l`
if [ $NUM = 0 ]; then
## return code 1 for check means OFFLINE
RET=1
else
## return code 0 for check means ONLINE
RET=0
fi
echo "Running check dbvnet resource with return code $RET"
;;
'clean')
for c1 in `ps -ef|grep dbvnet |egrep -v 'grep|action-script|resource'| awk '{print $2}'` ;
do
echo "...force kill dbvnet pid $c1"
kill -9 $c1
done
## do some cleanup
./dbvnet -d stop
RET=0
echo "Running clean dbvnet resource with return code $RET"
;;
esac
if [ $RET -eq 0 ]; then
exit 0
else
exit 1
fi
[oracle]# vi /usr/dbvisit/dbvagent/action-script.scr
#!/bin/bash
#
# Dbvagent Action Script
##############################################
# Function to change database environments
# Description:
# Use oraenv to set the environment if needed
# This is optional to set the environment
##############################################
## set following to ensure oraenv is picked up from /usr/local/bin
export PATH=/usr/local/bin:$PATH
set_env ()
{
export ORAENV_ASK=NO
export ORACLE_SID=$1
. oraenv >> /dev/null
export ORAENV_ASK=YES
export USER=oracle
}
#################
## Main Section
#################
# This is logged to CRSD agent log file
echo "`date` Action script '$_CRS_ACTION_SCRIPT' for resource [$_CRS_NAME] called for action $1"
# set environment
set_env EasyDB
cd /usr/dbvisit/dbvagent
case "$1" in
'start')
./dbvagent -d start
RET=0
echo "Running start dbvagent resource with return code $RET"
;;
'stop')
NUM=`ps -ef | grep dbvagent | egrep -v 'grep|action-script|resource' | wc -l`
if [ $NUM = 0 ]; then
## do a cleanup of pid
./dbvagent -d stop
RET=0
else
## now stop the agent
./dbvagent -d stop
NUM=`ps -ef | grep dbvagent | grep -v grep | wc -l`
if [ $NUM = 0 ]; then
RET=0
else
RET=1
fi
fi
echo "Running stop dbvagent resource with return code $RET"
;;
'check')
NUM=`ps -ef | grep dbvagent | egrep -v 'grep|action-script|resource' | wc -l`
if [ $NUM = 0 ]; then
## return code 1 for check means OFFLINE
RET=1
else
## return code 0 for check means ONLINE
RET=0
fi
echo "Running check dbvagent resource with return code $RET"
;;
'clean')
for c1 in `ps -ef|grep dbvagent |egrep -v 'grep|action-script|resource'| awk '{print $2}'` ;
do
echo "...force kill dbvagent pid $c1"
kill -9 $c1
done
## do some cleanup of pids
./dbvagent -d stop
RET=0
echo "Running clean dbvagent resource with return code $RET"
;;
esac
if [ $RET -eq 0 ]; then
exit 0
else
exit 1
fi
Modifier les permissions pour avoir au minimum le droit d’exécution :
[oracle]# chmod 744 /usr/dbvisit/dbvnet/action-script.scr
[oracle]# chmod 744 /usr/dbvisit/dbvagent/action-script.scr
Les ajouter en tant que ressources à notre Cluster :
[grid@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/crsctl add resource dbvnet -type cluster_resource -attr "ACTION_SCRIPT=/usr/dbvisit/dbvnet/action-script.scr, RESTART_ATTEMPTS=3, START_TIMEOUT=60, STOP_TIMEOUT=60, CHECK_INTERVAL=10, START_DEPENDENCIES='hard(dbv-prod-vip) pullup(dbv-prod-vip)', STOP_DEPENDENCIES='hard(dbv-prod-vip)' ACL='owner:oracle:rwx,pgrp:oinstall:rwx,other::r--' PLACEMENT='favored' HOSTING_MEMBERS='HOST_P_1'"
[grid@PRIMAIRE]# /u01/app/12.1.0.2/grid/bin/crsctl add resource dbvagent -type cluster_resource -attr "ACTION_SCRIPT=/usr/dbvisit/dbvagent/action-script.scr, RESTART_ATTEMPTS=3, START_TIMEOUT=60, STOP_TIMEOUT=60, CHECK_INTERVAL=10, START_DEPENDENCIES='hard(dbv-prod-vip) pullup(dbv-prod-vip)', STOP_DEPENDENCIES='hard(dbv-prod-vip)' ACL='owner:oracle:rwx,pgrp:oinstall:rwx,other::r--' PLACEMENT='favored' HOSTING_MEMBERS='HOST_P_1'"
[grid@STANDBY]# /u01/app/12.1.0.2/grid/bin/crsctl add resource dbvnet -type cluster_resource -attr "ACTION_SCRIPT=/usr/dbvisit/dbvnet/action-script.scr, RESTART_ATTEMPTS=3, START_TIMEOUT=60, STOP_TIMEOUT=60, CHECK_INTERVAL=10, START_DEPENDENCIES='hard(dbv-stby-vip) pullup(dbv-stby-vip)', STOP_DEPENDENCIES='hard(dbv-stby-vip)' ACL='owner:oracle:rwx,pgrp:oinstall:rwx,other::r--' PLACEMENT='favored' HOSTING_MEMBERS='HOST_S_1'"
[grid@STANDBY]# /u01/app/12.1.0.2/grid/bin/crsctl add resource dbvagent -type cluster_resource -attr "ACTION_SCRIPT=/usr/dbvisit/dbvagent/action-script.scr, RESTART_ATTEMPTS=3, START_TIMEOUT=60, STOP_TIMEOUT=60, CHECK_INTERVAL=10, START_DEPENDENCIES='hard(dbv-stby-vip) pullup(dbv-stby-vip)', STOP_DEPENDENCIES='hard(dbv-stby-vip)' ACL='owner:oracle:rwx,pgrp:oinstall:rwx,other::r--' PLACEMENT='favored' HOSTING_MEMBERS='HOST_S_1'"
Vérification
Démarrer et stopper chaque ressource sur chaque cluster et effectuer un relocate de la VIP pour constater que les ressources switchent entre chaque nœud.
[grid]# crsctl start resource dbvnet
[grid]# crsctl start resource dbvagent
[grid]# crsctl start resource dbv-prod-vip
CRS-2673: Attempting to stop 'dbvagent' on 'host_p_2'
CRS-2673: Attempting to stop 'dbvnet' on 'host_p_2'
CRS-2677: Stop of 'dbvagent' on 'host_p_2' succeeded
CRS-2679: Attempting to clean 'dbvagent' on 'host_p_2'
CRS-2677: Stop of 'dbvnet' on 'host_p_2' succeeded
CRS-2679: Attempting to clean 'dbvnet' on 'host_p_2'
CRS-2681: Clean of 'dbvagent' on 'host_p_2' succeeded
CRS-2681: Clean of 'dbvnet' on 'host_p_2' succeeded
CRS-2673: Attempting to stop 'dbv-prod-vip' on 'host_p_1'
CRS-2677: Stop of 'dbv-prod-vip' on 'host_p_1' succeeded
CRS-2672: Attempting to start 'dbv-prod-vip' on 'host_p_1'
CRS-2676: Start of 'dbv-prod-vip' on 'host_p_1' succeeded
CRS-2672: Attempting to start 'dbvagent' on 'host_p_1'
CRS-2672: Attempting to start 'dbvnet' on 'host_p_1'
CRS-2676: Start of 'dbvagent' on 'host_p_1' succeeded
CRS-2676: Start of 'dbvnet' on 'host_p_1' succeeded
CREATION DU FICHIER DE CONFIGURATION (DDC)
Cette étape n’est à effectuer que sur la PROD et va permettre de préparer la construction de notre standby.
[oracle@PRIMAIRE]$ ./dbvctl -o setup
=========================================================
Dbvisit Standby Database Technology (9.0.10_0_g064b53e)
http://www.dbvisit.com
=========================================================
=>dbvctl only needs to be run on the primary server.
Is this the primary server? <Yes/No> [Yes]: 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]:
END USER LICENSE AGREEMENT
...
...
...
Continue ? <Yes/No> [No]: Yes
=========================================================
Dbvisit Standby setup begins.
=========================================================
The following Oracle instance(s) have been found on this server:
SID ORACLE_HOME
=== ===========
1) EASYDB1 /u01/app/oracle/product/12.1.0.2/dbhome_2
2) EASYDB /u01/app/oracle/product/12.1.0.2/dbhome_2
3) Enter own ORACLE_SID and ORACLE_HOME
Please enter choice [] : 1
Is this correct? <Yes/No> [Yes]: Yes
=>ORACLE_SID will be: EASYDB1
=>ORACLE_HOME will be: /u01/app/oracle/product/12.1.0.2/dbhome_2
------------------------------------------------------------------------------
Enter the the virtual hostname (linked to a Virtual IP) for primary 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.
NOTE: 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.
=>SOURCE is []: dbv-prod-vip
Your input: dbv-prod-vip
Is this correct? <Yes/No> [Yes]: Yes
Choice is dbv-prod-vip
------------------------------------------------------------------------------
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/EASYDB]: /usr/dbvisit/archivelog/EASYDB
Your input: /usr/dbvisit/archivelog/EASYDB
Is this correct? <Yes/No> [Yes]: Yes
Choice is /usr/dbvisit/archivelog/EASYDB
------------------------------------------------------------------------------
Enter primary Oracle database instance for thread 1
=>RAC1_SID is [EASYDB1]:
Your input: EASYDB1
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB1
------------------------------------------------------------------------------
Enter primary host name for thread 1
=>RAC1_HOST is []: HOST_P_1
Your input: HOST_P_1
Is this correct? <Yes/No> [Yes]:
Choice is HOST_P_1
------------------------------------------------------------------------------
Enter primary ASM instance for thread 1. Leave null for ACFS
=>RAC1_SID_ASM is []: +ASM1
Is this correct? <Yes/No> [Yes]:
Choice is +ASM1
------------------------------------------------------------------------------
Enter primary Oracle database instance for thread 2
=>RAC2_SID is [EASYDB2]:
Your input: EASYDB2
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB2
------------------------------------------------------------------------------
Enter primary host name for thread 2
=>RAC2_HOST is []: HOST_P_2
Your input: HOST_P_2
Is this correct? <Yes/No> [Yes]:
Choice is HOST_P_2
------------------------------------------------------------------------------
Enter primary ASM instance for thread 2. Leave null for ACFS
=>RAC2_SID_ASM is []: +ASM2
Is this correct? <Yes/No> [Yes]:
Choice is +ASM2
------------------------------------------------------------------------------
Will the standby database be a RAC database?
=>RAC_DR is [N]:Y
Your input: Y
Is this correct? <Yes/No> [Yes]:
Choice is Y
------------------------------------------------------------------------------
Do you want to use SSH to connect to the standby server? Note that if you are
using SSH, passwordless SSH authentication between the hosts must already be
configured. By default Dbvnet will be used.
=>USE_SSH is [N]:
Your input: N
Is this correct? <Yes/No> [Yes]:
Choice is N
------------------------------------------------------------------------------
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 []: dbv-stby-vip
Your input: dbv-stby-vip
Is this correct? <Yes/No> [Yes]:
Choice is dbv-stby-vip
------------------------------------------------------------------------------
Specify the DBVNET or SSH port number on the standby server. The default value
supplied is the dbvnet port 7890. If you specified the use of SSH, please
specify the SSH port here.
=>NETPORT 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 [/usr/dbvisit]:
Your input: /usr/dbvisit
Is this correct? <Yes/No> [Yes]:
Choice is /usr/dbvisit
------------------------------------------------------------------------------
Enter ORACLE_HOME directory on the standby server
=>ORACLE_HOME_DR is [/u01/app/oracle/product/12.1.0.2/dbhome_2]:
Your input: /u01/app/oracle/product/12.1.0.2/dbhome_2
Is this correct? <Yes/No> [Yes]:
Choice is /u01/app/oracle/product/12.1.0.2/dbhome_2
------------------------------------------------------------------------------
Enter DB_UNIQUE_NAME on the standby server
=>DB_UNIQUE_NAME_DR is [EASYDB]:
Your input: EASYDB
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB
------------------------------------------------------------------------------
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 [/usr/dbvisit/archivelog/EASYDB]:
Your input: /usr/dbvisit/archivelog/EASYDB
Is this correct? <Yes/No> [Yes]:
Choice is /usr/dbvisit/archivelog/EASYDB
------------------------------------------------------------------------------
Enter standby Oracle database instance for thread 1
=>RAC1_SID_DR is [EASYDB1]:
Your input: EASYDB1
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB1
------------------------------------------------------------------------------
Enter standby host name for thread 1
=>RAC1_HOST_DR is []: HOST_S_1
Your input: HOST_S_1
Is this correct? <Yes/No> [Yes]:
Choice is HOST_S_1
------------------------------------------------------------------------------
Enter standby ASM instance for thread 1. Leave empty for ACFS
=>RAC1_SID_ASM_DR is []: +ASM1
Your input: +ASM1
Is this correct? <Yes/No> [Yes]:
Choice is +ASM1
------------------------------------------------------------------------------
Enter standby Oracle database instance for thread 2
=>RAC2_SID_DR is [EASYDB2]:
Your input: EASYDB2
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB2
------------------------------------------------------------------------------
Enter standby host name for thread 2
=>RAC2_HOST_DR is []: HOST_S_2
Your input: HOST_S_2
Is this correct? <Yes/No> [Yes]:
Choice is HOST_S_2
------------------------------------------------------------------------------
Enter standby ASM instance for thread 2. Leave empty for ACFS
=>RAC2_SID_ASM_DR is []: +ASM2
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 [EASYDB]:
Your input: EASYDB
Is this correct? <Yes/No> [Yes]:
Choice is EASYDB
------------------------------------------------------------------------------
Below are the list of configuration variables provided during the setup
process:
Configuration Variable Value Provided
====================== ==============
ORACLE_SID EASYDB1
ORACLE_HOME /u01/app/oracle/product/12.1.0.2/dbhome_2
SOURCE dbv-prod-vip
ARCHSOURCE /usr/dbvisit/archivelog/EASYDB
RAC1_THREAD 1
RAC1_SID EASYDB1
RAC1_HOST HOST_P_1
RAC1_SID_ASM +ASM1
RAC2_THREAD 2
RAC2_SID EASYDB2
RAC2_HOST HOST_P_2
RAC2_SID_ASM +ASM2
RAC_DR Y
USE_SSH N
DESTINATION dbv-stby-vip
NETPORT 7890
DBVISIT_BASE_DR /usr/dbvisit
ORACLE_HOME_DR /u01/app/oracle/product/12.1.0.2/dbhome_2
DB_UNIQUE_NAME_DR EASYDB
ARCHDEST /usr/dbvisit/archivelog/EASYDB
RAC1_SID_DR EASYDB1
RAC1_HOST_DR HOST_S_1
RAC1_SID_ASM_DR +ASM1
RAC2_SID_DR EASYDB2
RAC2_HOST_DR HOST_S_2
RAC2_SID_ASM_DR +ASM2
ENV_FILE EASYDB
Are these variables correct? <Yes/No> [Yes]:
>>> Dbvisit Database configuration (DDC) file EASYDB created.
>>> Dbvisit Database repository (DDR) EASYDB created.
Repository Version 9.0
Software Version 9.0
Repository Status VALID
Do you want to enter license key for the newly created Dbvisit Database
configuration (DDC) file? <Yes/No> [Yes]:
Enter license key and press Enter: []: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
>>> Dbvisit Standby License
License Key : xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
customer_number : xxxxxx
dbname : EASYDB
expiry_date : 2099-01-01
os : linux
sequence : 1
software_features : 00000000
status : VALID
updated : YES
version : 9
CREATION DE LA STANDBY (CSD)
Cette étape va se baser sur le fichier DDC généré précédemment, et créer notre standby en effectuant une sauvegarde de chaque datafile qui va être utilisé pour la standby.
Les actions se font depuis la PROD et la standby doit être arrêtée.
Un spfile pour la standby va être généré et se basera sur les informations sur la PROD.
Lors de l’étape de création du spfile il est possible d’ajouter/modifier des paramètres.
Les paramètres db_file_name_convert et log_file_name_convert sont indispensables si vous n’avez pas la même architecture de chaque côté.
[oracle@PRIMAIRE]$ /usr/dbvisit/standby/dbvctl -d EASYDB --csd
>>> 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]:
-------------------------------------------------------------------------------
=>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 perform backup, transfer and restore operations in parallel
when possible? [Y]: Y
Your input: Y
Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
A temporary location must be specified on dbv-prod-vip where the database will
be backed up to first.
This location must be big enough to hold RMAN backup of the whole database
(100.00GB).
=>Specify the location on this server: [/usr/tmp]: /usr/dbvisit/archivelog/EASYDB
Your input: /usr/dbvisit/archivelog/EASYDB
Is this correct? <Yes/No> [Yes]:
-------------------------------------------------------------------------------
A temporary location must be specified on dbv-stby-vip where the database
backup will be copied to before moving to specified locations.
=>Specify location on remote server: [/usr/dbvisit/archivelog/EASYDB]:
Your input: /usr/dbvisit/archivelog/EASYDB
Is this correct? <Yes/No> [Yes]:
-------------------------------------------------------------------------------
=>Do you want to use an existing standby spfile rather than create a new one
from scratch? [N]: N
Your input: N
Is this correct? <Yes/No> [Yes]: Yes
-------------------------------------------------------------------------------
=>Do you want to register a newly created standby database with RAC
Clusterware? [Y]: Y
Your input: Y
Is this correct? <Yes/No> [Yes]: Yes
The following oracle database parameters will be set in the standby database pfile or spfile:
-------------------------------------------------------------------------------
SID NAME VALUE
* _datafile_write_errors_crash_instance false
* _db_flash_cache_max_outstanding_writes 160
* _db_flash_cache_write_limit 6
* _db_writer_coalesce_area_size 16777216
* _disable_interface_checking TRUE
* _enable_NUMA_support FALSE
* _file_size_increase_increment 2143289344
* _fix_control 18960760:on
* _gc_policy_time 0
* _gc_undo_affinity FALSE
* _gcs_cluster_flash_cache_mode 1
* audit_file_dest /u01/app/oracle/admin/EASYDB/adump
* audit_sys_operations TRUE
* cluster_database TRUE
* compatible 12.1.0.2.0
* cpu_count 8
* cursor_sharing EXACT
* db_block_checking FULL
* db_block_checksum FULL
* db_block_size 8192
* db_create_file_dest +DATA
* db_domain
* db_files 1024
* db_flash_cache_size 0
* db_lost_write_protect TYPICAL
* db_name EASYDB
* db_recovery_file_dest +RECO
* db_recovery_file_dest_size 1932735283200
* db_unique_name EASYDB
* diagnostic_dest /u01/app/oracle
* dispatchers (PROTOCOL=TCP) (SERVICE=EASYDBXDB)
* fast_start_mttr_target 300
* filesystemio_options setall
* global_names FALSE
* inmemory_size 0
* log_archive_format %t_%s_%r.dbf
* log_buffer 64000000
* nls_language AMERICAN
* nls_territory AMERICA
* open_cursors 1000
* os_authent_prefix
* parallel_adaptive_multi_user FALSE
* parallel_execution_message_size 16384
* parallel_threads_per_cpu 2
* pga_aggregate_limit 17179869184
* pga_aggregate_target 8589934592
* processes 800
* remote_login_passwordfile exclusive
* session_cached_cursors 100
* sessions 1224
* sga_max_size 17179869184
* sga_target 17179869184
* shared_pool_reserved_size 107374182
* spfile +DATA
* sql92_security TRUE
* undo_retention 900
* use_large_pages ONLY
EASYDB1 instance_number 1
EASYDB1 thread 1
EASYDB1 undo_tablespace UNDOTBS1
EASYDB2 instance_number 2
EASYDB2 thread 2
EASYDB2 undo_tablespace UNDOTBS2
-------------------------------------------------------------------------------
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
.
[FACULTATIF] - SI BESOIN DE MODIFIER SPFILE
Please enter your choice [1]: 2
=>Enter full parameter name: []: NOM_DU_PARAMETRE
1 - Remove from the standby parameter file
(parameter will be set to default value)
2 - New value in the standby parameter file
=>Please enter your choice: []: 2
=>Enter new value (leave blank to set to null) []: VALEUR_DU_PARAMETRE
Validating ... please wait
[FACULTATIF] - FIN SI BESOIN DE MODIFIER SPFILE
.
Please enter your choice [1]: 1
Validating oracle database parameters... please wait
=>SUCCEEDED
-------------------------------------------------------------------------------
=>Create standby database template for EASYDB 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: Y
Is this correct? <Yes/No> [Yes]:
>>> dbvctl 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 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
>>> Total database size for EASYDB1 is 100.00GB
>>> Backing up primary database...
Backing up datafile 1... done
Backing up datafile 2... 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
>>> Transferring backup from dbv-prod-vip to dbv-stby-vip...
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_1_02ut2dqb_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_1_03ut2dqq_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_2_04ut2dr1_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_3_05ut2drt_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_4_06ut2ds6_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_5_07ut2dt2_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_6_08ut2dtc_1_1.RMAN... done
Transferring /usr/dbvisit/archivelog/EASYDB/DBV_EASYDB_CSD_DBF_7_09ut2egc_1_1.RMAN... done
>>> Starting standby database EASYDB on dbv-stby-vip mount... done
>>> Restoring datafiles on dbv-stby-vip...
Restoring datafile 1... done
Restoring datafile 2... done
Restoring datafile 3... done
Restoring datafile 4... done
Restoring datafile 5... done
Restoring datafile 6... done
Restoring datafile 7... done
>>> Renaming standby redo logs and tempfiles on dbv-stby-vip... done
>>> Completing standby database creation... done
>>> Standby database created.
>>> Performing checkpoint and archiving logs... done
>>> Synchronising standby... done
GESTION DES ARCHIVELOGS
Activer l'envoi/application des archivelogs automatiquement
Sur chaque cluster, démarrer le daemon qui s’occupera de vérifier le gap entre chaque base et qui enverra les archivelogs manquants pour les appliquer sur la standby.
[oracle@PRIMAIRE]# /usr/dbvisit/standby/dbvctl -d EASYDB -D start
[oracle@STANDBY]# /usr/dbvisit/standby/dbvctl -d EASYDB -D start
Vérifier l'état de la synchonisation
Cette action est à faire uniquement sur la PROD.
[oracle@PRIMAIRE]# /usr/dbvisit/standby/dbvctl -d EASYDB -i
=============================================================
Dbvisit Standby Database Technology (9.0.10_0_g064b53e) (pid 11903)
dbvctl started on dbv-prod-vip: Tue Apr 14 17:56:23 2020
=============================================================
Dbvisit Standby log gap report for EASYDB at 202004141756:
-------------------------------------------------------------
Description | SCN | Timestamp
-------------------------------------------------------------
Source 2226065689407 2020-04-14:17:56:27 +02:00
Destination 2226065685885 2020-04-14:17:43:30 +02:00
Standby database time lag (DAYS-HH:MI:SS): +00:12:57
Report for Thread 1
-------------------
SOURCE
Current Sequence 29
Last Archived Sequence 28
Last Transferred Sequence 28
Last Transferred Timestamp 2020-04-14 17:45:26
DESTINATION
Recovery Sequence 28
Transfer Log Gap 0
Apply Log Gap 1
Report for Thread 2
-------------------
SOURCE
Current Sequence 20
Last Archived Sequence 19
Last Transferred Sequence 19
Last Transferred Timestamp 2020-04-14 17:45:16
DESTINATION
Recovery Sequence 20
Transfer Log Gap 0
Apply Log Gap 0
=============================================================
dbvctl ended on dbv-prod-vip: Tue Apr 14 17:56:33 2020
=============================================================