DBA Tips Archive for Oracle |
Data Guard Archived Redo Log Repository
by Jeff Hunter, Sr. Database Administrator
Introduced in Oracle9i Release 1, a Data Guard archived redo log repository is a type of destination that allows off-site archiving of redo data. This remote location is also sometimes referred to as an archival standby database. An archived redo log repository is created by using a physical standby control file, starting the instance, and mounting the database. This database contains no datafiles and cannot be used for switchover or failover in a Data Guard configuration. The primary database is configured to send its archived redo data to the Oracle instance at the remote location which is only responsible for accepting and storing the archived redo log files.
An archived redo log repository is an efficient mechanism for transporting and storing archive logs at an alternate location; remote or local. This can be accomplished by configuring the repository destination for archiver-based transport (using the ARCH attribute on the LOG_ARCHIVE_DEST_n parameter) or asynchronous based transport (using the ASYNC attribute on the LOG_ARCHIVE_DEST_n parameter) in a Data Guard configuration running in maximum performance mode.
The purpose of this guide is to provide the steps necessary to create a Data Guard archived redo log repository.
Remote archive repository for physical database backups.
An archived redo log repository can be used as a method for backing up the archived redo logs directly to a separate disk location or separate site from the primary.
An additional remote destination for maximum availability or maximum protection Data Guard configurations.
An archived redo log repository can be used as an added level of protection in addition to the standby(s).
Rolling database upgrade scenarios using Data Guard to meet the Recovery Point Objective (RPO) if the primary site fails during the upgrade of the logical site.
During a rolling upgrade using SQL Apply or a Transient Logical Standby, there is a point where the current standby database is not receiving redo from the primary site because the upgraded primary cannot send redo to the lower version standby. During those times it is recommended to use an archived redo log repository.
Temporary storage location for archived redo logs at a disaster recovery (DR) site in Oracle Database 10g while a physical standby is open read-write for testing or other purposes.
In Oracle Database 10g, when a standby database is opened in read-write mode, it cannot receive or apply redo. This is not the cause in Oracle Database 11g with the introduction of Snapshot Standby Database. An Oracle Database 11g snapshot standby database receives and archives, but does not apply redo data from a primary database. Prior to Oracle Database 11g, to reduce the RPO impact during the time the standby is opened read-write, an archived redo log repository can be used.
Same Oracle software version as the primary site.
Compatible platform per Metalink note 413484.1.
Disk space for:
Oracle Software
standby controlfile
archived redo logs
standby redo logs (optional but recommended)
Approximately 100 MB of memory for the SGA.
This section describes the Oracle database environment and parameters used in this guide to create archived redo log repository.
| Oracle Release | Oracle 10g Release 2 (10.2.0.5) |
| Host Name | vmlinux1.idevelopment.info (192.168.1.160) |
| Operating System | Red Hat Linux 5 (CentOS 5.5) |
| Database Configuration | Single Instance, non-ASM, Oracle Managed Files (OMF), Flash Recovery Area (FRA), SPFILE |
| Database Name (db_name) | modesto |
| Database Domain (db_domain) | idevelopment.info |
| Oracle SID | modesto |
| Database Unique Name (db_unique_name) | modesto |
| TNS Alias | modesto.idevelopment.info |
| Service Names | modesto.idevelopment.info, modesto |
| Database Files - (db_create_file_dest) | /u02/oradata |
| Flash Recovery Area - (db_recovery_file_dest) | /u03/flash_recovery_area |
| Local Online Redo Log Files - (log_archive_dest_1) | location=use_db_recovery_file_dest (all_logfiles,all_roles) |
| Remote Archive Destination - (log_archive_dest_2) | service=turlock (online_logfiles,primary_role) |
| Oracle Release | Oracle 10g Release 2 (10.2.0.5) |
| Host Name | vmlinux4.idevelopment.info (192.168.1.166) |
| Operating System | Red Hat Linux 5 (CentOS 5.5) |
| Database Configuration | Single Instance, non-ASM, Oracle Managed Files (OMF), Flash Recovery Area (FRA), SPFILE |
| Database Name (db_name) | modesto |
| Database Domain (db_domain) | idevelopment.info |
| Oracle SID | alrepos |
| Database Unique Name (db_unique_name) | alrepos |
| TNS Alias | alrepos.idevelopment.info |
| Service Names | alrepos.idevelopment.info, alrepos |
| Standby Control File - (control_files) | /u03/flash_recovery_area/ALREPOS/controlfile/control01.ctl |
| Archived Redo Log Repository Location - (Flash Recovery Area) | /u03/flash_recovery_area/ALREPOS/archivelog |
If you are using Oracle ASM then you will need to move or copy the archive logs to another location with RMAN or the DBMS_FILE_TRANSFER utility. If the archived redo log repository is on the same node as the standby that will use the logs then you can just register the logs as described in the Avoid Redo Retransmission section of this guide that describes how to avoid redo retransmission by registering the archived redo log repository logs to be used by the standby.
Using Oracle RAC for the archived redo log repository will give added protection to the repository but since most uses of an archived redo log repository are temporary, the added protection of RAC for the archived redo log repository is not usually necessary.
If the archived redo log repository will reside on the same node as the standby and you are not using OMF nor ASM, then you should use the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT database parameters to avoid any conflicts.
The first step is to create a standby controlfile from the primary database.
|
Next, transfer the controlfile from the primary database server to the remote server.
|
Now, create an Oracle instance on the remote server that will be used as the archived redo log repository.
As part of the new redo transport security and authentication features, it is now mandatory that each database in an Oracle Data Guard configuration utilize a password file. In addition, the SYS password must be identical on every database in order for redo transport to function. Create the password file on the standby database using the following steps:
|
Note that an archived redo log repository requires a minimally sized SGA and therefore any SGA related database parameters can be significantly reduced. The specific parameters used in this guide make use of Automatic Shared Memory Management (sga_target). An SGA of 100MB should be a sufficient size.
$ORACLE_HOME/dbs/initalrepos.ora
|
Create an SPFILE and backup the PFILE.
|
Oracle Data Guard depends on Oracle Net as the transport mechanism to propagate changes made on the primary database to the archive log repository site. The Oracle Net aliases must be configured on both the primary and standby host in order to facilitate Data Guard's communication requirements. From a high level, 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 site that points to the archive log repository site
An Oracle Net alias on the archive log repository site that points to the primary site
The primary and standby host should contain an Oracle Net alias in the tnsnames.ora file for the primary and archive log repository service names:
|
Note that each of the Oracle Net alias entries above contain the domain IDEVELOPMENT.INFO. In my Oracle network configuration, I defined the default domain in the sqlnet.ora file on every host which provides name resolution for Oracle Net clients. When this parameter is set, the default domain name is automatically appended to any unqualified net service name or alias:
|
Start by creating the "dump directories" on the archive log repository site.
|
Next, create and verify all directories on the archive log repository site that will be used for the Flash Recovery Area:
|
Copy the standby controlfile that was created on the primary site to the directory that will be used by the archived redo log repository Oracle instance (control_files).
|
With the standby control file in place start up the instance and mount it.
|
Verify the new instance is registered with the local listener.
|
Certain data protection modes within Oracle Data Guard, such as maximum availability and maximum protection, mandate the use of standby redo logs. Regardless of the protection mode (even when using maximum performance), it is highly recommended to utilize standby redo logs as generally more data can be recovered during a failover than without them.
From the archive log repository site, connect as SYS and run the following to create four standby redo log file groups:
|
To verify the new standby redo log files:
|
The last step is to configure the initialization parameters on the primary database to starting archiving its redo data to the new archived redo log repository.
Set the following initialization parameters on the primary database.
|
Perform a log switch on the primary database.
|
Check the alert.log file on both sites.
Note that the archived redo log repository cannot use FAL; only Automatic Gap Detection will work. So if there are any gaps that cannot be resolved automatically you have to resolve those manually.
Avoid redo retransmission and register the archived redo log repository logs to be used by the standby.
If the archived redo log repository is used temporarily while a standby on the same host (or with access to the same shared storage) is down or unable to receive redo as in the SQL Apply Rolling upgrade case, then register the archive log repository logs with the standby when it is ready to come back up and apply the logs.
On the standby find the starting SCN for recovery.
|
On the archive log repository, use a script to generate the register log commands for the standby.
|
Register the archived redo logs on the standby now using the generated script.
|
Recover the standby with the registered logs.
|
Stop the archived redo log repository transfers now on the primary.
|
Resume transmission to the standby.
|
Ensure you have a script setup in cron to purge out obsolete archived redo log files after a certain number of days from the archived redo log repository according to your retention policy.
purge_archived_redo_logs.ksh
|
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX, Linux, and Windows server environment. Jeff's other interests include mathematical encryption theory, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 18 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science.
Copyright (c) 1998-2012 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
Last modified on
Friday, 18-May-2012 09:17:18 EDT
Page Count: 2260