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 folloing 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:
It will create standby database over the network using ative(primary) database files.
duplicate target database for standby 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;
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 folloing 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:
It will create standby database over the network using ative(primary) database files.
duplicate target database for standby 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;