Oracle 11G使用DG Broker创建DataGuard(2)

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.备份主库:

a.rman target /

b.backup database;

6.在备库上克隆主库:

a.修改备库pfile上的db_unique_name=satest

b.启动数据库到nomount:

startup nomount

c.登陆rman:

rman target sys/123456@patest auxiliary sys/123456@satest

d.开始克隆:

duplicate target database for standby nofilenamecheck from active database;

7.设置DGbroker:

a.登陆dgmgrl:

dgmgrl sys/123456@patest

b.设置主库:

create configuration dgc as primary database is patest connect identifier is patest;

c.添加备库:

add database satest as connect identifier is satest maintained as physical;

d.启用配置文件:

enable configuration

e.查看DGbroker配置:

show configuration [verbose];

show database [verbose] 'satest';

show database 'patest''StatusReport';

f.查看数据库的DG状态:

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.DG不同步检查步骤:

1.检查密码文件
2.检查网络
3.检查参数文件
4.检查防火墙或selinux
5.如以上均无问题,只能说明dg环境有问题,需要重新搭建dg(重新传输数据文件到主库,在重新同步)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/4bb89af8a262f52fcf394afb501d1f80.html