Oracle11G uses DGbroker to create dg and oracle11gdgbroker

Source: Internet
Author: User

Oracle11G uses DGbroker to create dg and oracle11gdgbroker

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='patest' 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 50m;
alter database add standby logfile group  12 '/u01/app/oracle/oradata/ATEST/standbylog/standby12.log' size 50m;
alter database add standby logfile group  13 '/u01/app/oracle/oradata/ATEST/standbylog/standby13.log' size 50m;
alter database add standby logfile group  14 '/u01/app/oracle/oradata/ATEST/standbylog/standby14.log' size 50m;

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 'patest''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 Network 3. check the parameter file 4. check the firewall or selinux5. if there is no problem above, 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)

 

 

  

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.