Oracle Data Guard: Difference between revisions

Content deleted Content added
Flag as containing how-to content
m Disambiguating links to Disaster recovery (link changed to IT disaster recovery) using DisamAssist.
 
(116 intermediate revisions by 64 users not shown)
Line 1:
The software which [[Oracle Corporation]] markets as '''Oracle Data Guard''' forms an extension to the [[Oracle Database|Oracle relational database management system]] (RDBMS). It aids in establishing and maintaining secondary standby databases as alternative/supplementary repositories to production primary databases.
{{Howto}}
 
Oracle provides both [[graphical user interface]] (GUI) and [[command line interface|command-line]] (CLI) tools for managing Data Guard configurations.
The software which [[Oracle Corporation]] markets as '''Oracle Data Guard''' forms an extension to the [[Oracle Database|Oracle]] [[database management system|RDBMS]]. It aids in establishing and maintaining secondary "[[standby database]]s" as alternative/supplementary repositories to production "primary databases".
 
Data Guard supports both '''physical standby''' and '''logical standby''' sites. Oracle Corporation makes Data Guard available only as a [[product bundling|bundled]] feature included within its "Enterprise Edition" of the [[Oracle RDBMS]].<ref>http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/standby.htm#insertedID3 ''Data Guard Concepts and Administration'', 11g Release 1 (11.1); Section 2.3.2: "Oracle Software Requirements" Retrieved 2007-10-01</ref>
Oracle Corporation provides both [[graphical user interface|GUI]] and [[command line interface|command-line]] tools for managing Data Guard configurations.
 
Data Guard supports both '''physical standby''' and '''logical standby''' sites. Oracle Corporation makes Data Guard available only as a [[product bundling|bundled]] feature included within its "Enterprise Edition" of the [[Oracle RDBMS]].<ref>http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/standby.htm#insertedID3 ''Data Guard Concepts and Administration'', 11g Release 1 (11.1); Section 2.3.2: "Oracle Software Requirements" Retrieved [[2007-10-01]]</ref>
 
With appropriately set-up Data Guard operations, [[database administrator|DBA]]s can facilitate [[failover]]s or [[switchover]]s to alternative hosts in the same or alternative locations.
Line 11 ⟶ 9:
== Configurations ==
 
For the purposes of Data Guard, each Oracle database functions either in a primary database role or in a standby database role - with the ability to transition from one role to the other.<ref>{{cite book|url=http://docs.oracle.com/cd/E11882_01/server.112/e41134/concepts.htm#i1033808|title=Oracle Data Guard Concepts and Administration 11g Release 2 (11.2)|last=Rich|first=Kathy|display-authors=etal|access-date=8 Mar 2017}}
A physical standby database attempts to replicate the exact structure and layout of its primary database across the [[Oracle Net]] [[network layer]]. It can function either in archiving ("recovery") mode or in read-only mode, but not in both modes at the same time. It can become a standalone database when required, but needs rebuilding before reverting from standalone to standby functionality.
</ref>
 
=== Physical standby (Redo Apply) ===
Logical standby databases re-apply SQL transactions generated on their primary node; thus physical structures and organization. As of Oracle release 11g Data Guard may operate across different "CPU architectures, operating systems ... operating system binaries (32-bit/64-bit), and Oracle database binaries (32-bit/64-bit)."<ref>http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/standby.htm#insertedID3 ''Data Guard Concepts and Administration'', 11g Release 1 (11.1); Section 2.3.1 "Hardware and Operating System Requirements" Retrieved [[2007-10-01]]</ref> Users (under certain conditions) can write to as well as read from logical standby databases; and such databases can switch in function to and fro between primary and standby roles.
A physical standby database replicates the exact contents of its primary database across the [[Oracle Net]] [[network layer]]. While the relative physical storage locations can differ, the data in the database will be exactly the same as in the primary database. Physical standby databases can function either in managed-recovery mode or in read-only mode, but not in both modes at the same time (unless the databases are at Oracle Database 11.1 or higher and the Active Data Guard option is licensed - see below). The standby makes use of "Redo Apply" technology.
 
Physical standby databases have the same DBID identifiers as their primary equivalents.<ref>
== Operation ==
{{cite book
 
|last1= Tchoko
A primary site which has an archived [[redo log]] to transfer invokes the '''RFS (remote file server)''' background process within the Oracle instance running on a standby host. The RFS process then performs the task of receiving archived redo logs sent from the primary database.
|first1= Floribert
 
|title= Oracle: Protect Your Data
Alternatively, a supplementary mechanism may transfer the archived redo logs. On the standby database a '''Fetch Archive Log (FAL)''' client monitors for gaps in the sequence of received logs. If it finds a gap, it may invoke one or more Fetch Archive Log (FAL) servers to run on the primary database to forward the missing item(s).<ref>
|url= https://books.google.com/books?id=1Py_soo_3pkC
[http://www.oracle-base.com/articles/9i/DataGuard.php Oracle-Base site summary of Data Guard], retrieved [[2007-09-05]]; [http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/toc.htm Oracle Corp version 11.1 documentation links], retrieved [[2007-09-05]].
|publisher= AuthorHouse
|publication-date= 2012
|page= 128
|isbn= 9781467896214
|access-date= 2015-03-17
|quote= [...] a new identifier DBID is assigned to the new database unless the database is a standby database. In this case it retains the same DBID as the source database.
}}
</ref>
 
=== Logical standby (SQL Apply) ===
Once the archived redo logs have arrived, other processes (such as an '''ARCH (Archiver process)''', an '''MRP (Managed Recovery Process)''', and/or an '''LSP (Logical Standby Process)''') may set about applying the log contents to the standby database..
Logical standby databases convert the redo generated at the primary database into data and SQL and then re-apply those SQL transactions on the logical standby. Thus, physical structures and organization will be different from the primary database. Users can read from logical standby databases while the changes are being applied and, if the GUARD is set to STANDBY (ALTER DATABASE GUARD STANDBY;), write to tables in the logical standby database that are not being maintained by SQL Apply.
Step By Step process of Configuring Oracle 10gR2 (10.2.0.1) Dataguard on 32 bit RedHat Enterprise Linux 3 (RHEL3) / CentOS 3
By Bhavin Hingu
bhavin@oracledba.org
 
Unfortunately there are a number of '''unsupported objects''' (e.g. tables or sequences owned by SYS, tables that use table compression, tables that underlie a materialized view or Global temporary tables (GTTs)) and '''unsupported data types''' (i.e.: datatypes BFILE, ROWID, and UROWID, user-defined TYPEs, multimedia data types like Oracle Spatial, ORDDICOM, and Oracle Text Collections (e.g. nested tables, VARRAYs), SecureFile LOBs, OBJECT RELATIONAL XMLTypes and BINARY XML).<ref>
--------------------------------------------------------------------------------
{{cite web
| url = http://www.databasejournal.com/features/oracle/article.php/3860251/Leveraging-Logical-Standby-Databases-in-Oracle-11g-Data-Guard.htm
| title = Leveraging Logical Standby Databases in Oracle 11g Data Guard
| access-date = 2010-07-16
| last = Czuprynski
| first = Jim
|date=January 2010
}}</ref> Logical standby may not be appropriate in such a case.
 
=== Active Data Guard ===
<<HOME>>
The "Oracle Active Data Guard" option, an extra-cost facility,<ref name="Oracle Database Options">
{{cite web
| first = Diana
| last = Lorentz
| title = Oracle Database Options
| url = http://download.oracle.com/docs/cd/B28359_01/license.111/b28287/options.htm#sthref21
| work = Oracle Database Licensing Information 11g Release 1 (12c)
| publisher = Oracle Corporation
| date = January 2009
| access-date = 2009-04-22
| quote = If a physical standby database in a Data Guard configuration has any of the above features enabled, then the Active Data Guard option must be licensed for every such physical standby, and also for the primary database.
}}</ref> extends Oracle Data Guard functionality in Oracle 11g configurations. It allows read-only access on the Physical standby node at the same time as applying archived transactions from the primary node. Also it features Automatic Block Repair and Fast Incremental Backup on Physical Standby,<ref name="Oracle Active data Guard">
{{cite web
| title = Oracle Active data Guard
| url = http://www.oracle.com/database/active-data-guard.html
| work = Oracle Database
| publisher = Oracle Corporation
| date = January 2010
| access-date = 2009-04-22
| quote = Oracle Active Data Guard enables read-only access to a physical standby database for queries, sorting, reporting, web-based access, etc., while continuously applying changes received from the production database.
}}</ref>
 
== Operation ==
 
=== Server-side functionality ===
--------------------------------------------------------------------------------
This document explains the step by step process of Configuring 10g R2 Single Instance Dataguard for Single Instance Primary
on RedHat Enterprise Linux 32 bit (RHEL3) / CentOS 3.6.
 
'''LNS''' (log-write network-server) and '''ARCH''' (archiver) processes running on the primary database select archived [[redo log]]s and send them to the standby-database host,<ref>
Click HERE for Step By Step Process of Configuring RAC Standby Dataguard for RAC Primary ON Redhat Linux.
{{cite web
| url = http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10gR2_DataGuardNetworkBestPractices.pdf
| title = Data Guard Redo Transport & Network Best Practices: Oracle Database 10g Release 2
| access-date = 2009-03-11
| last = Smith
| first = Michael T
|date= February 2007
| format = PDF
| publisher = Oracle Corporation
| pages = 6, 14
| quote = ... sending processes (LNS and ARC) on the production database....The Data Guard LNS process on the production database performs a network send to the Data Guard RFS process on the standby database.
}}</ref> where the '''RFS''' (remote file server) background process within the Oracle instance performs the task of receiving archived redo logs originating from the primary database and writing them to a standby redo log (SRL).<ref>
{{cite book
|last1= Carpenter
|first1= Larry
|display-authors= etal
|title= Oracle Data Guard 11g Handbook
|url= https://books.google.com/books?id=FG8vM7gsSp8C
|series= Oracle Press
|publisher= McGraw Hill Professional
|publication-date= 2009
|page= 5
|isbn= 9780071621489
| access-date = 2015-02-17
| quote = Redo records transmitted by the LNS are received at the standby database by another Data Guard process called the ''Remote File Server (RFS)''. The RFS receives the redo at the standby database and writes it to a sequential file called a ''standby redo log file (SRL)''.
}}
</ref>
 
Alternatively, a supplementary mechanism may transfer the archived redo logs. On the standby database a Fetch Archive Log ('''FAL''') client monitors for gaps in the sequence of received logs. If it finds a gap, it may invoke one or more Fetch Archive Log (FAL) servers to run on the primary database to forward the missing item(s).<ref>
[http://www.oracle-base.com/articles/9i/DataGuard.php Oracle-Base site summary of Data Guard], retrieved 2007-09-05; [http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/toc.htm Oracle Corp version 11.1 documentation links], retrieved 2007-09-05.
</ref>
 
Once the archived redo logs have arrived on the standby host, other processes - such as an '''ARCH''' (archiver process), an '''MRP''' (Managed Recovery Process<ref>
{{cite book
| last = Ault
| first = Mike
| author-link = Mike Ault
| series = Oracle In-Focus Series
| others = Madhu Tumma
| title = Oracle 10g Grid & Real Application Clusters: Oracle 10g Grid Computing with RAC
| url = https://books.google.com/books?id=p-XwSIV9ZYIC
| access-date = 2012-08-31
| year = 2004
| publisher = Rampant TechPress
| isbn = 9780974435541
| page = 640
| quote = [...] the managed recovery process (MRP) on the standby database determines the correct order to apply the archive logs from the different threads on the Standby Database.
}}
</ref>), and/or an '''LSP''' (Logical Standby Process) - may set about applying the log contents to the standby database.
 
The use of '''standby redo logs''' can speed up the application of changes to a standby database<ref>
Task List:
{{cite book
|last1= Bach
|first1= Martin
|title= Expert Consolidation in Oracle Database 12c
|url= https://books.google.com/books?id=85cQAwAAQBAJ
|series= Expert's voice in Oracle
|publisher= Apress
|publication-date= 2013
|page= 320
|isbn= 9781430244295
|access-date= 2015-02-19
|quote= [...] with Oracle 10g, [u]sing standby redo logs on the standby database server, the redo stream arriving on the destination could be applied to the standby database immediately, without having to wait for the standby redo log to be archived and applied.
}}
</ref>
with real-time apply.<ref>
{{cite web
| url = http://docs.oracle.com/cd/B19306_01/server.102/b14239/concepts.htm#i1033747
| title = Oracle Data Guard Concepts and Administration, 10g Release 2 (10.2)
| last1 = Schupmann
| first1 = Vivian
| year = 2008
| publisher = Oracle
| access-date = 2015-02-20
| quote = Redo data can be applied either from archived redo log files, or, if real-time apply is enabled, directly from the standby redo log files as they are being filled, without requiring the redo data to be archived first at the standby database.
}}
</ref>
 
The Data Guard Connection process ('''DRCX''') plays a role in transferring data between databases.<ref>
10g R2 Dataguard Technical Architecture
{{cite web
| url = http://docs.oracle.com/cd/B19306_01/server.102/b14219/e12700.htm#ORA-16589
| title = Oracle Database Online Documentation, 10g Release 2 (10.2)
| year = 2015
| website = docs.oracle.com
| publisher = Oracle
| access-date = 2015-06-16
| quote = The Data Guard Connection process (DRCX) detected an error while transferring data from one database to another.
}}
</ref>
 
===Client-side access===
Primary DB init parameter
The Data Guard Broker subsystem can aid in the setup, management and monitoring of Data Guard configurations.<ref>
Standby DB init parameter
{{cite book
Enable Archiving On Primary DB
| last = Whalen
tnsnames.ora/listener.ora configuration
| first = Edward
Creating Standby Redo logs (SLRs)
| title = Oracle Database 10g Linux administration
Backup the Primary DB.
| url = https://books.google.com/books?id=2ImPFP6Yk64C
Creating the standby controlfile
| access-date = 2011-09-07
Startig and verifying Standby DB
| year = 2005
Testing Realtime Apply
| publisher = McGraw-Hill Professional
| isbn = 978-0-07-223053-6
| page = 329
| quote = The Data Guard Broker is the set of utilities and services that manage Data Guard. Included in the Data Guard Broker are both a GUI interface using Oracle Enterprise Manager and a command-line interface (CLI). The Data Guard Broker is used to set up Data Guard, to manage the configuration, and to monitor Data Guard.
}}</ref>
 
== Advantages ==
Data Guard provides [[high availability]] for a database system. It can also reduce the human intervention required to switch between [[databases]] at [[IT disaster recovery|disaster-recovery]] ("failover") or [[upgrade]]/[[Preventive maintenance|maintenance]] ("switchover") time.
 
Through the use of standby redo log files, Data Guard can minimize data loss.<ref>
--------------------------------------------------------------------------------
{{cite book
| last = Kumar
| first = Bipul
| title = Oracle Data Guard: Standby Database Failover Handbook
| series = Oracle In-Focus Series
| volume = 19
| year = 2005
| publisher = Rampant TechPress
| isbn = 9780974599380
| page = 277
| quote = With the introduction of [...] standby redo logs [...] it is possible to have a logical standby database be a part of a data Guard configuration running in maximum protection mode. In this way, the Data Guard SQL Apply method offers complete zero-data-loss support.
}}
</ref>
 
It supports heterogeneous configurations in which the primary and standby systems may have different CPU architectures, operating systems (for example, Microsoft Windows and Linux), operating-system binaries (32-bit/64-bit), or Oracle database binaries (32-bit/64-bit).<ref name="Data Guard Operational Prerequisites">
Technical Architecture of DataGuard
{{cite web
| title = Data Guard Operational Prerequisites
| url = http://docs.oracle.com/cd/E11882_01/server.112/e10700/standby.htm#i58150
| work = Data Guard Concepts and Administration
| publisher = Oracle Corporation
| access-date = 2013-08-26
| quote = As of Oracle Database 11g, Data Guard provides increased flexibility for Data Guard configurations in which the primary and standby systems may have different CPU architectures, operating systems (for example, Windows & Linux), operating system binaries (32-bit/64-bit), or Oracle database binaries (32-bit/64-bit).
}}</ref>
 
== Disadvantages ==
 
If the network link connecting primary and standby is over-subscribed, the redo logs are not shipped in chronological order, which can result in large gaps appearing in the available redo at the standby. Such a condition results in the standby being behind the primary.
Primary Database Name: primary
<ref name="Oracle Database Options"/> This can be overcome, using Oracle’ Active Data Guard Farsync technology.
Service Name: primary
Primary Node:
SID: primary
Network name (hostname): node1-prv
ORACLE_BASE: /u01/app/oracle
 
The same release of Oracle Database Enterprise Edition must be installed on the primary database and all standby databases, except during rolling database upgrades using logical standby databases.
Standby Database Name: stndby
Service Name: stndby
Standby Node:
SID: stndby
Network name (hostname): node2-prv
ORACLE_BASE: /u01/app/oracle
 
Oracle Data Guard is available only as a feature of Oracle Database Enterprise Edition.
Primary DB init parameter
 
== See also ==
 
[[Oracle RAC]]
primary.__db_cache_size=67108864
primary.__java_pool_size=4194304
primary.__large_pool_size=4194304
primary.__shared_pool_size=88080384
primary.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u01/app/oracle/admin/primary/adump'
*.background_dump_dest='/u01/app/oracle/admin/primary/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/PRIMARY/controlfile/o1_mf_26lg83r9_.ctl','/u01/app/oracle/flash_recovery_area/PRIMARY/controlfile/o1_mf_26lg844c_.ctl'
*.core_dump_dest='/u01/app/oracle/admin/primary/cdump'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='primary'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.db_unique_name='primary'
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primaryXDB)'
*.fal_client='primary'
*.fal_server='stndby'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(primary,stndby)'
*.log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/PRIMARY/arch
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=primary'
*.log_archive_dest_2='SERVICE=stndby LGWR ASYNC
VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=stndby'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.dbf'
primary.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=2
*.log_archive_min_succeed_dest=1
primary.log_archive_trace=0
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
primary.standby_archive_dest='/u01/app/oracle/oradata/PRIMARY/arch '
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/primary/udump'
*.local_listener=prim
 
 
 
Standby DB init parameter
 
 
stndby.__db_cache_size=75497472
stndby.__java_pool_size=4194304
stndby.__large_pool_size=4194304
stndby.__shared_pool_size=79691776
stndby.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='/u01/app/oracle/admin/stndby/adump'
*.background_dump_dest='/u01/app/oracle/admin/stndby/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/STNDBY/controlfile/stndby01.ctl','/u01/app/oracle/flash_recovery_area/STNDBY/controlfile/stndby02.ctl'
*.core_dump_dest='/u01/app/oracle/admin/stndby/cdump'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='primary'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.db_unique_name='stndby'
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=stndbyXDB)'
*.fal_client='stndby'
*.fal_server='primary'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(stndby,primary)'
*.log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/STNDBY/arch
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=stndby'
*.log_archive_dest_2='SERVICE=primary LGWR ASYNC
VALID_FOR=(ALL_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=primary'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.dbf'
*.log_archive_max_processes=2
*.log_archive_trace=0
*.db_file_name_convert= 'PRIMARY', 'STNDBY'
*.log_file_name_convert='PRIMARY', 'STNDBY'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_archive_dest='/u01/app/oracle/oradata/STNDBY/arch'
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/stndby/udump'
*.local_listener=stnd
 
 
Enabling Archiving on primary DB:
 
 
Ensure that the primary is in archive log mode
 
 
 
SQL>shutdown immediate
SQL>startup mount;
SQL>alter database archivelog;
SQL>alter database open;
 
 
 
tnsnames/listener.ora configuration:
 
 
 
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db10g/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
 
STNDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-prv)(PORT = 10521))
)
(CONNECT_DATA =
(SERVICE_NAME = STNDBY)
)
)
 
PRIM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-prv)(PORT = 10521)))
 
PRIMARY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-prv)(PORT = 10521))
)
(CONNECT_DATA =
(SERVICE_NAME = PRIMARY)
)
)
 
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
 
Copy the same file to the standby server and adjust it based on the listener.ora file. Also update the listener.ora file so that it listen the SIDs mentioned in the tnsnames.ora file.
 
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db10g/network/admin/listener.ora
# Generated by Oracle configuration tools.
 
SID_LIST_LISTENER_STBY =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db10g)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = stndby)
(GLOBAL_DBNAME = stndby_DGMGRL)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db10g)
)
)
 
LISTENER_STBY =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-prv)(PORT = 10521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
 
Standby Redo Logs (SLRs) Creation:
 
 
In case of OMF:
 
Get the max group# of online redo logs on PRIMARY database
 
SELECT max (group#) from v$logfile;
 
Create the standby redo logs on the primary database with the same size of that of online redo logs. If the above query retuns the value of 3 and each logfile is 50M in size (from the below query) then, create at least 4 standby redo logs of the size of 50M per thread.
 
SELECT byte from v$log;
 
Create the SRL's :
 
ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 SIZE 50M
/
ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 SIZE 50M
/
ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 SIZE 50M
/
ALTER DATABASE ADD STANDBY LOGFILE GROUP 7 SIZE 50M
/
 
Backup the primary DB:
 
 
Take a cold/Hot/RMAN backup of the primary database. I used the cold backup in this case.
 
SQL>SHUTDOWN IMMEDIATE
 
Backup the datafiles, online redologs and the standby logs if created and scp to the standby server in the corrosponding directory. I used the same directory structure as that with primary.
The only differece was the name of the direcory. For e.g,
 
On primary database, I have a path of /u01/app/oracle/oradata/PRIMARY/datafile whereas
On standby server, I have a path of
/u01/app/oracle/oradata/STNDBY/datafile,
 
This is the reason, I have used the db_file_name_convert parameter in the primary init.ora file with the value of
db_file_name_convert=’PRIMARY’,’STNDBY’
 
and in the standby init.ora file with the value of
 
db_file_name_convert=’STNDBY’, ‘PRIMARY’
 
Create the Standby Controlfile:
 
 
On Primary Database:
 
SQL>STARTUP MOUNT;
SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/stndby01.ctl';
SQL>ALTER DATABASE OPEN;
 
scp the stndby01.ctl file to the standby site. I have multiplexed it in the initstndby.ora file. So I SCPed the same file to both the locations mentioned in the initstndby.ora file.
Also, SCPed the $ORACLE_HOME/dbs/orapwprimary file of the primary to the same ___location on the standby with the name of orapwstndby.
 
 
Starting and Verifying the standby DB:
 
 
SQL>create spfile from pfile;
SQL>STARTUP MOUNT;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
 
Verify the Standby :
 
 
- Identify the existing files on the standby
 
SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME
FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
 
Switch a log on the primary database:
 
SQL>ALTER SYSTEM SWITCH LOGFILE;
 
- Re-Run the same SQL to make sure that the logs are received and applied to
the standby server.
 
Verify that these logs were applied :
 
SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG
ORDER BY SEQUENCE#;
 
Testing Realtime Apply:
 
 
On Primary Database : create a table 'test' and insert a record.
 
INSERT INTO test VALUES (sysdate);
COMMIT;
 
Do not make a log switch because I set up the LGWR ASYNC option so that
The redo should be transferred and applied to the standby server in real time.
 
On the STANDBY DB server:
 
SELECT PROCESS, STATUS,SEQUENCE#,BLOCK#,BLOCKS, DELAY_MINS FROM V$MANAGED_STANDBY;
 
ALTER DATABASER RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN READ ONLY;
 
SELECT * FROM test;
 
You should see the commited transaction.
 
Place the standby back in managed recover mode
 
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
 
This will take the standby directly from read only mode and place it in managed recovery mode.
 
=========================================================================================
 
 
 
Click HERE for Step By Step Process of Configuring RAC Standby Dataguard for RAC Primary ON Redhat Linux.
 
 
 
--------------------------------------------------------------------------------
 
<<HOME>>
 
 
--------------------------------------------------------------------------------
 
== Advantages ==
 
Data Guard provides [[high availability]] for a database system. It can also reduce the human intervention required to switch between [[databases]] at [[disaster recovery | disaster-recovery]] ("failover") or [[upgrade]]/[[maintenance]] ("switchover") time.
 
== References ==
 
{{Reflist|130em}}
 
[[Category:Database software stubs]]
[[Category:Oracle software]]
 
== External links==
 
* [http://www.club-oracle.com/forums/f5/data-guard-for-oracle-database11g-t36/ Oracle Data Guard Introduction]
 
[[de:Oracle Dataguard]]