Physical Standby Database:
I) Create Standby Database using DUPLICATE DATABASE :
At Primary database (JDB):
1) Enable force logging (Priamry and Standby)
2) Create password file and Add connect string to tnsnames.ora/listener.ora file (Priamry and Standby)
3) Create standby redo logs (Priamry and Standby)
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 SIZE 200M;
4) Modify Primary pfile or spfile:
alter system set log_archive_dest_1='location="USE_DB_RECOVERY_FILE_DEST",
valid_for=(ALL_LOGFILES,ALL_ROLES)' scope = BOTH;
alter system set log_archive_dest_2='service=JDR LGWR ASYNC NOAFFIRM
db_unique_name="JDR" valid_for=(ONLINE_LOGFILES,PRIMARY_ROLES)' scope=BOTH;
create pfile='/dba/hibeprd.pfile' from spfile;
5) Take Primary Database backup and move to standby server :
create pfile from spfile;
backup as backupset device type disk database ;
backup as backupset device type current controlfile for standby;
At standby database (JDR):
6)Modify pfile for standby :
*.db_name='JDB'
*.log_archive_dest_1='location="USE_DB_RECOVERY_FILE_DEST",
valid_for=(ALL_LOGFILES,ALL_ROLES)'
*.control_files='+JDATA/jdr/controlfile/current'
Add to standby init.ora:
*.db_unique_name='JDR'
*.standby_file_management='AUTO'
*.db_file_name_convert='+JDATA/JDB/','+JDATA/JDR/'
*.log_file_name_convert='+JDATA/JDB/','+JDATA/JDR/'
*.fal_client='(DESCRIPTION for JDR database)'
*.fal_server='(DESCRIPTION for JDB database)'
*.log_archive_config='dg_config=(JDR,JDB)'
*.service_names='JDB','JDR'
*.dg_broker_start=TRUE
Note: commnet following 2 parameter if it is RAC:
#*.cluster_database_instances=2
#*.cluster_database=true
startup nomount;
rman target sys/password@JDB auxiliary / <<EOF
duplicate target database for standby NOFILENAMECHECK;
exit;
EOF
6) Primary and Standby database: Enable dataguard both
alter system set DG_BROKER_START=true scope=both;
Note: For DATA GUARD BROKER SETUP - See my notes on Data Guard
II) Create standby database using Duplicate...ACTIVE DATABASE:
FOR STANDBY – the duplicate is for use as a standby so a DBID change will not be forced.
FROM ACTIVE DATABASE – instructs RMAN to use the active target database instead of disk based backups.
DORECOVER – do recovery bringing the standby database up to the current point in time.
SPFILE – values for parameters specific to the auxiliary instance can be set here.
NOFILENAMECHECK – this option is added because the duplicate database files uses the same name as the source database
It will create standby database over the network using active(primary) database files.
duplicate target database for standby from active database
spfile
set db_unique_name='jdb_stdby'
set fal_client and fal_server
set standby_file_management='AUTO'
set log_archive_config and log_archive_dest_2;
III) Start MRP:
alter database recover managed standby database disconnect from session;
IV) Active Dataguard (need oracle license) : Open the Standby Database in READ ONLY
and start the recovery:
alter database recover managed standby database cancel;
alter database open;
alter database recover managed standby database disconnect;
No comments:
Post a Comment