Professional Documents
Culture Documents
Table of Contents
Configuration of Oracle Physical standby ................................................................................................ 3
Oracle Database Enterprise Edition Requirement .............................................................................. 3
Hardware Configuration of the oracle data guard .............................................................................. 3
Primary Database .............................................................................................................................. 3
Physical Standby Database: .............................................................................................................. 4
Configuration of Physical Database:..................................................................................................... 4
Enable Archiving: .............................................................................................................................. 4
Enable force logging: ......................................................................................................................... 5
Enable Login with password file: ..................................................................................................... 5
Configuration of initialization parameters: ..................................................................................... 6
Standby file management ................................................................................................................. 9
Create standby redo log files: ......................................................................................................... 10
Create a full backup of the primary database and the control file: .............................................. 11
Prepare initialization file for the standby database: ..................................................................... 11
Transfer the backup set and pfile created to the standby host: ................................................... 11
Configuration of Standby Network Components: ............................................................................. 12
Oracle Net alias on primary database: ........................................................................................... 12
Oracle net alias on standby database: ............................................................................................ 13
Configure the listener of primary database: .................................................................................. 14
Configure the listener of standby database: .................................................................................. 15
Configure the standby database: ........................................................................................................ 16
Configure the password file: ........................................................................................................... 16
Create spfile form the previously configured pfile: ....................................................................... 16
Create and start Standby Instance: ................................................................................................ 16
Start redo apply for the standby database: .................................................................................... 17
Start Remote Archiving: ...................................................................................................................... 17
Verify the physical standby configuration is valid: ........................................................................... 18
Test Redo Transport: ...................................................................................................................... 18
Test redo apply: ............................................................................................................................... 18
Some useful dynamic views for Trouble shooting: ....................................................................... 19
Configuration of Oracle Physical standby
Oracle Data Guard (known as Oracle Standby Database prior to Oracle9i), forms an
extension to the Oracle RDBMS and provides organizations with high availability, data
protection, and disaster recovery for enterprise databases. Oracle Data Guard provides the
DBA with services for creating, maintaining, managing, and monitoring one or more
standby databases. The functionality included with Oracle Data Guard enables enterprise
data systems to survive both data corruption as well as major disasters .
Parameters Description
Ram 1GB
HDD 35 GB
Physical Standby Database:
Parameters Description
RAM 1 GB
HDD 35 GB
Enable Archiving:
Oracle Data Guard relies on redo from the primary database in order to maintain the standby. This
requires the primary database be placed into archivelog mode. So check the database is checked if it
is in archive log mode or not by issuing following command.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 3
Current log sequence
As the database is not in archive log mode it was changed to archive log mode as:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Database altered.
Before making the critical decision to enable or not to enable force logging, you should be aware
that:
Temporary tablespaces and temporary segments are never logged
If you enable force logging on the primary database while the database is open, force
logging will not be enabled until all of the current nologging activities are complete
NOTE:
The destinations from LOG_ARCHIVE_DEST_1 through LOG_ARCHIVE_DEST_10 can contain either the
LOCATION or SERVICE attribute, while destinations from LOG_ARCHIVE_ DEST_11 through
LOG_ARCHIVE_DEST_31 can contain only the SERVICE attribute, which does not support the LOCAL
destination. For the LOCAL destination, you can specify a disk location or FRA. When specifying the
SERVICE attribute, a valid Oracle Net Service name that identifies the remote Oracle database
instance is used, where the redo data will be sent.
e.g. alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/ oraarch';
alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_ DEST';
This step in the configuration of oracle datagurad that we are configuring is optional as we are
configuring in maximum performance mode. But the protection modes like maximum availability
and maximum protection mandates the creation of the standby redo logs. But the oracle suggests to
create the standby redo log files with any protection mode so we are configuring standby redo log
files here. When creating standby redo logfiles it is recommended to create the standby logs more
than the number of redo log groups with same size of the redo log groups.
The generalize formula to calculate the standby redo log files is:
(# of online redo log file groups on primary + 1) * maximum # of threads
So as our database consists of three redo log groups and consists of one threads so we are
configuring 4 standby redo log groups as:
SQL> select group#, thread#, bytes/1024/1024 "Size in MB"
2 from v$Log;
GROUP# THREAD# Size in MB
---------- ---------- ----------
1 1 50
2 1 50
3 1 50
Create a full backup of the primary database and the control file:
The standby database can be configured by either hot or cold backup, but we are using the hot
backup but full using the RMAN utility and using the backup to restore in the standby site.
[oracle@orahost ~]$ mkdir -p /storage/db_staging/
[oracle@orahost ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Sat Apr 19
11:05:19 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights
reserved.
connected to target database: ORA11G (DBID=4241441809)
RMAN> backup device type disk format '/storage/db_staging/%U' database
plus archivelog;
Transfer the backup set and pfile created to the standby host:
The next step is to transfer the backup sets of the primary database and the edited pfile to the
standby database for configuring the standby database.
[oracle@orahost ~]$ scp /storage/db_staging/*
oracle@192.168.179.142:/storage/db_staging/
Configuration of Standby Network Components:
Oracle data guard depends on Oracle Net as the transport mechanism to propagate changes made
on primary database to the standby. The oracle net listener and oracle net aliases must be
configured on both the primary and standby host in order to facilitate Data Guard’s communication
requirements. So the following components are needed to configure for oracle Data Guard’s
commutation.
After successful creation of the directories check if the environmental variables are properly set or
not as:
[oracle@standby admin]$ env |grep ORACLE
ORACLE_DBUNQNAME=orastandby
ORACLE_SID=orastandby
ORACLE_HOSTNAME=standby.oracle.com
ORACLE_BASE=/u01/app/oracle
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome1
[oracle@standby admin]$ echo $LD_LIBRARY_PATH
/u01/app/oracle/product/11.2.0.3/dbhome1/lib:/lib:/usr/lib
[oracle@standby admin]$ echo $PATH
/u01/app/oracle/product/11.2.0.3/dbhome1/bin:/usr/sbin:/usr/kerberos/b
in:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
The validity of the configuration can be viewed by issuing query on views like v$datagurad_status,
v$archived_log, v$archive_dest;
It shows that the transmission was successful as the status is valid and need to trouble shoot by
looking the alert log file if the status was invalid.