Rechercher dans ce blog

mardi 4 octobre 2011

dataguard 11g premiere partie

Dataguard  11g



host
db  role
db name
db unique name
aix_rac1
Primary
MG
MG 
aix_rac2
Standby
MG
MGSTDBY


       I.            Parametre  reseau

1.     Serveur

Listener    :

Aspect  listener  sont  gerés par le  user  grid et  le  crs
#cat  /u01/app/grid/11.2.0/network/admin/listener.ora
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTNER))))             # line added by Agent
LISTENER_MG=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.181)(PORT=1521))))
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
SID_LIST_LISTENER_MG =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = MGSTDBY)
      (ORACLE_HOME = /u01/app/oracle/11.2.0)
      (GLOBAL_DBNAME = MGSTDBY)
    )
  )
INBOUND_CONNECT_TIMEOUT_LISTENER_MG = 120

# sqlnet.ora.aix_rac2 Network Configuration File: /u01/app/grid/11.2.0/network/admin/sqlnet.ora.aix_rac2
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

ADR_BASE = /u01/app/oracle
SQLNET.INBOUND_CONNECT_TIMEOUT = 120

Tnsnames.ora

2.     Sur les  serveurs :

MG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.180)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MG)
      (SID=MG)
    )
  )
MGSTDBY =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.100.181)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MGSTDBY)
      (SID=MGSTDBY)
    )
  )

 

3.     Client

Tnsnames.ora :
MG=
  (DESCRIPTION =
    (failover=on)
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.100.180)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.181)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = appli-test
      (SERVER=DEDICATED)
    )
  )

   II.            Parameter  bd

4.     Primary

En gras  les  parametres  specifiques   pour dataguard.

·         L init.ora
processes = 150
spfile = +DATA/mg/parameterfile/spfile.274.750424535
memory_target = 301989888
control_files = +DATA/mg/controlfile/current.265.750357729
db_file_name_convert = /u01/app/oracledata/stdby, +DATA/MG/datafile, /u01/app/oracledata/stdby, +DATA/MG/tempfile
log_file_name_convert =  /u01/app/oracledata/stdby, +DATA/MG/onelinelog
db_block_size = 8192
compatible = 11.2.0.0.0
log_archive_dest_1 = Location=use_db_recovery_file_dest  valid_for=(all_logfiles,all_roles) DB_UNIQUE_NAME=MG
log_archive_dest_2 = SERVICE=MGSTDBY VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=MGSTDBY
log_archive_dest_state_2 = ENABLE
log_archive_config = DG_CONFIG=(MG,MGSTDBY)
db_recovery_file_dest = /u01/app/oracledata/arch
db_recovery_file_dest_size = 2147483648
undo_tablespace = UNDOTBS1
remote_login_passwordfile = EXCLUSIVE
service_names = MG, DU,appli-test
dispatchers = (PROTOCOL=TCP) (SERVICE=MGXDB)
local_listener = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.100.180)(PORT = 1521)))
audit_file_dest = /u01/app/oracle/admin/MG/adump
audit_trail = DB
db_name = MG
open_cursors = 300
diagnostic_dest = /u01/app/oraclediagnostic_dest = /u01/app/oracle
Fal_server=MGSTDBY
Fal_client=MG
·          Password  file :
Orapwd  file=orapw$ORACLE_SID password=agoulou1 entries=5 ignorcase=y
Chown  oracle :dba orapw$ORACLE_SID
chmod 4640 $ORACLE_HOME/dbs/orapw$ORACLE_SID
A copier  sur   aix_rac2
·          Passer  la  bd  en  archivelog
·          Passer la   bd  en  force  logging

5.     Standby :

processes = 150
memory_target = 301989888
control_files = /u01/app/oracledata/stdby/MGSTDBY_1.ctl, /u01/app/oracledata/stdby/MGSTDBY_2.ctl
db_file_name_convert = +DATA/MG/datafile, /u01/app/oracledata/stdby, +DATA/MG/tempfile, /u01/app/oracledata/stdby
log_file_name_convert = +DATA/MG/onelinelog, /u01/app/oracledata/stdby
db_block_size = 8192
compatible = 11.2.0.0.0
log_archive_dest_1 = LOCATION=/u01/app/oracledata/arch  VALID_FOR=(ALL_LOGFILES,ALL_ROLES)  DB_UNIQUE_NAME=MGSTDBY
log_archive_dest_2 = SERVICE=MG LGWR ASYNC  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=MG
fal_client = MGSTDBY
fal_server = MG
log_archive_config = DG_CONFIG=(MG,MGSTDBY)
db_recovery_file_dest = /u01/app/oracledata/arch
db_recovery_file_dest_size = 2147483648
standby_file_management = AUTO
undo_tablespace = UNDOTBS1
remote_login_passwordfile = EXCLUSIVE
service_names = MGSTBY
local_listener = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST=192.168.100.181)(PORT = 1521)))
audit_file_dest = /u01/app/oracle/admin/MGSDBY/adump
audit_trail = OS
db_name = MG
db_unique_name = MGSTDBY
open_cursors = 300
diagnostic_dest = /u01/app/oracle

III.            Construction de  la dg :

Par   rman   :
[aix_rac2:oracle:MGSTDBY:/u01/app/oracle/11.2.0/dbs]
#rman target sys/agoulou1@MG
connected to target database: MG (DBID=2184057791)
 connect  auxiliary sys/agoulou1@MGSTDBY
run {
DUPLICATE TARGET DATABASE
  FOR STANDBY
  FROM ACTIVE DATABASE
  DORECOVER  ;
  }

 IV.            Active  dataguard :

Ouvrir  la standby  en  read only :
alter database  recover  managed  standby database cancel;
alter  database open  read  only;
alter database  recover  managed  standby database  disconnect  from  session;
vérification :
select THREAD#, max(sequence#) AS "LAST_APPLIED_LOG"
from v$archived_log
where REGISTRAR='RFS'
and APPLIED='YES'
GROUP BY THREAD#;

Aucun commentaire:

Enregistrer un commentaire