Oracle Data Guard With TSM
Oracle Data Guard With TSM
Oracle Data Guard With TSM
Storage Manager
Confirm that TSM is installed on the host/hosts and tdpo.opt file has been
configured.
Contact the TSM administrator and confirm that all pre-requisite tasks related to the TSM
set-up have been completed on BOTH primary as well as standby machines.
For example on Linux machines the tdpo.opt file should exist in the following location :
/opt/tivoli/tsm/client/oracle/bin/
or
/opt/tivoli/tsm/client/oracle/bin64/
If the ORACLE_SID is dgtest9i, then the tdpo.opt file is set up with the name tdpo.dgtest9id.opt
We can test the TDP set up using the sbttest command
export TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin64/tdpo.dgtest9id.opt
[oracle@itlinuxdevblade08 bin64]$ sbttest test
The sbt function pointers are loaded from libobk.so library.
-- sbtinit succeeded
Return code -1 from sbtinit, bsercoer = 0, bsercerrno = 0
Message 0 not found; product=RDBMS; facility=SBT
Gavin Soorma
Page
9/15/2016
It is a best practice to place the primary database in force logging mode so that all operation
are captured in the redo stream. To place the primary database in force logging mode issue
the following SQL
SQL > alter database force logging;
Gavin Soorma
Page
9/15/2016
READ RATE specifies the number of buffers to be read per second by RMAN
backup or copy operations
Gavin Soorma
Page
9/15/2016
Remember while creating the $BDUMP, $UDUMP, $CDUMP and $PFILE directories that
the ORACLE_SID will be the same as the primary database.
Also try and ensure that the size of the mount points exactly mirror the primary node
otherwise we will face issues both while creating the standby database as well as when we
perform housekeeping tasks on the primary like adding or resizing a datafile.
We then need to create the password file using the same password for the user SYS as what
we have used while creating the password file on the primary node.
Copy the init<SID>.ora file from the primary node to $ORACLE_HOME/dbs on the standby
node.
Create a pfile from this spfile
$ export ORACLE_SID=<SID>
SQL> create pfile from spfile;
In this example, we are making the following assumptions:
ORACLE_SID=dba01
Important:
Please ensure that the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT
parameters are carefully entered and every mount point which has a datafile or logfile of the
primary database is mentioned in the string list.
We will now edit the pfile to include parameters specific to the standby site .
FAL_SERVER=dba01_itlinux01
FAL_CLIENT=dba01_itlinux02
DB_FILE_NAME_CONVERT=(/itlinux01db01,/itlinux02db01,/itlinux01db02,/itlinux02db02)
LOG_FILE_NAME_CONVERT=(/itlinux01db01,/itlinux02db01,/itlinux01db02,/itlinux02db02)
STANDBY_ARCHIVE_DEST=/itlinux02db01/ORACLE/dba01/arch
STANDBY_FILE_MANAGEMENT=AUTO
Gavin Soorma
Page
9/15/2016
The following parameters will only apply when the standby database assumes the role of a
primary database after a switchover is performed. They can be excluded at this point from the
init.ora file, but a best practice is to include it now itself so that when a switchover is made in
the future, no further changes to the init.ora need to be made.
LOG_ARCHIVE_DEST_2='SERVICE=dba01_itlinux01 ARCH
LOG_ARCHIVE_DEST_STATE_2=DEFER
LOG_ARCHIVE_DEST_1='LOCATION=/itlinux02db01/ORACLE/dba01/arch
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_FORMAT=%d_%t_%s.arc
Note: if we are using Oracle 10g then we can use the following parameters:
*.log_archive_dest_1='location=/itlinux02db01/ORACLE/dba01/arch','valid_for=(ALL_LOGFILES,ALL_RO
LES)'
*.log_archive_dest_2='SERVICE=dba01_itlinux01 VALID_for=(ONLINE_LOGFILES, PRIMARY_ROLE)
ARCH
After making the required changes to the init.ora create a spfile from this.
SQL > create spfile from pfile;
Client connections use the alias dba01 accessing via port 1526
On the primary machine there are two listeners running one for accepting client
connections to the database and the other for the log shipping. ( ports 1526 and 1522
respectively)
On the standby machine we have only one listener running which is being used for
the log shipping between the two sites ( port 1522). The listener listening on port
1526 will ONLY be started when the standby site assumes the role of a primary site
after a failover or switchover is performed.
Gavin Soorma
Page
9/15/2016
This is a sample copy of the tnsnames.ora and listener.ora files we need to ensure that
tnsnames.ora file on BOTH sites have the same entries for FAL_SERVER and FAL_CLIENT
as well.
listener.ora
# LISTENER.ORA Network Configuration File: /opt/oracle/product9206/network/admin/listener.ora
# Generated by Oracle configuration tools.
ITLINUX02 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = itlinux02.hq.emirates.com)(PORT = 1522))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
)
)
)
#LISTENER.ORA Network Configuration File
#Created by Oracle Enterprise Manager Clone Database tool
SID_LIST_ITLINUX02 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle/product9206)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ANY")
)
(SID_DESC =
(GLOBAL_DBNAME = dba01)
(ORACLE_HOME = /opt/oracle/product9206)
(SID_NAME = dba01)
)
)
TRACE_LEVEL_ITLINUX02 = OFF
LOGGING_ITLINUX02 = OFF
TRACE_LEVEL_PRIMARY = OFF
LOGGING_PRIMARY = OFF
PRIMARY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = itlinux02.hq.emirates.com)(PORT = 1526))
)
SID_LIST_PRIMARY =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME=dba01)
(ORACLE_HOME = /opt/oracle/product9206)
Gavin Soorma
Page
9/15/2016
(SID_NAME = dba01)
)
)
tnsnames.ora
dba01_itlinux01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = itlinux01.hq.emirates.com)
(PORT = 1522)
)
)
(CONNECT_DATA =
(SID = dba01)
)
)
dba01_itlinux02 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = itlinux02.hq.emirates.com)
(PORT = 1522)
)
)
(CONNECT_DATA =
(SID = dba01)
)
)
dba01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TCP)
(PROTOCOL = TCP)
(HOST = itlinux01.hq.emirates.com)
(PORT = 1526)
)
)
(CONNECT_DATA =
(SID = dba01)
)
)
Gavin Soorma
Page
9/15/2016
These are the last few lines from the output of the above command. Note the last archive log
sequence number applied was 1215 and NOT log sequence number 1216.
..
..
Gavin Soorma
Page
9/15/2016
00:00:00 ora_mrp0_dba01
If for any reason some further recovery is required, we can manually copy all the archive log
files from the production machine to the standby machine standby_archive_dest and do the
recovery MANUALLY via the following command:
SQL> RECOVER STANDBY DATABASE ( apply the required archive log file when
prompted)
This example will put the standby database in MAXIMUM PERFORMANCE mode. In case
we wish to configure the standby database for MAXIMUM AVAILABILITY or MAXIMUM
PROTECTION we need to create additional standby redo log files ( at least one more than
the number of the current online redo log files and make sure they are the same size as the
online redo log files).
We also will need to use the LGWR keyword in the parameter log_archive_dest_2 and issue
the command on the primary database while it is mount state.
Gavin Soorma
Page
9/15/2016