Professional Documents
Culture Documents
Data Gaurd 10 Gsheet
Data Gaurd 10 Gsheet
Data Gaurd 10 Gsheet
1. INTRODUCTION TO ORACLE DATA GUARD 3 1.1 DATA GUARD CONFIGURATIONS ...........................3 1.2 DATA GUARD SERVICES ........................................3 1.3 DATA GUARD BROKER ..........................................3 1.4 DATA GUARD PROTECTION MODES ......................3 1.5 DATA GUARD AND COMPLEMENTARY TECHNOLOGIES 1.6 SUMMARY OF DATA GUARD BENEFITS .................3 2. GETTING STARTED WITH DATA GUARD ......3 2.1 STANDBY DATABASE TYPES .................................3 2.3 DATA GUARD OPERATIONAL PREREQUISITES .......4 2.4 STANDBY DATABASE DIRECTORY STRUCTURE CONSIDERATIONS 4 2.5 ONLINE REDO LOGS, ARCHIVED REDO LOGS, AND STANDBY REDO LOGS 4 3. CREATING A PHYSICAL STANDBY DATABASE 4 3
3.1 PREPARING THE PRIMARY DATABASE FOR STANDBY DATABASE CREATION 4 3.2 CREATING A PHYSICAL STANDBY DATABASE .......5 3.3 FURTHER PREPARATIONS ......................................7 4. CREATING A LOGICAL STANDBY DATABASE 7 7
4.1 PREPARING FOR LOGICAL STANDBY DATABASE CREATION 4.2 CREATING A LOGICAL STANDBY DATABASE ........8 4.3 FURTHER PREPARATIONS ....................................10
Usage Terms Anyone is authorized to copy this document to any means of storage and present it in any format to any individual or organization for non-commercial purpose free. No individual or organization may use this document for commercial purpose without a written permission from the editor. There is no warranty of any type for the code or information presented in this document. The editor is not responsible for any loses or damage resulted from using the information or executing the code in this document. If any one wishes to correct a statement or a typing error or add a new piece of information, please send the request to info@ahmedbaraka.com . If the modification is acceptable, it will be added to the document, the version of the document will be incremented and the modifier name will be listed in the version history list.
Version History
Version Date Updates
1.0
Sept, 2006
Initial document.
Document Purpose This document is edited to be a quick hand book reference on using Oracle Data Guard in Oracle 10g Database. It is simply a summary of the Oracle documentation.
Resources
Resource Name
Oracle Data Guard Concepts and Administration 10g Release 2 (10.2) Part Number B14239-01
2.3 Data Guard Operational Prerequisites 2.3.1 Hardware and Operating System Requirements
The operating system and platform architecture on the primary and standby locations must be the same. The hardware (for example, the number of CPUs, memory size, storage configuration) can be different between the primary and standby systems.
2.5 Online Redo Logs, Archived Redo Logs, and Standby Redo Logs
Redo data transmitted from the primary database is received by the remote file server (RFS) process on the standby system where the RFS process writes the redo data to archived log files or standby redo log files.
3.2 Creating a Physical Standby Database 3.2.1 Create a Backup Copy of the Primary Database Datafiles
You can use any backup copy of the primary database to create the physical standby database, as long as you have the necessary archived redo log files to completely recover the database.
Initialization Parameters for a Physical Standby Database DB_NAME=chicago DB_UNIQUE_NAME=boston SERVICE_NAMES=boston LOG_ARCHIVE_CONFIG='DG_CONFIG=(chicago,boston)' CONTROL_FILES='/arch1/boston/control1.ctl', '/arch2/boston/control2.ctl' DB_FILE_NAME_CONVERT= '/arch1/chicago/','/arch1/boston/','/arch2/chicago/','/arch2/boston/' LOG_FILE_NAME_CONVERT= '/arch1/chicago/','/arch1/boston/','/arch2/chicago/','/arch2/boston/' LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc LOG_ARCHIVE_DEST_1= 'LOCATION=/arch1/boston/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=boston' # this parameter does not take effect # when the db is on standby mode LOG_ARCHIVE_DEST_2= 'SERVICE=chicago VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chicago' LOG_ARCHIVE_DEST_STATE_1=ENABLE LOG_ARCHIVE_DEST_STATE_2=ENABLE REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE STANDBY_FILE_MANAGEMENT=AUTO # used when the primary and standby # databases reside on the same system. INSTANCE_NAME=boston # Oracle Net service name of the FAL server FAL_SERVER=chicago FAL_CLIENT=boston If you specify the LGWR process to transmit redo data to both the local and remote destinations, also include the NET_TIMEOUT attribute on the LOG_ARCHIVE_DEST_2 initialization parameter. Ensure the COMPATIBLE initialization parameter is set to the same value on both the primary and standby databases.
3.2.4 Copy Files from the Primary System to the Standby System
Copy the following files to the standby system: o Backup datafiles created in Section 3.2.1 o Standby control file created in Section 3.2.2 o Initialization parameter file created in Section 3.2.3
ALTER TABLESPACE TEMP1 ADD TEMPFILE '/arch1/boston/temp01.dbf' SIZE 40M REUSE; Start Redo Apply: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; Test archival operations to the physical standby database: ALTER SYSTEM SWITCH LOGFILE; -- on primary db
user-defined types:
CREATE MATERIALIZED VIEW LOG CREATE SPFILE FROM PFILE DROP DATABASE LINK DROP MATERIALIZED VIEW DROP MATERIALIZED VIEW LOG EXPLAIN LOCK TABLE SET CONSTRAINTS SET ROLE SET TRANSACTION DBMS_JOB Support Specific support for DBMS_JOB has been provided. Job execution is suspended on a logical standby database and jobs cannot be scheduled directly on the standby database. However, jobs submitted on the primary database are replicated in the standby database. In the event of a switchover or failover, jobs scheduled on the original primary database will automatically begin running on the new primary database.
4.1.2 Ensure Table Rows in the Primary Database Can Be Uniquely Identified
The following query displays a list of tables that SQL Apply might not be able to uniquely identify: SELECT OWNER, TABLE_NAME,BAD_COLUMN FROM DBA_LOGSTDBY_NOT_UNIQUE WHERE TABLE_NAME NOT IN (SELECT TABLE_NAME FROM DBA_LOGSTDBY_UNSUPPORTED); Note: Some of the tables displayed in the DBA_LOGSTDBY_NOT_UNIQUE view can still be supported because supplemental logging adds information that uniquely identifies the row containing the redo data. If your application ensures the rows in a table are unique, you can create a disabled primary key RELY constraint on the table. ALTER TABLE mytab ADD PRIMARY KEY (id, name) RELY DISABLE; Note: if data in constraint columns are not unique, Redo Apply will fail. Note: To improve the performance of SQL Apply, add an index to the columns that uniquely identify the row on the logical standby database.
4.2 Creating a Logical Standby Database 4.2.1 Create a Physical Standby Database
You create a logical standby database by first creating a physical standby database and then transitioning it into a logical standby database.
UNDO_RETENTION=3600
ALTER TABLESPACE TEMP1 ADD TEMPFILE '/arch1/boston/temp01.dbf' SIZE 40M REUSE; start SQL Apply ALTER DATABASE START LOGICAL STANDBY APPLY; verify the logical standby database is performing: go to section 4.2.5 configure Standby Redo Log Files: go to section 5.6.2
10