Oracle 11G uses DG Broker to create a consumer uard
Oracle 11G uses DG Broker to create a consumer uard
1. Environment:
A. host environment: CentOS6.5
B. software environment: oracle 11.2.0.4
C. host information:
DG1: 192.168.100.51 (Database sid: atest)
DG2: 192.168.100.52
2. prerequisites (both master and slave nodes must be set ):
A. Disable the firewall:/etc/init. d/iptables stop
B. Disable selinux: setenforce 0
View status: getenforce (off status: Permissive)
3. master database settings:
A. Set the master database db_unique_name:
Alter system set db_unique_name = 'pattern' scope = spfile;
B. Set the master database to forcibly record logs:
Alter database force logging;
Check status (YEs is mandatory ):
Select name, force_logging from v $ database;
C. Set standy_file_management:
Alter system set standby_file_management = 'auto ';
D. Create standbylog:
Alter database add standby logfile group 11'/u01/app/oracle/oradata/ATEST/standbylog/standby11.log 'size 50 m;
Alter database add standby logfile group 12'/u01/app/oracle/oradata/ATEST/standbylog/standby12.log 'size 50 m;
Alter database add standby logfile group 13'/u01/app/oracle/oradata/ATEST/standbylog/standby13.log 'size 50 m;
Alter database add standby logfile group 14'/u01/app/oracle/oradata/ATEST/standbylog/standby14.log 'size 50 m;
E. Enable archiving (not detailed ):
Alter system set log_archive_dest_1 = 'location =/u01/app/oracle/oradata/ATEST/archivelog ';
Alter database archivelog;
F. Enable DGbroker:
Alter system set DG_BROKER_START = TRUE;
G. Transfer pfile and password file:
Create pfile from spfile;
Scp initatest. ora orapwatest 192.168.100.52:/u01/app/oracle/product/11.2.0/db1/dbs/
H. Set the listener: atest, patest, patest_DGMGRL
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = atest)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
(SID_DESC =
(GLOBAL_DBNAME = patest)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
(SID_DESC =
(GLOBAL_DBNAME = patest_DGMGRL)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = vijay01.database.com) (PORT = 1521 ))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521 ))
)
)
ADR_BASE_LISTENER =/u01/app/oracle
I. Set tnsnames. ora
ATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.51) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
PATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.51) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
SATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.52) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
4. Slave database settings:
A. Set the listener: atest, satest, satest_DGMGRL
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = atest)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
(SID_DESC =
(GLOBAL_DBNAME = satest)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
(SID_DESC =
(GLOBAL_DBNAME = satest_DGMGRL)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/db1)
(SID_NAME = atest)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = vijay02.database.com) (PORT = 1521 ))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521 ))
)
)
ADR_BASE_LISTENER =/u01/app/oracle
B. Set tnsnames. ora
ATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.52) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
SATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.52) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
PATEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.51) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = atest)
)
)
5. Backup master database:
A. rman target/
B. backup database;
6. Clone the master database from the slave database:
A. Modify db_unique_name = satest on the pfile of the standby database.
B. Start the database to nomount:
Startup nomount
C. log on to rman:
Rman target sys/123456 @ patest auxiliary sys/123456 @ satest
D. start cloning:
Duplicate target database for standby nofilenamecheck from active database;
7. Set DGbroker:
A. log on to dgmgrl:
Dgmgrl sys/123456 @ patest
B. Set the master database:
Create configuration dgc as primary database is patest connect identifier is patest;
C. Add a slave database:
Add database satest as connect identifier is satest maintained as physical;
D. Enable the configuration file:
Enable configuration
E. view the DGbroker Configuration:
Show configuration [verbose];
Show database [verbose] 'satest ';
Show database 'pattern' 'statusreport ';
F. view the database's DG status:
Select group #, dbid, archived, status from v $ standby_log;
Select dest_id, valid_type, valid_role, valid_now from v $ archive_dest;
Select process, status, group #, thread #, sequence # from v $ managed_standby order by process, group #, thread #, sequence #;
Select name, value, time_computed from v $ dataguard_stats;
Select timestamp, facility, dest_id, message_num, error_code, message from v $ dataguard_status order by timestamp;
Select recid, archived, applied from v $ archived_log;
8. Check if DG is not synchronized:
1. Check the password file
2. Check the network
3. Check the parameter file
4. Check the firewall or selinux
5. If no problem exists, it only indicates that there is a problem with the dg Environment. You need to re-build the dg (re-transmit the data file to the master database and re-synchronize it)