Subject: Creating a 10g Data Guard Physical Standby on Linux Doc ID: Note:248382.

1 Type: REFERENCE Last Revision Date: 28-NOV-2007 Status: PUBLISHED
PURPOSE ------This document has been created with step-by-step instructions on how to create a Data Guard Physical Standby environment, derived from the 10G documentation. Although, this setup was tested with Linux, the procedure would be the same for any flavor of Unix.

Creating a Physical Data Guard scenario in 10G on Linux. ========================================================== 1. Primary host: stdg2 Standby host: stdg1 Platform: Linux Redhat AS 2.1 Kernel: 2.4.9-e.24 Primary Set up on host stdg2 ORACLE_SID=v10g Initialization parameters (PRIMARY) ========================== *. control_files='/u02/admin/v10g/datafiles/control01.ctl' *.log_archive_config='DG_CONFIG=(v10g_stdg2,v10g_stdg1)' *.log_archive_dest_1='LOCATION=/u02/admin/v10g/v10garch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) *.db_unique_name=v10g_stdg2' *.log_archive_dest_2='SERVICE=v10g_stdg1 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=v10g_stdg1 LGWR ASYNC REOPEN=10' *.log_archive_dest_state_1='enable' *.log_archive_dest_state_2='enable' *.db_unique_name='v10g_stdg2' *.FAL_CLIENT='v10g_stdg2' *.FAL_SERVER='v10g_stdg1' *.standby_archive_dest='/u02/admin/v10g/v10garch' *.standby_file_management='auto' *.remote_login_passwordfile='EXCLUSIVE'

2.

Place the primary datbase in ARCHIVELOG mode. SQL>SHUTDOWN IMMEDIATE SQL>STARTUP MOUNT SQL>ALTER DATABASE ARCHIVELOG; SQL>ALTER DATABASE OPEN; SQL>ARCHIVE LOG LIST;

3.

Creating the physical standby.

ALL_ROLES) *.FAL_CLIENT='v10g_stdg1' *.235)(PORT = 1521)) ) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/oracle/product/10g) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = v10g) (ORACLE_HOME = /u01/oracle/product/10g) (SID_NAME = v10g) ) ) TNSNAMES.ORA: .log_archive_dest_state_2='enable' *.ORA’ FROM SPFILE.Take a backup of the primary.Create a pfile for the standby database . Initialization parameter(STANDBY) ================================== *. .PRIMARY_ROLE) DB_UNIQUE_NAME=v10g_stdg2 LGWR ASYNC REOPEN=10' *.log_archive_config='DG_CONFIG=(v10g_stdg2.CTL’.log_archive_dest_1='LOCATION=/u02/admin/v10g/v10garch/ VALID_FOR=(ALL_LOGFILES.SQL>STARTUP MOUNT (Primary) .FAL_SERVER='v10g_stdg2' *.SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS ‘<PATH>/STDBY. (Cold backup was used) .1.v10g_stdg1)' *.log_archive_dest_state_1='enable' *.standby_file_management='auto' *.SQL>CREATE PFILE=’<PATH>/INITSTDBY.ORA LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 138.control_files='/u02/admin/v10g/datafiles/standby.. .137.standby_archive_dest='/u02/admin/v10g/v10garch' *.log_archive_dest_2='SERVICE=v10g_stdg2 VALID_FOR=(ONLINE_LOGFILES.db_unique_name=v10g_stdg1' *.remote_login_passwordfile='EXCLUSIVE' Set up the listeners (Net Services) Primary: LISTENER.SQL>ALTER DATABASE OPEN.db_unique_name='v10g_stdg1' *.ctl' *.

235)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = v10g) ) NOTE: For the standby make sure you change the ip (HOST) from . SEQUENCE# FIRST_TIM NEXT_TIME ---------.1.ora FROM PFILE=’INITSTDBY. Verify if the archived logs are applied successfully on the standby SQL>SELECT SEQUENCE#. 5. NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#.234 to .v10g_stdg1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 138.SQl>SELECT SEQUENCE#.--------. Create the spfile on the standby from the pfile moved from the primary. SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT.235 appropriately 4. FIRST_TIME. SEQUENCE# FIRST_TIM NEXT_TIME ---------.137. SQL>CREATE SPFILE=’?/DBS/spfile<sid>.APPLIED FROM . FIRST_TIME.137.1. NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#.--------. Check to see if the redo from the primary is being shipped to the standby On the primary do the following: . . SQL>STARTUP MOUNT.ORA’.234)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = v10g) ) ) v10g_stdg2 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 138.--------71 15-AUG-03 15-AUG-03 72 15-AUG-03 15-AUG-03 73 15-AUG-03 15-AUG-03 74 15-AUG-03 15-AUG-03 Physical Standby: SQL>SELECT SEQUENCE#.--------71 72 73 74 15-AUG-03 15-AUG-03 15-AUG-03 15-AUG-03 15-AUG-03 15-AUG-03 15-AUG-03 15-AUG-03 6.SQL>ALTER SYSTEM SWITCH LOGFILE.

(The details of SRL's is not discussed in this document) To create a standby logfile: Stop the redo apply on the standby Alter database recover managed standby database cancel. Create the SRL’s 3 of them on the standby. Restart the redo apply. SEQUENCE# APP ---------. NOTE: The ARCHIVER (ARCn) or the (LGWR) process on the primary can transmit redo data directly to standby logfile. - .V$ARCHIVED_LOG ORDER BY SEQUENCE#.--68 YES 69 YES 70 YES 71 YES 72 YES 73 YES 74 YES Standby Redo Logs (SRLs) ========================= This is similar to redo logs except that a standby log is used only when the database is in standby mode.log' size 10m. SQL>alter database add standby logfile '/u02/admin/v10g/srldest/srl_1.

Sign up to vote on this title
UsefulNot useful