DBA Tips Archive for Oracle

http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml

DBA Tips Archive for Oracle

Data Guard Configuration Example - (10g, Physical Standby)
by Jeff Hunter, Sr. Database Administrator

Contents
Introduction Introduction to Oracle Data Guard Hardware and O/S Configuration Configure the Primary Database Configure Oracle Net Components Configure the Standby Database Start Remote Archiving Verifying the Physical Standby Database Deletion Policy for Archived Redo Log Files In Flash Recovery Area Post-Creation Steps Activating a Physical Standby Database (Role Transition) Further Reading About the Author

Introduction
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. This article provides instructions for creating and configuring a physical standby database from a primary database using Oracle Database 10g Release 2 (10.2) operating in maximum performance protection mode. It should be noted that several different methods exist to create a physical standby database configuration and that this is just

1 of 29

13/02/2013 12:11 PM

DBA Tips Archive for Oracle

http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml

one of those ways. The methods outlined in this guide present a simple approach that should be easy to implement in most situations. In fact, if you break down the essential tasks required to build a physical standby database, you will see that it is essentially nothing more than taking a backup of the primary database, creating a standby controlfile, transferring the files to the standby host, mounting the standby database, putting the standby database in managed recovery mode (Redo Apply), and starting remote archiving from the primary database (Redo Transport). Obviously there are a number of smaller steps I am leaving out which will all be discussed in more depth throughout this guide. All configuration parameters related to the Oracle instance and networking will be discussed as well as how to place the standby database in Managed Recovery Mode.

Introduction to Oracle Data Guard
The standby database feature of Oracle was first introduced with the release of Oracle 7 in the early 1990's. The design was fairly simple. Oracle used media recovery to apply archive logs to a remote standby database, however, none of the automation we now take for granted was present in this release of the product. DBA's were required to write custom scripts that shipped and applied archive logs to the remote standby database. It wasn't until Oracle8i where some form of automation was introduced that relied on Oracle Net Services to transfer and apply archive redo logs. DBA's were still required to supply scripts that handled gap resolution and resynchronize the primary and standby database when they lost connectivity with one another. Also included in Oracle8i was a set of pre-written scripts that simplified the switchover and failover process. With the introduction of Oracle9i, the standby database feature was renamed to Oracle Data Guard. In addition to the re-branding of the product, Oracle delivered a comprehensive automated solution for disaster recovery that was fully integrated with the database kernel. Finally, a fully integrated disaster recovery solution without the need to maintain custom written scripts! Oracle9i also provided a vast array of new features which included automatic gap resolution, enhanced redo transport methods (synchronous and asynchronous redo transport), the ability to configure zero data loss, and the concept of protection modes. Until Oracle9i Release 2, the only standby database type available was the physical standby database. A physical standby database is an identical, block-for-block copy of the primary database and is kept in sync with the primary using media recovery (also referred to as Redo Apply). Oracle introduced a new type of standby database with Oracle9i Release 2 named Logical Standby Database. This new type of standby database keeps in sync with the primary database using SQL Apply (versus Redo Apply used with a physical standby database). A logical standby database remains open for user access while logical records are being received and applied from the primary database which makes this a great candidate for a reporting database. When the standby database site is hosted in a different geographical location than the primary site, it provides for an excellent High Availability (HA) solution. When creating a standby database configuration, the DBA should always attempt to keep the primary and standby database sites identical as well as keeping the physical location of the production database transparent to the end user. This allows for an easy role transition scenario for both planned and unplanned outages. When the secondary (standby) site is identical to the primary site, it allows predictable performance and response time after failing over (or switching over) from the primary site.

Oracle Database Enterprise Edition Requirement Oracle Data Guard is only available as a bundled feature included within its Enterprise Edition release of the Oracle Database software. It is not available with Oracle Database Standard Edition. With the exception of performing a rolling database upgrade using logical standby database, it is mandatory that the same release of Oracle Database Enterprise Edition be installed on the primary database and all standby databases! While it remains possible to simulate a standby database environment running Oracle Database Standard Edition, it requires the DBA to develop custom scripts that manually transfer archived redo log files and then manually applying them to the standby database. This is similar to the methods used to maintain a standby database with

2 of 29

13/02/2013 12:11 PM

Not only does a logical standby database contain the same logical information as the primary. I will be using the default protection mode of Maximum Performance. and disaster-recovery capabilities available with Data Guard. a logical standby database is not. the standby remains open for user access in read/write mode while still receiving and applying logical records from the primary. Standby Database Types There are two types of standby databases that can be created with Oracle Data Guard — physical or logical. An Oracle Database 10g Data Guard configuration will always run in one of three data protection modes: Maximum Protection Maximum Availability Maximum Performance Each of the three modes provide a high degree of data protection. availability and performance expectations of the primary database. Configuring Data Guard with guaranteed no data loss. A logical standby database is an excellent solution for a reporting database while at the same time retaining the attributes of a disaster recovery solution. however they differ with regards to data availability and performance of the primary database. Carefully take into account the need to protect the data against any loss vs. but at the same time have a different physical structure. A physical standby database is an identical. manageability. To keep the article simple. however. At the heart of this decision lies the answer to one important question — how much data loss is your organization willing to endure in the event of a failover? The obvious answer to expect from management is none. As redo gets generated on the primary database. Data Protection Modes After deciding between a physical or logical standby database. Because Oracle is applying SQL statements to the standby database and not performing media recovery (as is done with a physical standby database). it gets transferred to the standby database where an RFS process receives the primary redo and applies the change vectors directly to the standby database. Deciding which of the two types of standby databases to create is critical and depends on the nature of the business needs the organization is trying to satisfy.DBA Tips Archive for Oracle http://www. A physical standby database is an excellent choice for disaster recovery. An in-depth discussion on the three available data protection modes and how redo transport works to support them is beyond the scope of this guide.idevelopment. performance. 3 of 29 13/02/2013 12:11 PM .info/data/Oracle/DBA_tips/Data_Guard/DG_40. When selecting a protection mode. always consider the one that best meets the needs of your business. A logical standby database works in a different manner which keeps in sync with the primary by transforming redo data received from the primary database into logical SQL statements and then executes those SQL statements against the standby database. requires a significant investment in equipment and other resources necessary to provide support for this type of environment. While a physical standby database is an exact physical replica of the primary. it is possible for the logical standby database to contain the same logical data. it can also support the creation of additional objects to support improved reporting requirements. block-for-block copy of the primary database and is kept in sync with the primary using media recovery.shtml Oracle 7. The consequence with this type of configuration is that it does not provide the ease-of-use. With a logical standby database. the next major decision is which data protection mode should be used to operate the Data Guard configuration.

info modesto.info/data/Oracle/DBA_tips/Data_Guard/DG_40.primary_role) 4 of 29 13/02/2013 12:11 PM .168.idevelopment.(db_recovery_file_dest) Local Online Redo Log Files .2. see my article entitled 'Data Protection Modes'.shtml For a detailed discussion on the various Oracle Data Guard protection modes.1.(db_create_file_dest) Flash Recovery Area .info — (192. Hardware and O/S Configuration Let's take a look at the Oracle configuration and a summary of the parameters that will be used to create the physical standby database configuration described in this guide.info.(log_archive_dest_1) Remote Archive Destination . Primary Database Oracle Release Host Name Operating System Database Name (db_name) Database Domain (db_domain) Oracle SID Database Unique Name (db_unique_name) TNS Alias Service Names Database Files .5) modesto idevelopment.all_roles) service=turlock — (online_logfiles. modesto /u02/oradata /u03/flash_recovery_area location=use_db_recovery_file_dest — (all_logfiles.idevelopment.info modesto modesto modesto.(log_archive_dest_2) Oracle 10g Release 2 — (10.idevelopment.0.idevelopment.DBA Tips Archive for Oracle http://www.160) Red Hat Linux 5 — (CentOS 5.5) vmlinux1.

idevelopment.idevelopment. Enable Archivelog Mode Oracle Data Guard relies on redo from the primary database in order to maintain the standby.idevelopment.all_roles) service=modesto — (online_logfiles.1.info turlock turlock turlock.(db_create_file_dest) Flash Recovery Area . turlock /u02/oradata /u03/flash_recovery_area location=use_db_recovery_file_dest — (all_logfiles.5) modesto idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.0.info turlock.info — (192. Use the following to verify that the primary database is in archivelog mode: 5 of 29 13/02/2013 12:11 PM . As several of the steps included in this section involve bouncing the primary database.primary_role) It is assumed that Oracle Database 10g Release 2 and all patchsets have been installed on both nodes in the Oracle Data Guard configuration.2.shtml Physical Standby Database Oracle Release Host Name Operating System Database Name (db_name) Database Domain (db_domain) Oracle SID Database Unique Name (db_unique_name) TNS Alias Service Names Database Files . Configure the Primary Database The first phase in creating an Oracle Data Guard configuration involves performing the necessary tasks on the primary database. While several of the tasks outlined in this section are not mandatory.idevelopment.168.(log_archive_dest_2) Oracle 10g Release 2 — (10. 1.5) vmlinux2.DBA Tips Archive for Oracle http://www.(log_archive_dest_1) Remote Archive Destination .(db_recovery_file_dest) Local Online Redo Log Files . This requires the primary database be placed into archivelog mode.info. try to consolidate those steps in order to reduce the number of bounces.162) Red Hat Linux 5 — (CentOS 5. I will provide explanations to their benefits and how their application can result in a more stable disaster recovery solution. Click here for a guide on installing Oracle Database 10g R2 on the Red Hat Linux 5 platform.

idevelopment. Database dismounted.shtml SQL> archive log list Database log mode Automatic archival Archive destination Oldest online log sequence Current log sequence No Archive Mode Disabled USE_DB_RECOVERY_FILE_DEST 32 34 The output from the above command shows that the primary database is not in archivelog mode. SQL> startup mount ORACLE instance started. ORACLE instance shut down. Database altered.DBA Tips Archive for Oracle http://www. SQL> alter database archivelog. Database altered. SQL> archive log list Database log mode Automatic archival Archive destination Oldest online log sequence Next log sequence to archive Current log sequence Archive Mode Enabled USE_DB_RECOVERY_FILE_DEST 34 36 36 6 of 29 13/02/2013 12:11 PM . Total System Global Area 1241513984 bytes Fixed Size 1273420 bytes Variable Size 318767540 bytes Database Buffers 905969664 bytes Redo Buffers 15503360 bytes Database mounted.info/data/Oracle/DBA_tips/Data_Guard/DG_40. Perform the following steps to place the primary database into archivelog mode: SQL> shutdown immediate Database closed. SQL> alter database open.

info/data/Oracle/DBA_tips/Data_Guard/DG_40. Database opened. Enable Force Logging (optional) Any nologging operations performed on the primary database do not get fully logged within the redo stream.DBA Tips Archive for Oracle http://www. 2. System altered. one solution is to place the primary database into force logging mode. SQL> startup open ORACLE instance started.idevelopment. Since this parameter cannot be dynamically modified for the current running instance. this can result in data inconsistencies between the primary and standby along with a massive headache for the DBA to resolve. the change will have to be made to the spfile and bounced in order to take effect: SQL> alter system set remote_login_passwordfile=exclusive scope=spfile. it was also required to set the log_archive_start initialization parameter to TRUE in order to enable automatic archiving. In addition. create one using the following steps: [oracle@vmlinux1 ~]$ cd $ORACLE_HOME/dbs [oracle@vmlinux1 dbs]$ orapwd file=orapwmodesto password=MySysPassword After creating the password file.shtml Prior to Oracle Database 10g. Create a Password File As part of the new redo transport security and authentication features. SQL> shutdown immediate Database closed. As Oracle Data Guard relies on the redo stream to maintain the standby database. ORACLE instance shut down. Total System Global Area 1241513984 bytes Fixed Size 1273420 bytes Variable Size 318767540 bytes Database Buffers 905969664 bytes Redo Buffers 15503360 bytes Database mounted. This is no longer necessary as automatic archiving is enabled by default when the database is placed into archivelog mode with Oracle Database 10g or higher. the SYS password must be identical on every database in order for redo transport to function. it is now mandatory that each database in an Oracle Data Guard configuration utilize a password file. To prevent this from occurring. 3. set the remote_login_passwordfile initialization parameter to EXCLUSIVE in the spfile on the primary database. all nologging operations are permitted to run without 7 of 29 13/02/2013 12:11 PM . Database dismounted. If a password file does not exist for the primary database. In this mode.

the changes will be placed in the redo stream anyway. Regardless of the protection mode (even when using maximum performance).info/data/Oracle/DBA_tips/Data_Guard/DG_40. The recommended number of standby redo log log file groups can be calculated using the following formula: (# of online redo log file groups on primary + 1) * maximum # of threads The example database used in this guide is not configured for Oracle RAC and therefore only contains one thread.DBA Tips Archive for Oracle http://www. it is highly recommended to utilize standby redo logs as generally more data can be recovered during a failover than without them. mandate the use of standby redo logs. The primary database is configured with three online redo log file groups sized at 50MB each: SQL> select group#. Database altered. bytes. To place the primary database in forced logging mode.shtml error. members from v$log. To verify force logging is enabled for the database: SQL> select force_logging from v$database. In addition. Create Standby Redo Logs (optional) Certain data protection modes within Oracle Data Guard. Overlooking this on a production environment can result in the DBA spending considerable time during the implementation of a disaster recovery situation. it is recommended to have one more standby redo log file group than the number of online redo log file groups on the primary database.---------1 1 52428800 2 8 of 29 13/02/2013 12:11 PM . thread#. such as maximum availability and maximum protection. the standby redo log file groups must be the same size as the online redo log file groups. however. GROUP# THREAD# BYTES MEMBERS ---------.---------. I make it mandatory when designing an Oracle Data Guard configuration for my clients. FORCE_LOGGING -------------YES 4.---------.idevelopment. When creating the standby redo logs. connect as SYS and run the following: SQL> alter database force logging. Although this is considered an optional step.

shtml 2 3 1 1 52428800 52428800 2 2 The number of standby redo logs required for the physical standby database in this example is (3 + 1) * 1 = 4 at 50MB each.DBA Tips Archive for Oracle http://www. By creating the standby redo logs at this stage.log 9 of 29 13/02/2013 12:11 PM . Database altered. member.info/data/Oracle/DBA_tips/Data_Guard/DG_40. From the primary database. connect as SYS and run the following to create four standby redo log file groups: SQL> alter database add standby logfile thread 1 group 4 size 50m.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_4_6hvg3rnm_. Database altered.log /u02/oradata/MODESTO/onlinelog/o1_mf_3_6jjc8qrw_. SQL> alter database add standby logfile thread 1 group 5 size 50m.log /u02/oradata/MODESTO/onlinelog/o1_mf_4_6hvg3qk9_.log /u02/oradata/MODESTO/onlinelog/o1_mf_2_6jjc8mvj_. member from v$logfile order by group#.idevelopment. Database altered. Database altered. To verify the new standby redo log files: SQL> select group#.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_3_6jjc8ry2_. SQL> alter database add standby logfile thread 1 group 6 size 50m.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_1_6jjc8jxq_. type. GROUP# ---------1 1 2 2 3 3 4 4 TYPE ------ONLINE ONLINE ONLINE ONLINE ONLINE ONLINE STANDBY STANDBY MEMBER ----------------------------------------------------------------/u02/oradata/MODESTO/onlinelog/o1_mf_1_6jjc8hr8_. SQL> alter database add standby logfile thread 1 group 7 size 50m.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_2_6jjc8nvv_. it is assured that they will exist on both the primary and the newly created standby database. A best practice generally followed is to create the standby redo logs on both the primary and the standby database so as to make role transitions smoother.

etc.DBA Tips Archive for Oracle http://www. '/u03/flash_recovery_area/MODESTO/controlfile/o1_mf_6hc6styy_. it is important to consider future role transitions. The initialization parameters that control redo transport and redo apply should be configured so that the database will seamlessly operate in either role with no parameter modifications required.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_5_6hvg49gr_. mounted.log /u02/oradata/MODESTO/onlinelog/o1_mf_6_6hvg4m9j_. disks. When the primary and standby machines are identical (memory. and placed in managed recovery mode. Configure the Primary Database Initialization Parameters Most of the configuration options for Data Guard are implemented using initialization parameters for the Oracle instance.shtml 5 5 6 6 7 7 STANDBY STANDBY STANDBY STANDBY STANDBY STANDBY /u02/oradata/MODESTO/onlinelog/o1_mf_5_6hvg48f3_. CPU.log 5.log /u02/oradata/MODESTO/onlinelog/o1_mf_7_6hvg4w3d_. The parameters listed below should be placed in the initialization file for the primary database.ctl'.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_6_6hvg4nb4_. When the database is mounted on a primary controlfile.log /u03/flash_recovery_area/MODESTO/onlinelog/o1_mf_7_6hvg4xbl_. Also note that the db_file_name_convert and log_file_name_convert parameters are only required if the paths will be different between the primary and standby host. Notice that I will initially 'DEFER' log_archive_dest_state_2 until the standby database has been created.ctl' db_name='modesto' db_domain='idevelopment.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.5. the standby parameters are not read and are not put into effect. # ---[ Dump Destination Parameters ] --.# archive_lag_target=900 compatible='10.0' control_files='/u02/oradata/MODESTO/controlfile/o1_mf_6hc6stn9_.) the initialization file for both databases should be nearly identical.turlock)' log_archive_max_processes=4 remote_login_passwordfile='exclusive' 10 of 29 13/02/2013 12:11 PM . When configuring the initialization parameters on the primary database.info' db_create_file_dest='/u02/oradata' db_recovery_file_dest='/u03/flash_recovery_area' dispatchers='(PROTOCOL=TCP) (SERVICE=modestoXDB)' instance_name='modesto' log_archive_config='dg_config=(modesto.2.# audit_file_dest='/u01/app/oracle/admin/modesto/adump' background_dump_dest='/u01/app/oracle/admin/modesto/bdump' core_dump_dest='/u01/app/oracle/admin/modesto/cdump' user_dump_dest='/u01/app/oracle/admin/modesto/udump' # ---[ Role-independent Parameters ] --.0. so they will not affect the operation of the database while in the primary role.

primary_role) db_unique_name=turlock' log_archive_dest_state_1='enable' log_archive_dest_state_2='defer' service_names='modesto. Create a Backup of the Primary Database A physical standby database can be created using either a hot or cold backup of the primary as long as all of the necessary archivelogs are available to bring the standby database to a consistent state. Database dismounted.info/data/Oracle/DBA_tips/Data_Guard/DG_40.info valid_for=(online_logfiles. I will be performing an online (hot) backup of the primary database using RMAN. 6.'/MODESTO/' log_file_name_convert='/TURLOCK/'.'/MODESTO/' fal_server='modesto'. For the purpose of this guide.idevelopment.# db_file_name_convert='/TURLOCK/'.# db_unique_name='modesto' log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles. SQL> startup ORACLE instance started.DBA Tips Archive for Oracle http://www.all_roles) db_unique_name=modesto' log_archive_dest_2='service=turlock. I start by creating the staging directory on both the primary and standby hosts: 11 of 29 13/02/2013 12:11 PM .shtml # ---[ Primary Role Parameters ] --.'turlock' fal_client='modesto' standby_file_management='auto' Several of the initialization parameters listed above can not be dynamically modified and therefore will require the primary database to be bounced: SQL> shutdown immediate Database closed. namely /u04/oracle/dg_staging. ORACLE instance shut down. Total System Global Area 1241513984 bytes Fixed Size 1273420 bytes Variable Size 318767540 bytes Database Buffers 905969664 bytes Redo Buffers 15503360 bytes Database mounted. Database opened.info.idevelopment. modesto' # ---[ Standby Role Parameters ] --. The RMAN backupsets will be written to a staging directory located outside of the Flash Recovery Area.idevelopment.

__db_cache_size=905969664 turlock.__java_pool_size=16777216 12 of 29 13/02/2013 12:11 PM .# turlock. create a standby controlfile in the staging directory using RMAN: [oracle@vmlinux1 ~]$ rman target sys/MySysPassword@modesto RMAN> backup device type disk format '/u04/oracle/dg_staging/%U' current controlfile for standby. File created.shtml [oracle@vmlinux1 ~]$ mkdir -p /u04/oracle/dg_staging [oracle@vmlinux2 ~]$ mkdir -p /u04/oracle/dg_staging From the primary host. modify the necessary parameters in the new pfile to allow the database to operate in the standby role.ora' from spfile. Prepare an Initialization Parameter for the Standby Database Create an initialization parameter for the standby database using the primary as the source. perform an RMAN backup of the primary database that places the backupset into the staging directory: [oracle@vmlinux1 ~]$ rman target sys/MySysPassword@modesto RMAN> backup device type disk format '/u04/oracle/dg_staging/%U' database plus archivelog. The primary database in this example is using an spfile which will need to be copied to a pfile so it can be modified and used by the standby database. All modified parameters are indicated in red: # ---[ Memory Parameters ] --. When configuring the standby database later in this guide. create a pfile in the staging directory: SQL> create pfile='/u04/oracle/dg_staging/initturlock. Next. Create a Standby Controlfile Using the same process as above.idevelopment. 7.DBA Tips Archive for Oracle http://www.info/data/Oracle/DBA_tips/Data_Guard/DG_40. I will be converting the modified standby pfile back to an spfile. From the primary database. 8.

2.shtml turlock.'/TURLOCK/' log_file_name_convert='/MODESTO/'.all_roles) db_unique_name=turlock' log_archive_dest_2='service=modesto.ctl' db_name='modesto' db_domain='idevelopment.DBA Tips Archive for Oracle http://www. and standby initialization parameter file to the standby host (vmlinux2): 13 of 29 13/02/2013 12:11 PM .# archive_lag_target=900 compatible='10.idevelopment.idevelopment.__streams_pool_size=0 # ---[ Dump Destination Parameters ] --. transfer the backup of the primary database.info.0' control_files='/u02/oradata/TURLOCK/controlfile/o1_mf_6hc6stn9_.5.info valid_for=(online_logfiles. standby controlfile.ctl'.info/data/Oracle/DBA_tips/Data_Guard/DG_40. turlock' # ---[ Standby Role Parameters ] --.turlock)' log_archive_max_processes=4 remote_login_passwordfile='exclusive' # ---[ Primary Role Parameters ] --.__shared_pool_size=285212672 turlock. '/u03/flash_recovery_area/TURLOCK/controlfile/o1_mf_6hc6styy_.__large_pool_size=16777216 turlock.0.idevelopment.# db_file_name_convert='/MODESTO/'.'turlock' fal_client='turlock' standby_file_management='auto' 9. Transfer Files to the Standby Host Using an OS remote copy utility.info' db_create_file_dest='/u02/oradata' db_recovery_file_dest='/u03/flash_recovery_area' dispatchers='(PROTOCOL=TCP) (SERVICE=turlockXDB)' instance_name='turlock' log_archive_config='dg_config=(modesto.# audit_file_dest='/u01/app/oracle/admin/turlock/adump' background_dump_dest='/u01/app/oracle/admin/turlock/bdump' core_dump_dest='/u01/app/oracle/admin/turlock/cdump' user_dump_dest='/u01/app/oracle/admin/turlock/udump' # ---[ Role-independent Parameters ] --.primary_role) db_unique_name=modesto' log_archive_dest_state_1='enable' log_archive_dest_state_2='enable' service_names='turlock.# db_unique_name='turlock' log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles.'/TURLOCK/' fal_server='modesto'.

the following Oracle Net components need to be configured: An Oracle Net listener running on the primary host An Oracle Net listener running on the standby host An Oracle Net alias on the primary that points to the standby database An Oracle Net alias on the standby that points to the primary database Oracle Net Listener Although not mandatory.ora file for each database in the Data Guard configuration: Primary Host SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = MODESTO.ora 100% 1705 1. create a named static listener entry in the listener.7MB/s 00:01 initturlock.INFO) (SID_NAME = modesto) 14 of 29 13/02/2013 12:11 PM .2.0KB/s 00:00 0clv2spd_1_1 100% 664MB 9.DBA Tips Archive for Oracle http://www. From a high level.7KB/s 00:00 Configure Oracle Net Components Oracle Data Guard depends on Oracle Net as the transport mechanism to propagate changes made on the primary database to the standby.shtml [oracle@vmlinux1 ~]$ scp /u04/oracle/dg_staging/* vmlinux2:/u04/oracle/dg_staging/ 0blv2spa_1_1 100% 124KB 124.info/data/Oracle/DBA_tips/Data_Guard/DG_40.8MB/s 00:01 0elv2sqj_1_1 100% 3072 3. 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.IDEVELOPMENT.1MB/s 01:13 0dlv2sqg_1_1 100% 7936KB 7.0KB/s 00:00 0flv2ss4_1_1 100% 7904KB 7.idevelopment.

info/data/Oracle/DBA_tips/Data_Guard/DG_40.info)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) ) 15 of 29 13/02/2013 12:11 PM .0/db_1) ) ) INBOUND_CONNECT_TIMEOUT_LISTENER = 0 LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlinux1.idevelopment.2.2.2.idevelopment.0/db_1) ) ) INBOUND_CONNECT_TIMEOUT_LISTENER = 0 LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlinux2.idevelopment.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = TURLOCK.info)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ) ) Standby Host SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.shtml (ORACLE_HOME = /u01/app/oracle/product/10.INFO) (SID_NAME = turlock) (ORACLE_HOME = /u01/app/oracle/product/10.DBA Tips Archive for Oracle http://www.IDEVELOPMENT.

idevelopment. Service "PLSExtProc" has 1 instance(s)..info" has 1 instance(s).IDEVELOPMENT. Service "modesto_XPT. Service "modestoXDB.IDEVELOPMENT.idevelopment. Service "MODESTO.shtml Restart Oracle Net Listener Service After making changes to the listener.IDEVELOPMENT.ora.INFO = 16 of 29 13/02/2013 12:11 PM .idevelopment.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.idevelopment.info)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = modesto.info) ) ) TURLOCK.INFO" has 1 instance(s). restart the Oracle Net listener service on the primary and standby host: [oracle@vmlinux1 ~]$ lsnrctl reload [oracle@vmlinux2 ~]$ lsnrctl reload Verify Oracle Net Listener Services [oracle@vmlinux1 ~]$ lsnrctl services | grep '^Service' Services Summary.info" has 1 instance(s). Oracle Net Aliases The primary and standby host should contain an Oracle Net alias in the tnsnames.INFO" has 2 instance(s).IDEVELOPMENT.. [oracle@vmlinux2 ~]$ lsnrctl services | grep '^Service' Services Summary...ora file for all primary and standby net service names: MODESTO. Service "PLSExtProc" has 1 instance(s).INFO = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlinux1. Service "TURLOCK.DBA Tips Archive for Oracle http://www.

DEFAULT_DOMAIN = IDEVELOPMENT. convert the pfile to an spfile by entering the following command on the standby instance: [oracle@vmlinux2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10. In my Oracle network configuration. it is now mandatory that each database in an Oracle Data Guard configuration utilize a password file. Create the Standby Password File As part of the new redo transport security and authentication features. Create the password file on the standby database using the following steps: [oracle@vmlinux2 ~]$ cd $ORACLE_HOME/dbs [oracle@vmlinux2 dbs]$ orapwd file=orapwturlock password=MySysPassword 2.info)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = turlock.shtml (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = vmlinux2.idevelopment.0. mount.info/data/Oracle/DBA_tips/Data_Guard/DG_40.INFO.idevelopment.2. the default domain name is automatically appended to any unqualified net service name or alias: NAMES. 1. In addition.DBA Tips Archive for Oracle http://www. the SYS password must be identical on every database in order for redo transport to function. I defined the default domain in the sqlnet.INFO Configure the Standby Database This section contains the steps used to create.Production on Tue Dec 7 22:14:02 2010 17 of 29 13/02/2013 12:11 PM . Create an spfile for the Standby Instance Using the prepared standby initialization parameter file created and copied from the primary host. When this parameter is set.info) ) ) Note that each of the Oracle Net alias entries above contain the domain IDEVELOPMENT.ora file on every host which provides name resolution for Oracle Net clients. and start Redo Apply services for the physical standby database.5.0 .idevelopment.

shtml Copyright (c) 1982.idevelopment.1 oracle oinstall 1536 Dec -rw-r----. 2010.ora The above command assumes that the standby initialization parameter file copied from the primary host is located in the staging directory /u04/oracle /dg_staging. SQL> create spfile from pfile='/u04/oracle/dg_staging/initturlock. 3. SQL> !ls -l $ORACLE_HOME/dbs total 12 -rw-r----.ora'. Connected to an idle instance. File created. Create and Start the Standby Instance Start by creating the "dump directories" on the standby host as referenced in the standby initialization parameter file: [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 ~]$ ~]$ ~]$ ~]$ ~]$ ~]$ ~]$ mkdir mkdir mkdir mkdir mkdir mkdir mkdir -p -p -p -p -p -p -p /u01/app/oracle/admin/turlock/adump /u01/app/oracle/admin/turlock/bdump /u01/app/oracle/admin/turlock/cdump /u01/app/oracle/admin/turlock/dpdump /u01/app/oracle/admin/turlock/pfile /u01/app/oracle/admin/turlock/scripts /u01/app/oracle/admin/turlock/udump Next. All Rights Reserved. Oracle.1 oracle oinstall 4608 Dec 8 22:20 orapwturlock 8 22:20 spfileturlock.info/data/Oracle/DBA_tips/Data_Guard/DG_40.DBA Tips Archive for Oracle http://www. create and verify all directories on the standby host that will be used for database files and the Flash Recovery Area: [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/TURLOCK/controlfile [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/TURLOCK/datafile [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/TURLOCK/onlinelog [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 [oracle@vmlinux2 ~]$ ~]$ ~]$ ~]$ ~]$ mkdir mkdir mkdir mkdir mkdir -p -p -p -p -p /u03/flash_recovery_area/TURLOCK/archivelog /u03/flash_recovery_area/TURLOCK/autobackup /u03/flash_recovery_area/TURLOCK/backupset /u03/flash_recovery_area/TURLOCK/controlfile /u03/flash_recovery_area/TURLOCK/onlinelog 18 of 29 13/02/2013 12:11 PM .

connected to target database: MODESTO (DBID=2026707242) connected to auxiliary database: MODESTO (not mounted) RMAN> duplicate target database for standby. All rights reserved.0.Production on Tue Dec 7 22:51:22 2010 Copyright (c) 1982. Oracle.0.0 . $PATH. Oracle. SQL> startup nomount ORACLE instance started.idevelopment. Starting Duplicate Db at 08-DEC-2010 22:24:52 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 19 of 29 13/02/2013 12:11 PM . Total System Global Area 1241513984 bytes Fixed Size 1273420 bytes Variable Size 318767540 bytes Database Buffers 905969664 bytes Redo Buffers 15503360 bytes All Rights Reserved.shtml After verifying the appropriate environment variables are set on the standby host ($ORACLE_SID.2. Create the Physical Standby Database From the standby host where the standby instance was just started. 2007.5.5. Connected to an idle instance.2. $ORACLE_HOME. 4. $LD_LIBRARY_PATH). duplicate the primary database as a standby using RMAN: [oracle@vmlinux2 ~]$ rman target sys/MySysPassword@modesto auxiliary sys/MySysPassword@turlock Recovery Manager: Release 10.info/data/Oracle/DBA_tips/Data_Guard/DG_40. 2010.Production on Tue Dec 7 22:35:34 2010 Copyright (c) 1982. start the physical standby instance: [oracle@vmlinux2 ~]$ echo $ORACLE_SID turlock [oracle@vmlinux2 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.0 .DBA Tips Archive for Oracle http://www.

switch clone tempfile all. set newname for datafile 4 to "/u02/oradata/TURLOCK/datafile/o1_mf_example_6hc6vf79_. set newname for datafile 5 to "/u02/oradata/TURLOCK/datafile/o1_mf_users_6hc6vlf0_.dbf".dbf".dbf". } 20 of 29 13/02/2013 12:11 PM .shtml channel ORA_AUX_DISK_1: sid=156 devtype=DISK contents of Memory Script: { restore clone standby controlfile.DBA Tips Archive for Oracle http://www.idevelopment.dbf". set newname for datafile 1 to "/u02/oradata/TURLOCK/datafile/o1_mf_system_6hc6t6l0_.dbf".tmp".ctl Finished restore at 08-DEC-2010 22:24:54 sql statement: alter database mount standby database contents of Memory Script: { set newname for tempfile 1 to "/u02/oradata/TURLOCK/datafile/o1_mf_temp_6hc6v3jd_. set newname for datafile 3 to "/u02/oradata/TURLOCK/datafile/o1_mf_sysaux_6hc6tyvd_. restore check readonly clone database .info/data/Oracle/DBA_tips/Data_Guard/DG_40. sql clone 'alter database mount standby database'. set newname for datafile 2 to "/u02/oradata/TURLOCK/datafile/o1_mf_undotbs1_6hc6trl0_.ctl output filename=/u03/flash_recovery_area/TURLOCK/controlfile/o1_mf_6j0m068b_. } executing Memory Script Starting restore at 08-DEC-2010 22:24:53 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece /u04/oracle/dg_staging/0flv2ss4_1_1 channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/u04/oracle/dg_staging/0flv2ss4_1_1 tag=TAG20101208T220036 channel ORA_AUX_DISK_1: restore complete. elapsed time: 00:00:01 output filename=/u02/oradata/TURLOCK/controlfile/o1_mf_6j0m05vj_.

info/data/Oracle/DBA_tips/Data_Guard/DG_40.tmp in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 08-DEC-2010 22:25:01 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /u02/oradata/TURLOCK/datafile/o1_mf_system_6hc6t6l0_. } executing Memory Script datafile 1 switched input datafile copy datafile 2 switched input datafile copy datafile 3 switched input datafile copy to datafile copy recid=6 stamp=737245547 filename=/u02/oradata/TURLOCK/datafile/o1_mf_system_6j0m0gkf_.DBA Tips Archive for Oracle http://www. elapsed time: 00:00:45 Finished restore at 08-DEC-2010 22:25:47 contents of Memory Script: { switch clone datafile all.dbf to datafile copy recid=8 stamp=737245547 filename=/u02/oradata/TURLOCK/datafile/o1_mf_sysaux_6j0m0glf_.dbf restoring datafile 00003 to /u02/oradata/TURLOCK/datafile/o1_mf_sysaux_6hc6tyvd_.dbf restoring datafile 00004 to /u02/oradata/TURLOCK/datafile/o1_mf_example_6hc6vf79_.shtml executing Memory Script executing command: SET NEWNAME renamed temporary file 1 to /u02/oradata/TURLOCK/datafile/o1_mf_temp_6hc6v3jd_.dbf restoring datafile 00005 to /u02/oradata/TURLOCK/datafile/o1_mf_users_6hc6vlf0_.idevelopment.dbf channel ORA_AUX_DISK_1: reading from backup piece /u04/oracle/dg_staging/0clv2spd_1_1 channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/u04/oracle/dg_staging/0clv2spd_1_1 tag=TAG20101208T215908 channel ORA_AUX_DISK_1: restore complete.dbf 21 of 29 13/02/2013 12:11 PM .dbf restoring datafile 00002 to /u02/oradata/TURLOCK/datafile/o1_mf_undotbs1_6hc6trl0_.dbf to datafile copy recid=7 stamp=737245547 filename=/u02/oradata/TURLOCK/datafile/o1_mf_undotbs1_6j0m0gmf_.

idevelopment. clone the standby controlfile. Start Remote Archiving With the standby database now in managed recovery mode. Database altered. Start Redo Apply on the Standby Database Now that the standby is in place. To use Real Time Apply. This instructs the standby database to begin applying changes from archived redo logs transferred from the primary database: SQL> alter database recover managed standby database disconnect.info/data/Oracle/DBA_tips/Data_Guard/DG_40. The RMAN duplicate process above will read the backupset that was transferred to the staging directory. and placed in managed recovery 22 of 29 13/02/2013 12:11 PM . the next and final phase is to start shipping redo data to the standby from the primary. I mentioned that it is good practice to initially set the log_archive_dest_state_2 initialization parameter to DEFER on the primary until the standby database was created. run the following alternate version of the alter database command to place the standby database in managed recovery mode: SQL> alter database recover managed standby database using current logfile disconnect.dbf Finished Duplicate Db at 08-DEC-2010 22:25:48 RMAN> exit Recovery Manager complete.shtml datafile 4 switched to datafile copy input datafile copy recid=9 stamp=737245547 filename=/u02/oradata/TURLOCK/datafile/o1_mf_example_6j0m0gnn_. Database altered. Earlier within this guide in the section "Configure the Primary Database Initialization Parameters". 5.DBA Tips Archive for Oracle http://www. mount the database on the new standby controlfile. mounted. start Redo Apply on the standby database by putting it in managed recovery mode. and restore the physical database files.dbf datafile 5 switched to datafile copy input datafile copy recid=10 stamp=737245547 filename=/u02/oradata/TURLOCK/datafile/o1_mf_users_6j0m0gol_.

the validation tasks will involve switching redo log files from the primary and verifying those log files are being shipped and applied to the physical standby database. At this point. use the following statement on the primary database: SQL> alter system archive log current. Given this Data Guard configuration is running in maximum performance mode. This will ensure that Redo Transport on the primary and Redo Apply on the physical standby are working correctly. the next step is to verify the Data Guard configuration. System altered. the standby database will continue to apply changes from archive redo logs being transferred from the primary. From the primary database.idevelopment. enable SQL Transport Services by issuing the following statement: SQL> alter system set log_archive_dest_state_2=enable scope=both. This is the destination defined that will transfer redo data to the standby database. a log switch occurs when an online redo log becomes full which means the standby database does not get updated until then. SQL> select status. Verifying the Physical Standby Database With the standby and primary databases now in operation. Redo Transport From the primary database.shtml mode. By default. To force the current redo logs to be archived immediately. With the protection mode used in this guide (maximum performance).info/data/Oracle/DBA_tips/Data_Guard/DG_40.DBA Tips Archive for Oracle http://www. error from v$archive_dest where dest_id = 2. System altered. 23 of 29 13/02/2013 12:11 PM . archiving of redo data to the remote standby does not occur until after a log switch. perform a log switch and then verify the transmissions of the archive redo log file was successful: SQL> alter system switch logfile. System altered.

info/data/Oracle/DBA_tips/Data_Guard/DG_40. Redo Apply To verify Redo Apply. first_time. archived. Session altered.idevelopment.DBA Tips Archive for Oracle http://www. applied from v$archived_log order by sequence#. the status of the destination will be VALID as shown above.shtml STATUS ERROR --------. If for any reason the transmission was unsuccessful. and then check the standby database again. SEQUENCE# ---------320 321 322 323 324 325 326 327 328 FIRST_TIME -------------------10-DEC-2010 08:34:06 10-DEC-2010 08:49:39 10-DEC-2010 09:05:15 10-DEC-2010 09:20:48 10-DEC-2010 09:36:20 10-DEC-2010 09:51:52 10-DEC-2010 10:07:27 10-DEC-2010 10:14:23 10-DEC-2010 10:14:49 NEXT_TIME -------------------10-DEC-2010 08:49:39 10-DEC-2010 09:05:15 10-DEC-2010 09:20:48 10-DEC-2010 09:36:20 10-DEC-2010 09:51:52 10-DEC-2010 10:07:27 10-DEC-2010 10:14:23 10-DEC-2010 10:14:49 10-DEC-2010 10:30:23 ARCHIVED -------YES YES YES YES YES YES YES YES YES APPLIED ------YES YES YES YES YES YES YES YES YES From the primary database. identify the existing archived redo logs on the standby.--------------------------------------------------------VALID If the transmission was successful. First. the status will be INVALID and the full text of the error message will be populated in the ERROR column which can be used to investigate and correct the issue. archived. and applied to the standby. next_time. archive the current log using the following SQL statement: 24 of 29 13/02/2013 12:11 PM . This test will ensure that redo data was shipped from the primary and then successfully received. SQL> select sequence#. archive a log or two from the primary. identify the existing archived redo redo logs on the standby database: [oracle@vmlinux2 ~]$ sqlplus sys/MySysPassword@turlock as sysdba SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS'.

log RFS[2]: Successfully opened standby log 5: '/u02/oradata/TURLOCK/onlinelog/o1_mf_5_6j0ml7nw_. received. archived.arc Media Recovery Log /u03/flash_recovery_area/TURLOCK/archivelog/2010_12_10/o1_mf_1_327_6j4jzcbm_.info/data/Oracle/DBA_tips/Data_Guard/DG_40.DBA Tips Archive for Oracle http://www. and applied: SQL> select sequence#.log' 25 of 29 13/02/2013 12:11 PM .shtml SQL> alter system archive log current. I also like to tail the alert.log of the Standby Database Querying the V$ARCHIVED_LOG view from the standby database is a good way to ensure Redo Transport and Redo Apply is doing their job correctly. perform a tail -f against the alert. System altered. archived.log' Fri Dec 10 10:14:51 EST 2010 Media Recovery Log /u03/flash_recovery_area/TURLOCK/archivelog/2010_12_10/o1_mf_1_326_6j4jzbpc_. SEQUENCE# ---------320 321 322 323 324 325 326 327 328 329 FIRST_TIME -------------------10-DEC-2010 08:34:06 10-DEC-2010 08:49:39 10-DEC-2010 09:05:15 10-DEC-2010 09:20:48 10-DEC-2010 09:36:20 10-DEC-2010 09:51:52 10-DEC-2010 10:07:27 10-DEC-2010 10:14:23 10-DEC-2010 10:14:49 10-DEC-2010 10:30:23 NEXT_TIME -------------------10-DEC-2010 08:49:39 10-DEC-2010 09:05:15 10-DEC-2010 09:20:48 10-DEC-2010 09:36:20 10-DEC-2010 09:51:52 10-DEC-2010 10:07:27 10-DEC-2010 10:14:23 10-DEC-2010 10:14:49 10-DEC-2010 10:30:23 10-DEC-2010 10:39:56 ARCHIVED -------YES YES YES YES YES YES YES YES YES YES APPLIED ------YES YES YES YES YES YES YES YES YES YES Monitoring the alert. In addition. first_time. applied from v$archived_log order by sequence#. Go back to the standby database and re-query the V$ARCHIVED_LOG view to verify redo data was shipped. From the standby database.log while issuing the "alter system archive log current" statement from the primary: [oracle@vmlinux2 ~]$ cd /u01/app/oracle/admin/turlock/bdump [oracle@vmlinux2 bdump]$ tail -f alert_turlock.idevelopment.arc Media Recovery Waiting for thread 1 sequence 328 Fri Dec 10 10:30:24 EST 2010 RFS[1]: Successfully opened standby log 4: '/u02/oradata/TURLOCK/onlinelog/o1_mf_4_6j0mkynk_. next_time.log file of the standby database as a double check.

The primary database A standby database that has one or more mandatory cascading standby databases. Archived redo log files in the flash recovery area that were applied on all mandatory cascading standby databases. 26 of 29 13/02/2013 12:11 PM .log' Fri Dec 10 10:39:58 EST 2010 Media Recovery Log /u03/flash_recovery_area/TURLOCK/archivelog/2010_12_10/o1_mf_1_329_6j4lgfsr_. archived redo log files in a flash recovery area that were backed up to a tertiary device or made obsolete (as defined by the RMAN retention policy) are eligible for deletion.arc Media Recovery Waiting for thread 1 sequence 330 Deletion Policy for Archived Redo Log Files In Flash Recovery Area By default.info/data/Oracle/DBA_tips/Data_Guard/DG_40. APPLIED ON STANDBY Clause When the APPLIED ON STANDBY clause is configured on . Using the APPLIED ON STANDBY Clause Use the APPLIED ON STANDBY clause so that archived redo log files that have been applied on all mandatory standby destinations will be deleted.. Archived redo log files in the flash recovery area that were applied on the standby database. Then. these files are eligible for deletion .arc Media Recovery Waiting for thread 1 sequence 329 Fri Dec 10 10:39:57 EST 2010 RFS[2]: Successfully opened standby log 4: '/u02/oradata/TURLOCK/onlinelog/o1_mf_4_6j0mkynk_. A standby database that has no cascading standby databases. The archived redo log files that are backed up or obsolete can eventually be deleted automatically to make space if the disk space in the flash recovery area becomes full. However.DBA Tips Archive for Oracle http://www.. This section describes the command qualifiers and provides examples for setting up a deletion policy for archived redo log files which are already applied on standby database in Oracle Database 10g and above.. CONFIGURE ARCHIVELOG DELETION POLICY TO [CLEAR | NONE | APPLIED ON STANDBY]. you can change this default deletion policy on either the primary or standby database using the following RMAN command. The actions taken when you specify this clause are described in the following table.idevelopment.. Archived redo log files in the flash recovery area that were applied on all mandatory standby databases.shtml Fri Dec 10 10:30:26 EST 2010 Media Recovery Log /u03/flash_recovery_area/TURLOCK/archivelog/2010_12_10/o1_mf_1_328_6j4kwjb5_.

Archived redo log files that are backed up or obsolete are deleted to make space if the disk space in the flash recovery area becomes full. the APPLIED ON STANDBY setting can be configured on both the primary and standby database. 2. Using the NONE Clause Use the NONE clause so that archived redo logs in flash recovery area that were backed up or obsolete as per the RMAN retention policy are eligible for deletion. When backups of archived redo log files are taken on the standby database: 1. Issue the following command on the primary database: CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY. When backups of archived redo log files are taken on the primary database: 1. 2. Issue the following command on the standby database: 27 of 29 13/02/2013 12:11 PM . Issue the following command on the standby database: CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY. Issue the following command on the primary database: CONFIGURE ARCHIVELOG DELETION POLICY TO NONE.shtml Using the CLEAR Clause Use the CLEAR clause to disable the deletion policy that was previously set up with the RMAN CONFIGURE ARCHIVELOG DELETION POLICY command. The Oracle database will resume the default deletion policy behavior. For example. the APPLIED ON STANDBY setting should not be set on the database that is performing and maintaining RMAN backups for the purpose of recovery.DBA Tips Archive for Oracle http://www.idevelopment. This is the default configuration.info/data/Oracle/DBA_tips/Data_Guard/DG_40. Using the CONFIGURE ARCHIVELOG DELETION POLICY Command As described in the above table. In most cases. which is to delete archived redo log files that are backed up or obsolete to make space if disk space in the flash recovery area becomes full.

Further Reading Additional information on Oracle 10g Release 2 Data Guard can be found in the Data Guard Concepts and Administration. Enable Flashback Database Flashback Database removes the need to re-create the primary database after a failover. the standby database. You can enable Flashback Database on the primary database. this is referred to as a role transition. Java Development Certified Professional. See "Setting the Data Protection Mode of a Data Guard Configuration" for information about the data protection modes and how to upgrade or downgrade the current protection mode.shtml CONFIGURE ARCHIVELOG DELETION POLICY TO NONE. There are two types of role transitions supported in Oracle 10g Data Guard: switchover and failover. because it does not require restoring datafiles from backup nor the extensive application of redo data. About the Author Jeffrey Hunter is an Oracle Certified Professional. or both. the physical standby database is running and can provide the maximum performance level of data protection (the default). His work includes advanced performance tuning. See "Using Flashback Database After a Failover" and "Using Flashback Database After Issuing an Open Resetlogs Statement" for scenarios showing how to use Flashback Database in a Data Guard environment. Knowing the difference between the two role transition methods is crucial. see Oracle Database Backup and Recovery Advanced User's Guide for more information about Flashback Database. The following list describes additional preparations you can take on the physical standby database: Upgrade the data protection mode The Data Guard configuration is initially set up in the maximum performance mode (the default). This guide is available from the Oracle Documentation Library website located at the following address http://download. Post-Creation Steps At this point. Whenever the role is changed between the primary and standby. Java and PL/SQL programming. Activating a Physical Standby Database (Role Transition) A database can operate in one of two mutually exclusive modes in an Oracle Data Guard configuration: primary or standby.102/b14239. Pennsylvania. Click here for a guide on how to perform role transitions and activating a physical standby database. Jeff currently works as a Senior Database Administrator for The DBA Zone.idevelopment. located in Pittsburgh. Flashback Database enables you to return a database to its state at a time in the recent past much faster than traditional point-in-time recovery. developing 28 of 29 13/02/2013 12:11 PM . Author.DBA Tips Archive for Oracle http://www. Role transition plays an important part in Data Guard by providing an interface that allows DBA's to activate a standby database to take over as the primary production database or vice versa.oracle. Also.info/data/Oracle/DBA_tips/Data_Guard/DG_40. and an Oracle ACE.com/docs/cd/B19306_01/server.pdf. Inc.

Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.DBA Tips Archive for Oracle http://www.info. written permission. Hunter and is protected under copyright laws of the United States. All articles. and of course Linux. capacity planning.idevelopment. Hunter. Database Administrator and Software Engineer for over 18 years and maintains his own website site at: http://www. This document may not be hosted on any other site without my express. Jeff graduated from Stanislaus State University in Turlock. prior. and physical / logical database design in a UNIX. Jeff's other interests include mathematical encryption theory. He has been a Sr.info is the copyright of Jeffrey M. I will in no case be liable for any monetary damages arising from such loss. LDAP. but I disclaim any and all responsibility for any loss.info/data/Oracle/DBA_tips/Data_Guard/DG_40.info.iDevelopment. Linux. I have made every effort and taken great care in making sure that the material included on my web site is technically accurate.shtml high availability solutions. Last modified on Thursday. All rights reserved. California. database security. 26-Jan-2012 16:33:48 EST Page Count: 23629 29 of 29 13/02/2013 12:11 PM . programming language processors (compilers and interpreters) in Java and C. and Windows server environment. with a Bachelor's degree in Computer Science. damage or destruction. writing web-based database administration tools.idevelopment. Copyright (c) 1998-2013 Jeffrey M. damage or destruction of data or any other property which may arise from relying on it. scripts and material located at the Internet address of http://www.

Sign up to vote on this title
UsefulNot useful