Data Gard
Data Gard
Data Gard
Hi,
I got many mails to post some steps for implementing the Standby Database in a real
time environment.This exercise I have completed few years back but didnt posted in
Blog.For implementing the Standby Database using RMAN follow
The below steps:
Summary of Steps:
Step 1: Backup the database that includes backup of datafiles, archivelogs and
controlfile for standby
Step 2: Move the backups to the standby server
Step 3: Make proper changes in the parameter files of both primary and standby
database
Step 4: Do the restore and recover on standby database
Step 5: Put the standby database in recover managed mode
Step 1: Backup the database that includes backup of datafiles, archivelogs and
controlfile for standby
C:\>rman target /
RMAN> run
2> {
3> allocate channel c1 type disk format \\node1.in.Test.com\TESTDB_Backup\%d_DATA_
%U_%T';
4> allocate channel c2 type disk format '\\node1.in.Test.com\TESTDB_Backup\%d_DATA_
%U_%T';
5> allocate channel c3 type disk format '\\node1.in.Test.com\TESTDB_Backup\%d_DATA_
%U_%T';
6> backup database plus archivelog;
7> }
allocated channel: c2
channel c2: sid=596 instance=TESTDB1 devtype =DISK
allocated channel: c3
channel c3: sid=619 instance=TESTDB1 devtype =DISK
Starting backup at 04-FEB-09
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=2 sequence=2855 recid=7974 stamp=677037473
input archive log thread=2 sequence=2856 recid=7978 stamp=677070799
.
.
.
.
RMAN>
RMAN> run
2> {
3> allocate channel c1 type disk format '\\node1.in.Test.com\TESTDB_Backup\%d_CTRL_
%U_%T';
4> backup current controlfile for standby;
5> }
allocated channel: c1
channel c1: sid=615 instance=TESTDB1 devtyTEST=DISK
RMAN> exit
Step 3: Make proper changes in the parameter files of both primary and standby
database
Add the below parameter in primary database parameter file :
log_archive_dest_2='SERVICE=STANDBY'
db_name = TESTDB
instance_name = TESTcluster
db_files = 1024
db_file_multiblock_read_count = 8
db_block_size = 8192
control_files = F:\ORADATA\TESTDB\STDCONTROL.CTL
sga_max_size = 1288490188
sga_target = 1073741824
log_checkpoint_interval = 10000
log_checkpoint_timeout = 1800
processes = 250
parallel_max_servers = 5
log_archive_format = ARC%S_%R.%T
global_names = true
undo_management = AUTO
undo_tablespace = UNDOTBS1
thread = 1
db_block_size = 8192
remote_login_passwordfile = exclusive
compatible = 10.2.0.3
sort_area_size = 66560
open_cursors = 300
audit_file_dest = C:\oracle10g\product\10.2.0\db_1\admin\TESTDB\ADUMP
background_dump_dest = C:\oracle10g\product\10.2.0\db_1\admin\TESTDB\BDUMP
user_dump_dest = C:\oracle10g\product\10.2.0\db_1\admin\TESTDB\UDUMP
core_dump_dest = C:\oracle10g\product\10.2.0\db_1\admin\TESTDB\CDUMP
LOG_ARCHIVE_DEST_1 = 'LOCATION=F:\oradata\TESTDB\arch'
DB_FILE_NAME_CONVERT = ('H:\ORADATA\TESTDB','F:\ORADATA\TESTDB')
LOG_FILE_NAME_CONVERT = ('I:\ORADATA\TESTDB','F:\oradata\TESTDB',
'J:\ORADATA\TESTDB','F:\oradata\TESTDB')
DB_UNIQUE_NAME = TESTDB
STANDBY_FILE_MANAGEMENT = AUTO
STANDBY_ARCHIVE_DEST ='F:\oradata\TESTDB\arch'
C:\WINDOWS\system32>set ORACLE_SID=TESTCLUSTER
C:\WINDOWS\system32>rman target sys
RMAN>
RMAN> restore standby controlfile from
'\\node1\TESTDB_Backup\TESTDB_CTRL_D4K6HOIR_1_1_20090204';
Check the backed up archivelogs and recover standby database till that SCN
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/05/2009 11:00:30
RMAN-20506: no backup of archivelog found
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 4872 lowscn 220387955 found to restore
RMAN> exit
Note : No need to worry about the errors, you can safely ignore and move to step 7
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OTESTN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'F:\ORADATA\TESTDB\SYSTEM01.DBF'
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Here is your Standby Database ready use it when ever you want to switch the role
whenever there is a requirement to do some critical changes in primary or
production make your standby as primary and to implement the fast start fail over
where something happens to primary than standby will
Automatically become primary.
In my upcoming posts,I will explain few scenarios on failover and switchover cases
and useful information for working with Dataguard and Standby Databases.
Hope it helps.