Sunteți pe pagina 1din 4

Creation of Standby database (glvstby) from Production RAC database (glvprod)

Database Name

GLVPROD

Primary DB

GLVPROD1 (node 1) GLVPROD2 (node 2) GLVSTBY

Standby DB

Step 1: Enable the archive log mode in Primary DB. Step 2 : Enable force logging in Primary DB

Step 3: Create the listener in standby database. Step 4: Enter the tnsname entries in primary(both nodes) and standby database. Step 5: Ensure the connectivity between primary(both nodes) and standby nodes using tnsping. Step 6: Copy the password file from the primary database, rename it to match the standby database and move it to the standby database. a) Copy the password file to share location,
cp $ORACLE_HOME/dbs/orapwglvprod1 /orashare1/dg/

b) Rename password file to standby database name,


mv orapwglvprod1 orapwglvstby

c) Move the password file to standby $ORACLE_HOME/dbs location.


cp orapwglvstby $ORACLE_HOME/dbs/

Step 7: Modify the primary initialization parameter for dataguard on Primary DB.
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(glvprod,glvstby)';

alter system set LOG_ARCHIVE_DEST_1='LOCATION=+GLVDATA07 VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=glvprod'; alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; alter system set LOG_ARCHIVE_DEST_2='SERVICE=glvstby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=glvstby'; alter system set LOG_ARCHIVE_DEST_STATE_2=DEFER;

Step 8: Create the init parameter file in glvstby and add the following,
DB_NAME=glvstby remote_login_passwordfile=EXCLUSIVE

Step 9: Create the directory structure same as primary db in the standby.


mkdir -p /oracle/app/oracle/admin/glvstby/adump mkdir -p /oracle/app/oracle/admin/glvstby/dpdump mkdir -p /oracle/app/oracle/admin/glvstby/pfile

Step 10: Connect rman prompt in primary database and run below the script.
rman target / connect auxiliary sys/pwd@glvstby

Script: (change the parameters to match your database)


run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 type disk; allocate channel prmy4 type disk; allocate auxiliary channel stby type disk; duplicate target database for standby from active database spfile parameter_value_convert 'glvprod','glvstby' setdb_file_name_convert='+GLVDATA01','+GLVSTBY01', '+GLVDATA02','+GLVSTBY01', '+GLVDATA03','+GLVSTBY01', '+GLVDATA04','+GLVSTBY01', '+GLVDATA05','+GLVSTBY01' setdb_unique_name='glvstby' setlog_file_name_convert='+GLVDATA06/glvprod','+GLVSTBY01/glvstby' setcontrol_files='+GLVSTBY01/glvstby/control01.ctl' setlog_archive_max_processes='5' setfal_client='glvstby'

setfal_server='glvprod1','glvprod2' setstandby_file_management='AUTO' setlog_archive_config='dg_config=(glvstby,glvprod)' set log_archive_dest_1='location=+GLVSTBY01' setcluster_database='false' setinstance_name='glvstby' set thread='1' setundo_tablespace='UNDOTBS2' ; }

rman output:

Step 11: Create standby redo logfile in glvstdy database after rman successful creation of standby database,

Note: The redolog file in the standby DB should have twice+1 as primary database For ex: If redolog file in primary has 5, then you should create 10+1 ie, 11 redolog files in the standby DB.

Step 12: Enable the log_archive_dest,

Step 13: Change the standby database to apply log mode,


alter database recover managed standby database using current logfile disconnect from session;

Step 14: Compare the primary last sequence and MRP (Managed Recovery Process) applying sequence. In primary database:

In Standby database:
select sequence#, applied from v$archived_log;

S-ar putea să vă placă și