MAXIMUM PROTECTION 要点: 最好两个备库 ,可以考虑far sync database
Because this data protection mode prioritizes data protection over primary database availability, Oracle recommends that a minimum of two standby databases be used to protect a primary database that runs in maximum protection mode to prevent a single standby database failure from causing the primary database to shut down.
3. FastSync,
FarSync with REDO transport mode of 'SYNC with NOAFFIRM' is called Fast sync. This is a 12c new feature and DG broker also supports.
edit database casmeprd_stby set PROPERTY LogXptMode='FASTSYNC';
Please note in 12c FASTSYNC is a new LogXptMode ( Log Transport Method)for Data Guard.
Data Guard Fast Sync (SYNC NOAFFIRM) with Oracle Database 12c provides an easy way of improving performance in synchronous zero data loss configurations. Fast Sync allows a standby to acknowledge the primary
database as soon as it receives redo in memory, without waiting for disk I/O to a standby redo log file. This reduces the impact of synchronous transport on primary database performance by
further shortening the total round -trip time between primary and standby. Fast Sync can introduce a very small exposure to data loss should simultaneous failures impact both primary and standby databases before the standby I/O completes.
Redo Destination: This is the Destination where the Redo is shipped to from this Database. It can be one or more (comma separated) db_unique_name’s or the ‘ALL’-Keyword which is an Alias for all possible Destinations inside the Data Guard Broker Configuration. Optional you can also specify the Transport Method to be used to the Destination. This can be
- SYNC: corresponds to log_archive_dest_n Attributes ‘SYNC AFFIRM’ or Non Real Time Cascade
- ASYNC: corresponds to log_archive_dest_n Attribute ‘ASYNC’ or Real Time Cascade
- FASTSYNC : corresponds to log_archive_dest_n Attributes ‘SYNC NOAFFIRM’
实时 Cascading:
新版本现在支持以实时的模式将 redo 从第一个 standby 数据库传递到 cascaded standby 数据库。因此在第一个 standby 数据库,Redo 的信息会在被写到 Standby Redolog 后立即传递到 cascaded standby 数据库。
而非实时 Cascading 意味着:只有主库的 log Switch 之后,整个 log sequence 才会被传递到最终的 Standby 数据库上。
First of all setup a Data Guard Environment as usual to the cascading Standby Database. The Log Transport Method should be ‘SYNC’ and Standby RedoLogs must be configured on the cascading Standby Database. Once you created the cascaded Standby Database you can now setup the cascading Log Transport Services. Here are some Hints for correct Setup:
- Primary, Cascading and Cascaded Standby Database db_unique_name must be present in the dg_config of log_archive_config on all the Databases
- Setup log_archive_dest_n on the cascading Standby Database to serve the cascaded (terminal) Standby Databases using the Attribute ‘valid_for=(STANDBY_LOGFILES,STANDBY_ROLE)’
- You can toggle between Real-Time and Non Real-Time Cascading using the Log Transport Method.
ASYNC = Real-Time Cascading----怎么反了??
SYNC = Non Real-Time Cascading
-----------------------------------ADG停了 FSFO的恢复-------------------------------------
How To Recover Primary And Standby after FSFO Failover Failed With ORA-16472 (Doc ID 2182230.1)
Data Guard environment configured with Maximum Availability protection mode.
FSFO failed with 'ORA-16472: failover failed due to data loss', which resulted in neither the primary nor standby being available.
CHANGES
Network outage occurred on primary site.
CAUSE
FSFO has been invoked due to network outage.
FASTSYNC transport used for Data Guard configuration in Max Availability protection mode.
SOLUTION
The usage of FASTSYNC transport could imply data loss, therefore if FSFO in place, use SYNC and AFFIRM for redo transport mode.
Oracle Database 12c Data Guard Broker documentation:
Managing the Members of a Broker Configuration
FASTSYNC
Configures redo transport services for this standby database using the SYNC and NOAFFIRM attributes of the LOG_ARCHIVE_DEST_n initialization parameter. This mode is only available in maximum availability protection mode.
-----------
Because FASTSYNC transport mode uses the NOAFFIRM attribute of the LOG_ARCHIVE_DEST_n parameter, data loss is possible. This means that a fast-start failover cannot be initiated when FASTSYNC is used and the standby is missing redo data.
Below steps can be used to recover:
1. startup mount both primary and standby databases
2. disable the broker by setting dg_broker_start=FALSE on both primary and standby databases
3. verify the synchronization:
3.1.
Primary: SQL> select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
3.2.
PhyStdby:SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
3.3.
PhyStdby:SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;
4. If the queries from steps 3.1. and 3.3. show same sequence, verify the roles of the primary and standby databases:
select database_role from v$database
5. If both primary and standby database role show correct, than continue with Step 6.
6. On primary database issue:
alter database open;
7. Recreate standby database control file by following below document:
Managed recovery Failing with ORA-16157 after Finish Command was Executed by Mistake on Standby (Doc ID 2176929.1)
8. If MRP fails with lost write detected or ora-600[3020] proceed with recovery of standby data files from primary using one of below documents:
Recovering the primary database's datafile using the physical standby, and vice versa(Doc ID 453153.1)
12c: Restoring and Recovering Files Over the Network (Doc ID 2011074.1)
9. Remove the broker config files and drc logs from both primary and standby, than create new broker configuration:
12c Create Dataguard Broker Configuration - DGMGRL(Doc ID 1583588.1)
Step by Step How to Create Dataguard Broker Configuration(Doc ID 984622.1)
NOTE: To avoid the issue from re-occurring, it is recommended to use SYNC transport mode.
-------------------------------Fastsync 不能用在max availabe protect
当添加完主备库后查看配置时出现 ORA-16797: database is not using a server parameter file。这个很明显就是数据库没有使用 Spfile 启库,直接用 pfile 启库所报的错误,解决办法关闭备库,创建 Spfile 文件后启库即可。
SYS@SBDB1> show parameter spfile
NAME TYPE VALUE
------------------------------------ -------------------------------- ------------------------------
spfile string
SYS@SBDB1> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@SBDB1> create spfile from pfile;
File created.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 941600768 bytes
Fixed Size 1348860 bytes
Variable Size 683674372 bytes
Database Buffers 251658240 bytes
Redo Buffers 4919296 bytes
Database mounted.
Database opened.
SYS@SBDB1>
SYS@SBDB1> select database_role,open_mode,protection_mode from v$database;
DATABASE_ROLE OPEN_MODE PROTECTION_MODE
---------------- -------------------- --------------------
PHYSICAL STANDBY READ ONLY MAXIMUM PERFORMANCE
当切换模式为最高可用时出现 Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode;
这个错误没遇到过便网上查看了一番,几乎网上所有的文章均在说是由于传输模式为异步的原因,MOS 上到说明可能还 standby log 日志组没有建立的原因,但都不是这样的原因,我这里只是由于备库 dg_broker_start 参数没有设置为 TRUE,太坑了,居然只设置了主库的忘记备库设置此参数了。
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> select count(*) from v$standby_log;
COUNT(*)
----------
4
SYS@prod1> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@prod1>
SYS@prod1>
SYS@prod1> startup
ORACLE instance started.
Total System Global Area 941600768 bytes
Fixed Size 1348860 bytes
Variable Size 692062980 bytes
Database Buffers 243269632 bytes
Redo Buffers 4919296 bytes
Database mounted.
Database opened.
SYS@prod1>
--备库参数也需要修改
SYS@SBDB1> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
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>
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
SYS@SBDB1>
-----------------------------------------------------------------------------
以下是全部配置过程,直接贴出来供查看。
--使用 dgmgrl 远程登陆主库进行配置
[oracle@JiekeXu_p2 ~]$ dgmgrl sys/oracle@prod1
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.
Connected.
DGMGRL> help create --使用帮助命令添加主库
Creates a broker configuration
Syntax:
CREATE CONFIGURATION <configuration name> AS
PRIMARY DATABASE IS <database name>
CONNECT IDENTIFIER IS <connect identifier>;
DGMGRL> CREATE CONFIGURATION sbdb1_broker as PRIMARY DATABASE IS PROD1 CONNECT IDENTIFIER IS PROD1;
Configuration "sbdb1_broker" created with primary database "prod1"
DGMGRL> show CONFIGURATION
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> help add --使用帮助命令添加备库 SBDB1
Adds a standby database to the broker configuration
Syntax:
ADD DATABASE <database name>
[AS CONNECT IDENTIFIER IS <connect identifier>]
[MAINTAINED AS {PHYSICAL|LOGICAL}];
DGMGRL> add database SBDB1 AS CONNECT IDENTIFIER IS SBDB1;
Database "sbdb1" added
DGMGRL> enable Configuration; --启用配置
Enabled.
DGMGRL> show Configuration --检查配置出现第一个错误ORA-16797
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database
Error: ORA-16797: database is not using a server parameter file
Fast-Start Failover: DISABLED
Configuration Status:
ERROR
--这里已使用 SPfile 重启备库了,但埋下了第二个错误的种子,备库 disabled
DGMGRL> show Configuration
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
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> help show
Displays information about a configuration, database, or instance
Syntax:
SHOW CONFIGURATION [VERBOSE];
SHOW DATABASE [VERBOSE] <database name> [<property name>];
SHOW INSTANCE [VERBOSE] <instance name> [<property name>]
[ON DATABASE <database name>];
SHOW FAST_START FAILOVER;
--查看主库详细配置,发现日志传输为异步,需要修改为同步 SYNC
DGMGRL> SHOW DATABASE VERBOSE PROD1;
Database - prod1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Properties:
DGConnectIdentifier = 'prod1'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'SBDB1, PROD1'
LogFileNameConvert = 'SBDB1, PROD1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'PROD1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JiekeXu_p1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROD1_DGMGRL.us.oracle.com)(INSTANCE_NAME=PROD1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL> EDIT DATABASE PROD1 SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
--配置完检查也是同步模式了
DGMGRL> SHOW DATABASE VERBOSE PROD1;
Database - prod1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Properties:
DGConnectIdentifier = 'prod1'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'SBDB1, PROD1'
LogFileNameConvert = 'SBDB1, PROD1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'PROD1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JiekeXu_p1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROD1_DGMGRL.us.oracle.com)(INSTANCE_NAME=PROD1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
--这里切换保护模式是出现第二个报错 ORA-16627
DGMGRL>
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
Failed.
DGMGRL> show CONFIGURATION
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
--开始排查,退出重新登录也是报错
DGMGRL> quit
[oracle@JiekeXu_p2 ~]$ dgmgrl sys/oracle@prod1
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.
Connected.
DGMGRL> show CONFIGURATION
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
Failed.
DGMGRL>
DGMGRL> SHOW DATABASE VERBOSE SBDB1;
Database - sbdb1
Role: PHYSICAL STANDBY
Intended State: OFFLINE
Transport Lag: (unknown)
Apply Lag: (unknown)
Real Time Query: OFF
Instance(s):
SBDB1
Properties:
DGConnectIdentifier = 'sbdb1'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'PROD1, SBDB1'
LogFileNameConvert = 'PROD1, SBDB1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'SBDB1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JiekeXu_p2)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SBDB1_DGMGRL.us.oracle.com)(INSTANCE_NAME=SBDB1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SHUTDOWN
DGMGRL> SHOW DATABASE VERBOSE PROD1;
Database - prod1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Properties:
DGConnectIdentifier = 'prod1'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '10'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'SBDB1, PROD1'
LogFileNameConvert = 'SBDB1, PROD1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'PROD1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JiekeXu_p1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROD1_DGMGRL.us.oracle.com)(INSTANCE_NAME=PROD1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
--检查主备库日志传输均是同步模式
DGMGRL> EDIT DATABASE PROD1 SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
Failed.
DGMGRL> edit database 'PROD1' set PROPERTY 'LogXptMode'='SYNC';
Object "PROD1" was not found
DGMGRL>
DGMGRL> edit database PROD1 set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL>
DGMGRL> edit database SBDB1 set PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
Failed.
--这里主库重启了一次,断开需要重新连接
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
ORA-03113: end-of-file on communication channel
Process ID: 3068
Session ID: 70 Serial number: 155
Configuration details cannot be determined by DGMGRL
DGMGRL>
DGMGRL> DGMGRL>
DGMGRL>
DGMGRL> quit
[oracle@JiekeXu_p2 ~]$ dgmgrl sys/oracle@prod1
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.
Connected.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode
Failed.
DGMGRL> show CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> START OBSERVER;
Observer started
--这里新开一个窗口进行操作
[oracle@JiekeXu_p2 ~]$ dgmgrl sys/oracle@prod1
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.
Connected.
DGMGRL>
DGMGRL> show CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> enable FAST_START FAILOVER;
Error: ORA-16651: requirements not met for enabling fast-start failover
Failed.
DGMGRL> help add
Adds a standby database to the broker configuration
Syntax:
ADD DATABASE <database name>
[AS CONNECT IDENTIFIER IS <connect identifier>]
[MAINTAINED AS {PHYSICAL|LOGICAL}];
--这里检测发现状态均是未知的
DGMGRL> show database SBDB1;
Database - sbdb1
Role: PHYSICAL STANDBY
Intended State: OFFLINE
Transport Lag: (unknown)
Apply Lag: (unknown)
Real Time Query: OFF
Instance(s):
SBDB1
Database Status:
SHUTDOWN
DGMGRL> show database PROD1;
Database - prod1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Database Status:
SUCCESS
--这里尝试删除 SBDB1 备库重新添加
DGMGRL> help delete
Unrecognized command "delete", try "help"
DGMGRL> help move
Unrecognized command "move", try "help"
DGMGRL> help
The following commands are available:
add Adds a standby database to the broker configuration
connect Connects to an Oracle database instance
convert Converts a database from one type to another
create Creates a broker configuration
disable Disables a configuration, a database, or fast-start failover
edit Edits a configuration, database, or instance
enable Enables a configuration, a database, or fast-start failover
exit Exits the program
failover Changes a standby database to be the primary database
help Displays description and syntax for a command
quit Exits the program
reinstate Changes a database marked for reinstatement into a viable standby
rem Comment to be ignored by DGMGRL
remove Removes a configuration, database, or instance
show Displays information about a configuration, database, or instance
shutdown Shuts down a currently running Oracle database instance
sql Executes a SQL statement
start Starts the fast-start failover observer
startup Starts an Oracle database instance
stop Stops the fast-start failover observer
switchover Switches roles between a primary and standby database
Use "help <command>" to see syntax for individual commands
DGMGRL> help remove
Removes a configuration, database, or instance
Syntax:
REMOVE CONFIGURATION [PRESERVE DESTINATIONS];
REMOVE DATABASE <database name> [PRESERVE DESTINATIONS];
REMOVE INSTANCE <instance name> [ON DATABASE <database name>];
DGMGRL> remove database SBDB1;
Removed database "sbdb1" from the configuration
DGMGRL>
DGMGRL>
DGMGRL> help add
Adds a standby database to the broker configuration
Syntax:
ADD DATABASE <database name>
[AS CONNECT IDENTIFIER IS <connect identifier>]
[MAINTAINED AS {PHYSICAL|LOGICAL}];
DGMGRL> add database SBDB1 as connect IDENTIFIER IS SBDB1;
Database "sbdb1" added
DGMGRL>
DGMGRL> help show
Displays information about a configuration, database, or instance
Syntax:
SHOW CONFIGURATION [VERBOSE];
SHOW DATABASE [VERBOSE] <database name> [<property name>];
SHOW INSTANCE [VERBOSE] <instance name> [<property name>]
[ON DATABASE <database name>];
SHOW FAST_START FAILOVER;
DGMGRL> SHOW CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
-- 重新添加后备库还是 disabled
DGMGRL> SHOW CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
--到这里终于检查到了是由于备库参数没有修改,配置好 dg_broker_start 参数后, enable 备库。
DGMGRL> help enable
Enables a configuration, a database, or fast-start failover
Syntax:
ENABLE CONFIGURATION;
ENABLE DATABASE <database name>;
ENABLE FAST_START FAILOVER [CONDITION <condition>];
DGMGRL> ENABLE DATABASE SBDB1;
Enabled.
DGMGRL> SHOW CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
--修改模式为最大保护模式成功,start failover 也成功了。
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
DGMGRL>
DGMGRL> enable FAST_START FAILOVER;
Enabled.
DGMGRL> SHOW CONFIGURATION;
Configuration - sbdb1_broker
Protection Mode: MaxAvailability
Databases:
prod1 - Primary database
sbdb1 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
DGMGRL>
这个步骤算是基本完成,特此记录学习。