Professional Documents
Culture Documents
Overview
This document explains how to setup Standby Database and apply logs.
Prerequisite :
1. Install Oracle 10g software on Standby Server;
2. On Primary Server Archiving log should be ON. use below command to check archiving is enable
Enviroment:
db version: 10.2.0.1.0 (standard edition One)
Primary database Name: orcl location: D:\Oracle\product\10.2.0\db_1 ipaddress:
10.8.18.56
Physical standby database Name: orcl location: D:\Oracle\product\10.2.0\db_1 ipaddress:
10.8.18.57
Step 1: Create a Folders on Primary and Standby Servers for Create files on specific folders.
Primary Machine:
C:\> D:\Oracle\product\10.2.0\flash_recovery_area\
Standby Machine
C:\> D:\Oracle\product\10.2.0\flash_recovery_area\ANKUR\ARCHIVELOG
C:\> D:\Oracle\product\10.2.0\admin\ANKUR\adump
C:\> D:\Oracle\product\10.2.0\admin\ANKUR\udump
C:\> D:\Oracle\product\10.2.0\admin\ANKUR\bdump
C:\> D:\Oracle\product\10.2.0\admin\ANKUR\cdump
C:\> D:\Oracle\product\10.2.0\oradata\ANKUR
This file will become on location C:\rman_backup\ANKUR_backup\ with named orapworcl as below
Step 3: Create a listener and make the tns entries for both Servers
Example : Below are the example of tns entries of both Servers (Primary and Standby)
Primary Entries:
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.18.56)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
orclq =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.18.57)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(UR=A)
)
)
Standby Entries:
orcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.18.56)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
orclq =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.18.57)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(UR=A)
)
)
Note : You Can Ping The Tns Entries Of Both Machine Like
C:\> tnsping orcl
C:\> tnsping orclq
Note: Open the pfile and remove the some entries, which is in bold and italic font. Below are the exapmle.
*.audit_file_dest='C:\oracle\product\10.2.0\admin\orcl\adump'
*.background_dump_dest='C:\Oracle\product\10.2.0\admin\orcl\bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\CONTROL01.CTL','C:\ORACLE\
PRODUCT\10.2.0\ORADATA\ORCL\CONTROL02.CTL','C:\ORACLE\PRODUCT\10.2.0\
ORADATA\ORCL\CONTROL03.CTL'#Restore Controlfile
*.db_block_size=8192
*.DB_FILE_NAME_CONVERT='D:\Oracle\product\10.2.0\oradata\orcl','C:\oracle\product\10.2.0\
oradata\orcl'
*.db_name='orcl'
*.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area\orcl'
*.db_recovery_file_dest_size=2G
*.log_archive_dest_1='LOCATION=C:\Oracle\product\10.2.0\flash_recovery_area\ORCL\
ARCHIVELOG'
*.log_archive_format='ARC%S_%R.%T'
*.LOG_FILE_NAME_CONVERT='D:\Oracle\product\10.2.0\oradata\orcl','C:\oracle\product\10.2.0\
oradata\orcl'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0/admin/orcl/udump'
Note : --If binaries of machine are on different location or different location of logfile and datafile of
standby database then for convert the location use DB_FILE_NAME_CONVERT and
LOG_FILE_NAME_CONVERT parameter.
Step 5: On Primary Server Connect to rman to taking complete backup with archivelog,
Rman>exit
Steop 6: Copy Folders from Primary to Standby Machine:
Copy all files from ANKUR_backup folder (Primary Machine) to ANKUR_backup folder (Standby Machine).
Where we recently take the backup and make the orapw and pfile files.
Note: if not able to shutdown then delete it like oradim –delete –sid orcl and then if not able to create new then
use below command
C:\> oradim -new -sid orcl –syspwd password -startmode auto -srvcstart system -spfile -shutmode
immediate
Step 11: On Primary Server Connect to rman with auxiliary database to create duplicate target database
Sql>startup
Step 13: On Primary Server Connect to rman and take the complete backup
Rman>exit
Step 14: On Primary Server Connect through SQL and alter switch logfile.
Sql> /
Step 15: On Primary Server Connect to rman and backup the archievlog files
Rman>exit
Step 16: On Standby Server Edit the pfile
*.db_recovery_file_dest_size=2147483648
*.db_recovery_file_dest=' D:\Oracle\product\10.2.0\flash_recovery_area\orcl\ARCHIVELOG/'
*.log_archive_dest_1='LOCATION= D:\Oracle\product\10.2.0\flash_recovery_area\orcl\ARCHIVELOG’
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='orcl_%t_%s_%r.arc'
Step 19: On Primary Server Connect to rman with auxiliary database to create duplicate target database.
Rman> run{
Set until sequence 170;
Duplicate target database for standby dorecover nofilenamecheck;
}
Step 20: On Standby Server Connect through sql and recover standby database through archivelog files.
Note: It will show the required logfile number for apply updates:
Step 21: On Primary Server Connect through SQL and alter the system switchlog file:
For testing purpose create tables on Primary Server by apply log and it will automatically create tables on
Standby server
Sql> /
Sql> /
Step 23: On Standby Server Connect through SQL and recover standby database
Note: It will show the required logfile number for apply updates:
Sql> select sequence#, name from v$archived_name;