Professional Documents
Culture Documents
A Dataguard configuration consist of one production DB and upto 9 standby databases. The databases in the Dataguard
configuration are connected by Orcale Net. There are no restrictions on the database where databases are located,
provided they can communicate with each other.
Primary Database:
A dataguard configuration consist one production DB, also known as primary database that plays primary role. The
primary database can be either a single-instance oracle DB or an Oracle Real Application Cluster database.
Standby Database:
A standby database is a transactionally consistent copy of a primary database. A standby database is initially created
from backup copy of the primary database. Once created, Dataguard automatically maintains the standby database by
transfering the redo data from the primary database to the standby database and then applying the same to the standby
database. Standby database also can be single instance or RAC
-Physical Standby
-Logical Standby
Physical Standby:
It provides a physical identical copy of the primary database, with on-disk database structure that are identical to the
primary database on a block for block basis. The database schema including indexes are same, physical standby is kept
synchronized with the primary database by recovering the redo data received from the primary database.
Logical Standby:
It contains the same logical information as the production database although the physical organization and structure of
the data can be different. It is kept synchronized with the primary database by transforming the redologs received from
the primary database into SQL statements and then executing the same on the standby database. This allows users to
access logical standby database for queries and reporting puposes at any time. The logical standby database can be used
for data protection and reporting.
Dataguard services
Network Configuration:
The primary database is connected to standby database using Oracle net.
Dataguard Broker:
The dataguard broker is a distributed management framework that automates and centralizes the creation,
maintenance and monitoring Dataguard configurations.
Creating and enabling one or more Dataguard configurations including setting up log transport services and Log
apply services.
Adding new or existing standby databases to an existing Dataguard configuration.
Managing an entire Dataguard configuration from any system in the configuration.
Monitoring log apply rates, capturing diagnostic information and detecting problems quickly with centralized
monitoring, testing and performance tools.
It can be initiated with GUI or CLI.
Maximum Protection
This mode offers the highest level of data protection. Data is synchronously transfered to the standby database from
primary database and transactions are not committed unless the redo data is available on atleast one standby database
configured in the mode. If the last standby database configured in this mode becomes unavailable, processing stops on
the primary database. This mode guarantees no data loss.
Maximum availability
This modes is similar to the maximum protection mode, including the no data loss, however if the standby database
becomes unavailable (i.e. N/w failure), processing continues on the primary database, when the fault is corrected, the
standby database is resynchronized to primary database. If there is a need to failover before the standby database is
resynchronized, some data may be lost.
Maximum Performance
This mode offers slightly less data protection on the primary database but higher performance than maximum
availability mode. In this mode, as the primary database process transactions, redo data is synchronously shipped to the
standby database, the commit operation on the primary database does not wait for the standby database to acknowledge
receipt of redo data before completing write operations on the primary database. If any standby is unavailable,
processing continues on the primary database and there is a little effect on the performance.
Dataguard Services
Primary Database:
Log Writer Process(LGWR): collects redo information and updates the online redo logs, it can also create loca
archived redologs and transfer online redo to standby.
Archiver(ARCH): One or more archiver prosesses copies the online redo logs either locally or remotely for standby
database.
Fetch Archive Log: services requests for archive redo logs from FAL clients running on multiple standby databases.
Multiple FAL servers can be run on a primary database, one for each FAL request.
Standby Database:
Fetch Archive Log: pulls archive log files from the primary database, initiates transfer and archivelogs when it detects
a gap sequence.
Remote File Server: Receives the archived redo logs from primary database.
Archiver Process: Archives the standby redo logs applied by the managed recovery process.
Managed Recovery Process: Applies archived redo log information to the standby database.
On Standby Database
1.Copy the pfile, passwordfile of the primary database to the standby server.
2.Prepare the Initialization Parameters.
3.Setup the environment to support the Standby database on the standby node.
4.Configure the Listener.
5.Start the physical standby database and verify standby database is performing properlyperly
1.General View
3.Enable Archiving
SQL>startup mount
SQL> alter database archivelog
SQL> alter database open;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 80
Next log sequence to archive 82
Current log sequence 82
fal_server=vinodstd
fal_client=vinod
standby_file_management=auto
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/oracle/product/10.2.0/db_1/admin/vinod/udump'
Configure Listener.ora and tnsname.ora
Listener.ora
SID_LIST_VINOD =
(SID_LIST =
(SID_DESC =
(SID_NAME = vinod)
(GLOBAL_DBNAME = vinod)
(ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_1)
)
)
Vinod =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
Tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
Once the new parameters file is ready we create from it the spfile
SQL> shutdown immediate
SQL> startup nomount pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> create spfile from pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> shutdown immediate
SQL> startup
6. Backup the primary database and transfer a copy to the standby node.
Copy all physical files and transfer the same to the standby database witch the same structure.
7. SQL> startup
fal_server=vinod
fal_client=vinodstd
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
NOTE: If there is a need to copy the datafile, RLG in different path unlike the primary database, here is the initialization
parameter to be set.
db_file_name_convert='/oradata/vinod/data', '/oradata/vinodstd/data'
log_file_name_convert='/oradata/vinod/redo', '/oradata/vinodstd/redo'
vinodstd =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
vi tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
OK(10 msec)
OK(10 msec)
5. Check alert log file will show following operation taking place
..............
..............
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION
On Primary
Database:
>archive log list
Database log mode
Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 13
Next log sequence to archive 15
Current log sequence 15
On Standby Database:
>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 16
Next log sequence to archive 0
Current log sequence 18
Implementation Notes:-
On Primary Database
1.Enable force Logging
2.Create password file
3.Enable Archiving
4.Set Primary Database Initialization Parameters
5.Configure the Listener
6.Create a control file for the standby Database
7. Take Hot backup and copy the physical files to standby server.
8. Startup
On Standby Database
1.Copy the pfile, passwordfile of the primary database to the standby server.
2.Prepare the Initialization Parameters.
3.Setup the environment to support the Standby database on the standby node.
4.Configure the Listener.
5.Start the physical standby database and verify standby database is performing properly
1.General View
3.Enable Archiving
SQL>startup mount
SQL> alter database archivelog
SQL> alter database open;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 80
Next log sequence to archive 82
Current log sequence 82
fal_server=vinodstd
fal_client=vinod
standby_file_management=auto
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/oracle/product/10.2.0/db_1/admin/vinod/udump'
Vinod =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
Tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
Once the new parameters file is ready we create from it the spfile
SQL> shutdown immediate
SQL> startup nomount pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> create spfile from pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> shutdown immediate
SQL> startup
Backup the primary database and transfer a copy to the standby node.
Copy all physical files and transfer the same to the standby database witch the same structure.
fal_server=vinod
fal_client=vinodstd
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
NOTE: If there is a need to copy the datafile, RLG in different path unlike the primary database, here is the initialization
parameter to be set.
db_file_name_convert='/oradata/vinod/data', '/oradata/vinodstd/data'
log_file_name_convert='/oradata/vinod/redo', '/oradata/vinodstd/redo'
vinodstd =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
vi tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
OK(10 msec)
OK(10 msec)
On Primary
Database:
>archive log list
Database log mode
Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 13
Next log sequence to archive 15
Current log sequence 15
On Standby Database
1.Copy the pfile, passwordfile to the standby server
2.Prepare the Initialization Parameters.
3.Setup the environment to support the Standby database on the standby node.
4.Configure the Listener.
5.Start the physical standby database and verify standby database is performing properly
3.Enable Archiving
SQL>startup mount
SQL> alter database archivelog
SQL> alter database open;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 80
Next log sequence to archive 82
Current log sequence 82
fal_server=vinodstd
fal_client=vinod
standby_file_management=auto
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/oracle/product/10.2.0/db_1/admin/vinod/udump'
Vinod =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
Tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
Once the new parameters file is ready we create from it the spfile
SQL> shutdown immediate
SQL> startup nomount pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> create spfile from pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> shutdown immediate
SQL> startup
5. Configure RMAN
RMAN> connect target sys/sys@vinod
RMAN> backup database include current controfile for standby
RMAN> backup archivelog all;
OR
RMAN> backup database include current controfile for standby plus archivelog;
6. Copy all the backup pieces to the standby server on the same location where as in primary server
Copy the pfile, passwordfile from the primary server to the standby server.
fal_server=vinod
fal_client=vinodstd
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
NOTE: If there is a need to copy the datafile, RLG in different path unlike the primary database, here is the initialization
parameter to be set.
db_file_name_convert='/oradata/vinod/data', '/oradata/vinodstd/data'
log_file_name_convert='/oradata/vinod/redo', '/oradata/vinodstd/redo'
vinodstd =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
vi tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
OK(10 msec)
OK(10 msec)
6. Startup nomount the standby database and duplicate the target database.
Connect to RMAN
RMAN> connect target sys/sys@vinod
RMAN>connect auxiliary sys/sys@vinodstd
RMAN>duplicate target database for standby nofilenamecheck;
On Primary Database:
>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 13
Next log sequence to archive 15
Current log sequence 15
On Standby Database:
>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 16
Next log sequence to archive 0
Current log sequence 18
On Standby Database
1.Copy the pfile, passwordfile to the standby server
2.Prepare the Initialization Parameters.
3.Setup the environment to support the Standby database on the standby node.
4.Configure the Listener.
5.Start the physical standby database and verify standby database is performing properly
1.General View
3.Enable Archiving
SQL>startup mount
SQL> alter database archivelog
SQL> alter database open;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 80
Next log sequence to archive 82
Current log sequence 82
fal_server=vinodstd
fal_client=vinod
standby_file_management=auto
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/home/oracle/oracle/product/10.2.0/db_1/admin/vinod/udump'
Vinod =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
Tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
Once the new parameters file is ready we create from it the spfile
SQL> shutdown immediate
SQL> startup nomount pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> create spfile from pfile='/home/oracle/oracle/product/10.2.0/db_1/dbs/initvinod.ora';
SQL> shutdown immediate
SQL> startup
6. Configure RMAN
RMAN> connect target sys/sys@vinod
RMAN> backup database include current controfile for standby
RMAN> backup archivelog all;
OR
RMAN> backup database include current controfile for standby plus archivelog;
7. Copy all the backup pieces to the standby server on the same location where as in primary server
Copy the pfile, passwordfile from the primary server to the standby server.
fal_server=vinod
fal_client=vinodstd
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=283115520
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
NOTE: If there is a need to copy the datafile, RLG in different path unlike the primary database, here is the initialization
parameter to be set.
db_file_name_convert='/oradata/vinod/data', '/oradata/vinodstd/data'
log_file_name_convert='/oradata/vinod/redo', '/oradata/vinodstd/redo'
vinodstd =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
)
vi tnsnames.ora
vinod =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.168)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinod)
)
)
vinodstd =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.11.138)(PORT = 1525))
)
(CONNECT_DATA =
(SERVICE_NAME = vinodstd)
)
)
OK(10 msec)
OK(10 msec)
7. Startup nomount the standby database and duplicate the target database.
Connect to RMAN
RMAN> connect target sys/sys@vinod
SQL> Alter database mount standby database;
RMAN> Restore database;
RMAN>Recover database;
SQL> Alter database recover managed standby database disconnect;
On Standby Database:
>archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oraarch/vinod
Oldest online log sequence 16
Next log sequence to archive 0
Current log sequence 18
Database Switchover
Convert the primary database to the standby database
>select database_role from v$database;
primary
>shut immediate
> startup