This document explains the step by step process of Configuring 10g R2 Single Instance Data guard for Single

Instance Primary on RedHat Enterprise Linux 32 bit (RHEL3) / Cantos 3.6.

Click HERE for Step By Step Process of Configuring RAC Standby Data guard for RAC Primary ON Redhat Linux.

Task List:
10g R2 Data guard Technical Architecture Primary DB init parameter Standby DB init parameter Enable Archiving On Primary DB tnsnames.ora/listener.ora configuration Creating Standby Redo logs (SLRs) Backup the Primary DB. Creating the standby control file Startig and verifying Standby DB Testing Realtime Apply

Technical Architecture of DataGuard
Primary Database Name: primary Service Name: primary Primary Node: SID: primary Network name (hostname): node1-prv ORACLE_BASE: /u01/app/oracle Standby Database Name: stndby Service Name: stndby Standby Node: SID: stndby Network name (hostname): node2-prv ORACLE_BASE: /u01/app/oracle

Primary DB init parameter
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'

db_domain='' *.ctl' *.1.db_unique_name='primary' *.__java_pool_size=4194304 stndby.local_listener=prim Standby DB init parameter stndby.processes=150 *.log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/PRIMARY/arch VALID_FOR=(ALL_LOGFILES.dbf' primary.__shared_pool_size=79691776 stndby.log_archive_trace=0 *.fal_client='primary' *.compatible='10.log_archive_format='%t_%s_%r.*.dg_broker_start=TRUE *.log_archive_max_processes=2 *.stndby)' *.db_create_file_dest='/u01/app/oracle/oradata' *.2.0' .log_archive_dest_state_1='ENABLE' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=primary)' *.db_block_size=8192 *.ctl'.__db_cache_size=75497472 stndby.user_dump_dest='/u01/app/oracle/admin/primary/udump' *.pga_aggregate_target=16777216 *.remote_login_passwordfile='EXCLUSIVE' *.log_archive_dest_state_2='ENABLE' *.db_name='primary' *.core_dump_dest='/u01/app/oracle/admin/primary/cdump' *.undo_management='AUTO' *.log_archive_dest_2='SERVICE=stndby LGWR ASYNC VALID_FOR=(ALL_LOGFILES.'/u01/app/oracle/flash_recovery_area/PRIMARY/controlfile/o1_ mf_26lg844c_.standby_archive_dest='/u01/app/oracle/oradata/PRIMARY/arch ' *.dbf' *.db_file_multiblock_read_count=16 *.audit_file_dest='/u01/app/oracle/admin/stndby/adump' *.open_cursors=300 *.background_dump_dest='/u01/app/oracle/admin/stndby/bdump' *.PRIMARY_ROLE) DB_UNIQUE_NAME=stndby' *.log_archive_min_succeed_dest=1 primary.archive_lag_target=0 *.fal_server='stndby' *.undo_tablespace='UNDOTBS1' *.ALL_ROLES) DB_UNIQUE_NAME=primary' *.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' *.control_files='/u01/app/oracle/oradata/PRIMARY/controlfile/o1_mf_26lg 83r9_.sga_target=167772160 primary.log_archive_config='DG_CONFIG=(primary.standby_file_management='AUTO' *.__streams_pool_size=0 *.job_queue_processes=10 *.log_archive_format='%t_%s_%r.0.__large_pool_size=4194304 stndby.

ctl' *.db_file_name_convert= 'PRIMARY'.primary)' *.db_unique_name='stndby' *.*.db_file_multiblock_read_count=16 *.log_archive_dest_1='LOCATION=/u01/app/oracle/oradata/STNDBY/arch VALID_FOR=(ALL_LOGFILES.sga_target=167772160 *.log_archive_config='DG_CONFIG=(stndby.ora configuration: .undo_management='AUTO' *.control_files='/u01/app/oracle/oradata/STNDBY/controlfile/stndby01.log_archive_dest_state_1='ENABLE' *.log_archive_dest_state_2='ENABLE' *. 'STNDBY' *. tnsnames/listener.'/u01/app/oracle/flash_recovery_area/STNDBY/controlfile/stndby02.open_cursors=300 *.local_listener=stnd Enabling Archiving on primary DB: Ensure that the primary is in archive log mode SQL>shutdown immediate SQL>startup mount.job_queue_processes=10 *.dg_broker_start=TRUE *.core_dump_dest='/u01/app/oracle/admin/stndby/cdump' *.standby_file_management='AUTO' *.fal_client='stndby' *.db_create_file_dest='/u01/app/oracle/oradata' *.log_archive_trace=0 *.ALL_ROLES) DB_UNIQUE_NAME=stndby' *.db_recovery_file_dest_size=2147483648 *.PRIMARY_ROLE) DB_UNIQUE_NAME=primary' *.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' *.pga_aggregate_target=16777216 *.user_dump_dest='/u01/app/oracle/admin/stndby/udump' *.log_archive_dest_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ALL_LOGFILES.fal_server='primary' *.processes=150 *.undo_tablespace='UNDOTBS1' *.dispatchers='(PROTOCOL=TCP) (SERVICE=stndbyXDB)' *. SQL>alter database open.ct l'.log_archive_format='%t_%s_%r. 'STNDBY' *.log_file_name_convert='PRIMARY'.db_block_size=8192 *.dbf' *.standby_archive_dest='/u01/app/oracle/oradata/STNDBY/arch' *.db_domain='' *.remote_login_passwordfile='EXCLUSIVE' *.db_name='primary' *. SQL>alter database archive log.log_archive_max_processes=2 *.

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. SID_LIST_LISTENER_STBY = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/app/oracle/product/10.0/db10g) (PROGRAM = extproc) ) .ora # Generated by Oracle configuration tools.2.2. # Listener. Also update the listener.# Tnsnames.ora file.ora file so that it listen the SIDs mentioned in the tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.ora # Generated by Oracle configuration tools.ora Network Configuration File: /u01/app/oracle/product/10.0/db10g/network/admin/listener.2.0/db10g/network/admin/tnsnames.

SELECT byte from v$log. create atleast 4standby redo logs of the size of 50M per thread.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.) (SID_DESC = (SID_NAME = stndby) (GLOBAL_DBNAME = stndby_DGMGRL) (ORACLE_HOME = /u01/app/oracle/product/10. Create the SRL's : ALTER / ALTER / ALTER / ALTER / DATABASE ADD STANDBY LOGFILE GROUP 4 SIZE 50M DATABASE ADD STANDBY LOGFILE GROUP 5 SIZE 50M DATABASE ADD STANDBY LOGFILE GROUP 6 SIZE 50M DATABASE ADD STANDBY LOGFILE GROUP 7 SIZE 50M Backup the primary DB: Take a cold/Hot/RMAN backup of the primary database.2. SQL>SHUTDOWN IMMEDIATE Backup the datafiles. Create the standby redo logs on the primary database with the same size of that of online redo logs. online redologs and the standby logs if created and scp to the standby server in the corresponding directory. I used the same . If the above query retuns the value of 3 and each log file is 50M in size (from the below query) then. I used the cold backup in this case.

This is the reason.’STNDBY’ and in the standby init.. ‘PRIMARY’ Create the Standby Controlfile: On Primary Database: SQL>STARTUP MOUNT. NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#. I have a path of /u01/app/oracle/oradata/PRIMARY/datafile whereas On standby server.directory structure as that with primary. SQL>ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/stndby01. I have a path of /u01/app/oracle/oradata/STNDBY/datafile. SCPed the $ORACLE_HOME/dbs/orapwprimary file of the primary to the same location on the standby with the name of orapwstndby.ora file with the value of db_file_name_convert=’PRIMARY’. SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT.ctl'. So I SCPed the same file to both the locations mentioned in the initstndby. Starting and Verifying the standby DB: SQL>create spfile from pfile.ctl file to the standby site. On primary database. For e. Switch a log on the primary database: SQL>ALTER SYSTEM SWITCH LOGFILE. FIRST_TIME.ora file with the value of db_file_name_convert=’STNDBY’. .ora file. The only differences was the name of the directory. SQL>ALTER DATABASE OPEN. Verify the Standby: Identify the existing files on the standby SQL> SELECT SEQUENCE#. I have multiplexed it in the initstndby.g. Also.ora file. SQL>STARTUP MOUNT. scp the stndby01. I have used the db_file_name_convert parameter in the primary init.

BLOCK#. ============================================================= ============================ Click HERE for Step By Step Process of Configuring RAC Standby Data guard for RAC Primary ON Red hat Linux. Testing Realtime Apply: On Primary Database: create a table 'test' and insert a record. ALTER DATABASE OPEN READ ONLY. Verify that these logs were applied: SELECT SEQUENCE#. APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#. Place the standby back in managed recover mode ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL.Re-Run the same SQL to make sure that the logs are received and applied to the standby server. You should see the commited transaction. COMMIT. INSERT INTO test VALUES (sysdate). STATUS.BLOCKS. This will take the standby directly from read only mode and place it in managed recovery mode.SEQUENCE#.. . SELECT * FROM test. DELAY_MINS FROM V$MANAGED_STANDBY. 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.

<<HOME>> .

Sign up to vote on this title
UsefulNot useful