How to configure data guard in Oracle

Step 1: Configuring standby database from primary database

[oracle@rizwan ~]$ cd $ORACLE_HOME/dbs

[oracle@rizwan dbs]$ cp initprod.ora initstand.ora

Important Parameter (make changes in both parameter files)

Both side db_name must be same

For primary db:
1. db_name = prod (use same name for all standby databases)
2. db_unique_name = hyd (a unique db name to uniquely identify 
primary and standby db because db_name is same)       
3. Log_archive_dest_1 =‘location = /u01/user20/prod/arch’  
(destination for local archive)
4. Log_archive_dest_2 = ‘service= topune’  
( destination for standby database) 
5.  Standby_file_management= auto
 (it automatically create file at standby db site)

For Standby db:
db_name  = prod;
db_unique_name =  pune;
1 .db_file_name_convert (specify the path name and datafile location of 
primary database
    datafile followed by standby location)
2. standby_archive_dest (location of archives coming from primary database)
3. log_file_name_convert (.specify the path name and redo logfile 
location of primary database redo logfile followed by standby location)
4  fal_server =’tohyd’ (the value is tns service name, to fetch archived log from primary site when log gap is detected at standby site)
5. fal_client =’topune’ (the value is tns service name to copies 
missing archive to standby  database.

Step – II:- Both side create password file with same password
at dbs location
$ orapwd file=orapwprod password=manager force=y ignorecase=y
$oracpwd file=orapwstand password=manager force=y ignorecase=y

Step – III:- Configure Listener at standby side and TNS service at
 primary side
listener name= list_stand   and TNS service= tostand

Step – IV:- Start the standby database in nomount stage 
[oracle@rizwan ~]$ export ORACLE_SID=stand
[oracle@rizwan ~]$ sqlplus / as sysdba

SYS> startup nomount

Connect to RMAN 
[oracle@rizwan ~]$ rman target / nocatalog auxiliary sys/manager@tostand

Rman> duplicate target database for standby from active database;

Step-V: At standby database side starting mrp (media recovery process)
 process

Sql>alter database recover managed standby database disconnect;

How to stop mrp process
Sql> alter database recover managed standby database cancel;

How to check mrp process is running or not
$ps –ef |grep mrp

Starting the Standby db in read only mode
Sql> alter database recover managed standby database cancel;  à stop mrp
Sql> alter database open    à opens in read only mode

Imp views
v$archive_dest            (To check if any error in transferring archives)
v$managed_standby   (Current status information for oracle database process)
v$archived_log (To check how many archives are applied at standby database                                                Side)
  

To Be Continue......



No comments:

Post a Comment