主库、备库都开启dg_broker
SYS@PROD1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1PROD1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2PROD1.dat
dg_broker_start boolean FALSE
SYS@PROD1> alter system set dg_broker_start=true;
System altered.
SYS@PROD1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1PROD1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2PROD1.dat
dg_broker_start boolean TRUE
SYS@SBDB1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr1SBDB1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr2SBDB1.dat
dg_broker_start boolean FALSE
SYS@SBDB1> alter system set dg_broker_start=true;
System altered.
SYS@SBDB1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr1SBDB1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr2SBDB1.dat
dg_broker_start boolean TRUE
主库、备库检查进程是否启动
[oracle@enmoedu1 ~]$ ps -ef | grep dmon
oracle 24937 1 0 11:36 ? 00:00:00 ora_dmon_PROD1
oracle 24941 5533 0 11:36 pts/5 00:00:00 grep dmon
[oracle@enmoedu2 ~]$ ps -ef | grep dmon
oracle 22742 1 0 11:48 ? 00:00:00 ora_dmon_SBDB1
oracle 23031 10959 0 11:53 pts/1 00:00:00 grep dmon
主库配置broker:
[oracle@enmoedu1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected.
DGMGRL>
DGMGRL> create configuration 'drsolution' as
> primary database is 'PROD1'
> connect identifier is PROD1;
Configuration "drsolution" created with primary database "PROD1"
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> add database 'SBDB1' as connect identifier is SBDB1;
Database "SBDB1" added
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> enable configuration;
Enabled.
DGMGRL> enable database 'SBDB1';
Enabled.
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database 'PROD1';
Database - PROD1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Database Status:
SUCCESS
DGMGRL> show database 'SBDB1';
Database - SBDB1
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
SBDB1
Database Status:
SUCCESS
确保主库、备库的日志组相同:
SYS@PROD1> set linesize 200;
SYS@PROD1> col member for a60;
SYS@PROD1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/PROD1/redo03.log
2 /u01/app/oracle/oradata/PROD1/redo02.log
1 /u01/app/oracle/oradata/PROD1/redo01.log
4 /u01/app/oracle/oradata/PROD1/redo04.log
5 /u01/app/oracle/oradata/PROD1/redo05.log
6 /u01/app/oracle/oradata/PROD1/redo06.log
7 /u01/app/oracle/oradata/PROD1/redo07.log
7 rows selected.
SYS@SBDB1> set linesize 200;
SYS@SBDB1> col member for a60;
SYS@SBDB1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/SBDB1/redo03.log
2 /u01/app/oracle/oradata/SBDB1/redo02.log
1 /u01/app/oracle/oradata/SBDB1/redo01.log
4 /u01/app/oracle/oradata/SBDB1/redo04.log
5 /u01/app/oracle/oradata/SBDB1/redo05.log
6 /u01/app/oracle/oradata/SBDB1/redo06.log
7 /u01/app/oracle/oradata/SBDB1/redo07.log
7 rows selected.
Step2 Set the LogXptMode database property appropriately.
If the protection mode to be set is MAXAVAILABILITY, it is required that the redo transport service of at least one standby database is set to SYNC
DGMGRL> edit database 'SBDB1' SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
Step3 Change the overall protection mode for the configuration.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
DGMGRL> edit configuration set protection mode as maxavailability;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
错误原因:因为没有设置到备库是SYNC同步模式,解决办法是第二步骤
Step4 Verify the protection mode has changed.
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxAvailability
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
另一种校验方式:没修改模式之前
SYS@PROD1> select SWITCHOVER_STATUS,PROTECTION_MODE from v$database;
SWITCHOVER_STATUS PROTECTION_MODE
-------------------- --------------------
TO STANDBY MAXIMUM PERFORMANCE
SYS@SBDB1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM PERFORMANCE
修改之后:
SYS@PROD1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM AVAILABILITY
SYS@SBDB1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM AVAILABILITY
Step1 Ensure standby redo logs are configured on the primary and target standby databases.
SYS@PROD1> set linesize 200;
SYS@PROD1> col member for a60;
SYS@PROD1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/PROD1/redo03.log
2 /u01/app/oracle/oradata/PROD1/redo02.log
1 /u01/app/oracle/oradata/PROD1/redo01.log
4 /u01/app/oracle/oradata/PROD1/redo04.log
5 /u01/app/oracle/oradata/PROD1/redo05.log
6 /u01/app/oracle/oradata/PROD1/redo06.log
7 /u01/app/oracle/oradata/PROD1/redo07.log
7 rows selected.
SYS@SBDB1> set linesize 200;
SYS@SBDB1> col member for a60;
SYS@SBDB1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/SBDB1/redo03.log
2 /u01/app/oracle/oradata/SBDB1/redo02.log
1 /u01/app/oracle/oradata/SBDB1/redo01.log
4 /u01/app/oracle/oradata/SBDB1/redo04.log
5 /u01/app/oracle/oradata/SBDB1/redo05.log
6 /u01/app/oracle/oradata/SBDB1/redo06.log
7 /u01/app/oracle/oradata/SBDB1/redo07.log
7 rows selected.
Step2 Ensure the LogXptMode Property is set to SYNC.
DGMGRL> edit database 'PROD1' set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> edit database 'SBDB1' set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
Step3 Set the FastStartFailoverTarget configuration property.
DGMGRL> edit database 'PROD1' set PROPERTY FastStartFailoverTarget='SBDB1';
Property "faststartfailovertarget" updated
Step4 Upgrade the protection mode to MAXAVAILABILITY, if necessary.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
Step5 Enable Flashback Database on the primary and target standby databases, if necessary.
ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
SHOW PARAMETER UNDO;
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH;
ALTER DATABASE ARCHIVELOG;
ALTER SYSTEM SET db_recovery_file_dest_size=4g;
ALTER SYSTEM SET db_recovery_file_dest=/home/oracle/flash;
ALTER DATABASE FLASHBACK ON;
ALTER DATABASE OPEN;
Step6 Start the observer.
DGMGRL> start observer;
Observer started
Step7 Enable fast-start failover.
DGMGRL> enable fast_start failover;
Error: ORA-16651: requirements not met for enabling fast-start failover
Failed.
原因是:主库没有开启flashback功能
解决方法:
SYS@PROD1> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SYS@PROD1> alter database flashback on;
Database altered.
DGMGRL> enable fast_start failover;
Enabled.
Step8 Verify the fast-start failover configuration.
DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: SBDB1
Observer: enmoedu1.example.com
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
DGMGRL> show database 'PROD1' FastStartFailoverTarget;
FastStartFailoverTarget = 'SBDB1'
DGMGRL> show database 'SBDB1' FastStartFailoverTarget;
FastStartFailoverTarget = 'PROD1'
SYS@PROD1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1PROD1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2PROD1.dat
dg_broker_start boolean FALSE
SYS@PROD1> alter system set dg_broker_start=true;
System altered.
SYS@PROD1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr1PROD1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/dbhome_1/dbs/dr2PROD1.dat
dg_broker_start boolean TRUE
SYS@SBDB1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr1SBDB1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr2SBDB1.dat
dg_broker_start boolean FALSE
SYS@SBDB1> alter system set dg_broker_start=true;
System altered.
SYS@SBDB1> show parameter dg_broker;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr1SBDB1.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr2SBDB1.dat
dg_broker_start boolean TRUE
主库、备库检查进程是否启动
[oracle@enmoedu1 ~]$ ps -ef | grep dmon
oracle 24937 1 0 11:36 ? 00:00:00 ora_dmon_PROD1
oracle 24941 5533 0 11:36 pts/5 00:00:00 grep dmon
[oracle@enmoedu2 ~]$ ps -ef | grep dmon
oracle 22742 1 0 11:48 ? 00:00:00 ora_dmon_SBDB1
oracle 23031 10959 0 11:53 pts/1 00:00:00 grep dmon
主库配置broker:
[oracle@enmoedu1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected.
DGMGRL>
DGMGRL> create configuration 'drsolution' as
> primary database is 'PROD1'
> connect identifier is PROD1;
Configuration "drsolution" created with primary database "PROD1"
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> add database 'SBDB1' as connect identifier is SBDB1;
Database "SBDB1" added
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> enable configuration;
Enabled.
DGMGRL> enable database 'SBDB1';
Enabled.
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxPerformance
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database 'PROD1';
Database - PROD1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Database Status:
SUCCESS
DGMGRL> show database 'SBDB1';
Database - SBDB1
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
SBDB1
Database Status:
SUCCESS
确保主库、备库的日志组相同:
SYS@PROD1> set linesize 200;
SYS@PROD1> col member for a60;
SYS@PROD1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/PROD1/redo03.log
2 /u01/app/oracle/oradata/PROD1/redo02.log
1 /u01/app/oracle/oradata/PROD1/redo01.log
4 /u01/app/oracle/oradata/PROD1/redo04.log
5 /u01/app/oracle/oradata/PROD1/redo05.log
6 /u01/app/oracle/oradata/PROD1/redo06.log
7 /u01/app/oracle/oradata/PROD1/redo07.log
7 rows selected.
SYS@SBDB1> set linesize 200;
SYS@SBDB1> col member for a60;
SYS@SBDB1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/SBDB1/redo03.log
2 /u01/app/oracle/oradata/SBDB1/redo02.log
1 /u01/app/oracle/oradata/SBDB1/redo01.log
4 /u01/app/oracle/oradata/SBDB1/redo04.log
5 /u01/app/oracle/oradata/SBDB1/redo05.log
6 /u01/app/oracle/oradata/SBDB1/redo06.log
7 /u01/app/oracle/oradata/SBDB1/redo07.log
7 rows selected.
Step2 Set the LogXptMode database property appropriately.
If the protection mode to be set is MAXAVAILABILITY, it is required that the redo transport service of at least one standby database is set to SYNC
DGMGRL> edit database 'SBDB1' SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
Step3 Change the overall protection mode for the configuration.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
DGMGRL> edit configuration set protection mode as maxavailability;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
错误原因:因为没有设置到备库是SYNC同步模式,解决办法是第二步骤
Step4 Verify the protection mode has changed.
DGMGRL> show configuration;
Configuration - drsolution
Protection Mode: MaxAvailability
Databases:
PROD1 - Primary database
SBDB1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
另一种校验方式:没修改模式之前
SYS@PROD1> select SWITCHOVER_STATUS,PROTECTION_MODE from v$database;
SWITCHOVER_STATUS PROTECTION_MODE
-------------------- --------------------
TO STANDBY MAXIMUM PERFORMANCE
SYS@SBDB1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM PERFORMANCE
修改之后:
SYS@PROD1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM AVAILABILITY
SYS@SBDB1> select DATAGUARD_BROKER,PROTECTION_MODE from v$database;
DATAGUAR PROTECTION_MODE
-------- --------------------
ENABLED MAXIMUM AVAILABILITY
Step1 Ensure standby redo logs are configured on the primary and target standby databases.
SYS@PROD1> set linesize 200;
SYS@PROD1> col member for a60;
SYS@PROD1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/PROD1/redo03.log
2 /u01/app/oracle/oradata/PROD1/redo02.log
1 /u01/app/oracle/oradata/PROD1/redo01.log
4 /u01/app/oracle/oradata/PROD1/redo04.log
5 /u01/app/oracle/oradata/PROD1/redo05.log
6 /u01/app/oracle/oradata/PROD1/redo06.log
7 /u01/app/oracle/oradata/PROD1/redo07.log
7 rows selected.
SYS@SBDB1> set linesize 200;
SYS@SBDB1> col member for a60;
SYS@SBDB1> select group#, member from v$logfile;
GROUP# MEMBER
---------- ------------------------------------------------------------
3 /u01/app/oracle/oradata/SBDB1/redo03.log
2 /u01/app/oracle/oradata/SBDB1/redo02.log
1 /u01/app/oracle/oradata/SBDB1/redo01.log
4 /u01/app/oracle/oradata/SBDB1/redo04.log
5 /u01/app/oracle/oradata/SBDB1/redo05.log
6 /u01/app/oracle/oradata/SBDB1/redo06.log
7 /u01/app/oracle/oradata/SBDB1/redo07.log
7 rows selected.
Step2 Ensure the LogXptMode Property is set to SYNC.
DGMGRL> edit database 'PROD1' set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> edit database 'SBDB1' set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
Step3 Set the FastStartFailoverTarget configuration property.
DGMGRL> edit database 'PROD1' set PROPERTY FastStartFailoverTarget='SBDB1';
Property "faststartfailovertarget" updated
Step4 Upgrade the protection mode to MAXAVAILABILITY, if necessary.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
Step5 Enable Flashback Database on the primary and target standby databases, if necessary.
ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
SHOW PARAMETER UNDO;
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH;
ALTER DATABASE ARCHIVELOG;
ALTER SYSTEM SET db_recovery_file_dest_size=4g;
ALTER SYSTEM SET db_recovery_file_dest=/home/oracle/flash;
ALTER DATABASE FLASHBACK ON;
ALTER DATABASE OPEN;
Step6 Start the observer.
DGMGRL> start observer;
Observer started
Step7 Enable fast-start failover.
DGMGRL> enable fast_start failover;
Error: ORA-16651: requirements not met for enabling fast-start failover
Failed.
原因是:主库没有开启flashback功能
解决方法:
SYS@PROD1> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SYS@PROD1> alter database flashback on;
Database altered.
DGMGRL> enable fast_start failover;
Enabled.
Step8 Verify the fast-start failover configuration.
DGMGRL> show fast_start failover;
Fast-Start Failover: ENABLED
Threshold: 30 seconds
Target: SBDB1
Observer: enmoedu1.example.com
Lag Limit: 30 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
DGMGRL> show database 'PROD1' FastStartFailoverTarget;
FastStartFailoverTarget = 'SBDB1'
DGMGRL> show database 'SBDB1' FastStartFailoverTarget;
FastStartFailoverTarget = 'PROD1'
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30192548/viewspace-2121488/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30192548/viewspace-2121488/