Oracle 11g DG Broker开启和配置(2)

DGMGRL>edit database db1 set property StaticConnectIdentifier= '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=beijing-fuli-hadoop-01)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=db1)(INSTANCE_NAME=db1)(SERVER=DEDICATED)))';

DGMGRL> edit database db2 set property StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=beijing-fuli-hadoop-02)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=db2)(INSTANCE_NAME=db2)(SERVER=DEDICATED)))';

四:关于db broker的相关命令:

4.1:切换主从!

DGMGRL> help switchover

DGMGRL> switchover to db1

Performing switchover NOW, please wait...

Operation requires a connection to instance "db1" on database "db1"

Connecting to instance "db1"...

Connected.

New primary database "db1" is opening...

Operation requires startup of instance "db2" on database "db2"

Starting instance "db2"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "db1"

DGMGRL>

4.2:把从库切换成snapshot状态!(前提是开启了flashback database)

主库操作

DGMGRL> SHOW CONFIGURATION

DGMGRL> help convert

DGMGRL> CONVERT DATABASE db1 TO SNAPSHOT STANDBY;

DGMGRL> SHOW CONFIGURATION;

4.3: 修改下dg同步redo的方式,以及保护模式!

DGMGRL> help edit

DGMGRL> EDIT DATABASE db2 SET PROPERTY LogXptMode=SYNC; ---主库

DGMGRL> EDIT DATABASE db1 SET PROPERTY LogXptMode=SYNC; ---备库

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability; ---主库

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability; ---备库

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

转载注明出处:https://www.heiqu.com/17532421a05be266725788a3baa7e7e5.html