Vous êtes sur la page 1sur 4

Steps to install data guard 10g,9i.

Nizamuddin.M.K

Step1 :

add entry in listener.ora for standby production server


--------------------------------------------------------
(SID_DESC =
(SID_NAME = STORA7DB)
(ORACLE_HOME = /d200/oracle/d001/10.1.0.2)
)

Step 2 :

Define the standby database connect string on the primary site:


----------------------------------------------------------------

STORA7DB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = bpsun1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = STORA7DB)
)
)

Step 3 :

Enable dead connection detection on the primary and standby sites:


-------------------------------------------------------------------
sqlnet.expire_time=2
(in $ORACLE_HOME/network/admin/sqlnet.ora)

Step 4 :

copy init.ora to standby site


----------------------------------
cp initORA7DB.ora initSTORA7DB.ora

Step 5 :

copy all files cold backup or hot backup to standby site


-----------------------------------------------------------
cp /d200/oracle/d101/oracle/ORA7DB/*.* /d200/oracle/d101/oracle/STORA7DB/

Step 6 :

edit standby init.ora later save as spfile


---------------------------------------------
vi initSTORA7DB.ora
--------------------
Change pathnames, such as control_files, background_dump_dest,
core_dump_dest, user_dump_dest, and audit_file_dest, and add:

# log_archive_dest = /orcl/oradata/PROD2/archivelogs
log_archive_dest_1 = 'LOCATION=/d200/oracle/d801/oracle/STORA7DB/archive MANDATORY' # for
switchover
log_archive_dest_state_1 = ENABLE # for switchover

log_archive_dest_2 = 'SERVICE=ORA7DB LGWR SYNC' # for switchover


log_archive_dest_state_2 = ENABLE # for switchover

standby_archive_dest = /d200/oracle/d801/oracle/STORA7DB/archive # for stanby archive logs

standby_file_management = AUTO # or MANUAL for raw devices


remote_archive_enable = SEND, RECEIVE
##remote_archive_enable = TRUE # TRUE or RECEIVE, change RECEIVE to SEND on switchover
instance_name = STORA7DB
lock_name_space = STORA7DB # use when primary and standby on same system; same as
instance_name
fal_server = ORA7DB # "fal" is Fetch Archive Log, for log gap resolution
fal_client = STORA7DB
db_file_name_convert = ('/ORA7DB/','/STORA7DB/')
log_file_name_convert = ('/ORA7DB/','/STORA7DB/')

Step 7 :

edit production init.ora later save as spfile


-------------------------------------------------
vi initORA7DB.ora
----------------
#log_archive_dest = /orcl/oradata/PROD/archivelogs
log_archive_dest_1 = 'LOCATION=/d200/oracle/d801/oracle/ORA7DB/archive MANDATORY'
log_archive_dest_state_1 = ENABLE
log_archive_dest_2 = 'SERVICE=STORA7DB LGWR ASYNC'
log_archive_dest_state_2 = ENABLE
standby_archive_dest = /d200/oracle/d801/oracle/ORA7DB/archive # for switchover
standby_file_management = AUTO # for switchover; or MANUAL for raw devices
## 9i paramter remote_archive_enable = TRUE # TRUE or SEND, change SEND to RECEIVE on
switchover
remote_archive_enable = SEND, RECEIVE

instance_name = ORA7DB
lock_name_space = ORA7DB # use when primary and standby on same system; same as instance_name
fal_server = STORA7DB # for switchover
fal_client = ORA7DB # for switchover
db_file_name_convert = ('/STORA7DB/','/ORA7DB/') # for switchover
log_file_name_convert = ('/STORA7DB/','/ORA7DB/') # for switchover

(If primary uses spfile, wait until after the standby database
files are copied/created to make these parameter changes.)

Step 8 :
Create the standby control file from the primary database:
===============================================================

alter database create standby controlfile as


'/d200/oracle/d101/oracle/STORA7DB/ctrl01_new_STORA7DB2.ctl' reuse;

overwrite all standby control files with this copy


-------------------------------------------------------
cp ctrl01_new_STORA7DB2.ctl ctrl01_new_STORA7DB.ctl
cp ctrl01_new_STORA7DB2.ctl ctrl02_new_STORA7DB.ctl

Step 9 :

create password file in standby


-----------------------------------
orapwd file=$ORACLE_HOME/dbs/orapwSTORA7DB password=ora7db entries=5

Step 10 :

reload listener
-----------------

lsnrctl reload

Step 11:

Start stanbydatabase
================================
startup nomount ;
alter database mount standby database;
alter database recover managed standby database disconnect from session;

Step 12 :

check production/standby status


----------------------------------

select STANDBY_BECAME_PRIMARY_SCN, GUARD_STATUS,SWITCHOVER_STATUS,


DATABASE_ROLE, PROTECTION_LEVEL from v$database;

alter system switch logfile; ## run in production check archive log is copied in standby site

Step 13:

Add Standby Redo Log Groups to Standby Database and production


==============================================================
sqlplus "/ as sysdba"
alter database recover managed standby database cancel;
alter database open read only;
select max(group#) maxgroup from v$logfile;
select max(bytes) / 1024 "size (K)" from v$log;
issue at standby
-------------
alter database add standby logfile group
5('/d200/oracle/d101/oracle/STORA7DB/stby_log_STORA7DB_5A.rdo') size 5120000;
issue at production
--------------
alter database add standby logfile group
5('/d200/oracle/d101/oracle/ORA7DB/stby_log_ORA7DB_5A.rdo') size 5120000 reuse;

Step 14 :

Add tempfile to temp in standby and production if needed


============================================================
alter tablespace temp add tempfile
'/d200/oracle/d101/oracle/STORA7DB/temp02_ORA7DB.dbf' size 40K reuse;

select * from v$tempfile;

Step 15 (optional):

Switch to the desired "maximum availability" protection mode on the primary database (from the
default "maximum performance"):
============================================================================
===================================================
select value from v$parameter where name = 'log_archive_dest_2'; -- must show LGWR SYNC
shutdown normal
startup mount
alter database set standby database to maximize availability;
alter database open;
select protection_mode from v$database;

Vous aimerez peut-être aussi