Oracle单实例ASM搭建DG_BROKER(Linux7.4_19C)

2024-06-03 22:48

本文主要是介绍Oracle单实例ASM搭建DG_BROKER(Linux7.4_19C),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、检测准备库是否能正常切换

主库:
alter database commit to switchover to physical standby with session shutdown;备库:
alter database commit to switchover to primary with session shutdown;
alter database open;主库:
startup;

2、确保主备库都是spfile启动

主库:
SYS@dgpri>show parameter spfile;NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
spfile				     string	 +DATA/ZZZDGPRI/parameterfile/spfile.276.1025373149**备库:**
SYS@dgphy>show parameter spfile;NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
spfile				     string	 +DATADG/ZZZDGPHY/parameterfile/spfile.258.1025389845

3、修改dg_broker_start参数为TRUE

主库:
SYS@dgpri>show parameter dg_broker;NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1		     string	 /u01/app/oracle/product/19.2.0.0.0/dbhome_1/dbs/dr1ZZZDGPRI.dat
dg_broker_config_file2		     string	 /u01/app/oracle/product/19.2.0.0.0/dbhome_1/dbs/dr2ZZZDGPRI.dat
dg_broker_start 		     boolean	 FALSESYS@dgpri>alter system set dg_broker_start = true;System altered.SYS@dgpri>host ps -ef | grep dmon
oracle   35590     1  0 18:39 ?        00:00:00 ora_dmon_dgpri
oracle   35639  9449  0 18:39 pts/2    00:00:00 /bin/bash -c ps -ef | grep dmon
oracle   35641 35639  0 18:39 pts/2    00:00:00 grep dmon备库:
SYS@dgphy>show parameter dg_broker;NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1		     string	 /u01/app/oracle/product/19.2.0.0.0/dbhome_1/dbs/dr1ZZZDGPHY.dat
dg_broker_config_file2		     string	 /u01/app/oracle/product/19.2.0.0.0/dbhome_1/dbs/dr2ZZZDGPHY.dat
dg_broker_start 		     boolean	 FALSESYS@dgphy>alter system set dg_broker_start = true;System altered.SYS@dgphy>host ps -ef | grep dmon
oracle   14377     1  0 18:39 ?        00:00:00 ora_dmon_dgphy
oracle   14410  8169  0 18:40 pts/2    00:00:00 /bin/bash -c ps -ef | grep dmon
oracle   14412 14410  0 18:40 pts/2    00:00:00 grep dmon

4、修改dg_broker参数文件位置

主库:
SYS@dgpri>alter system set dg_broker_config_file1 = '+DATA/dr1ZZZDGPRI.dat' scope = spfile;System altered.SYS@dgpri>alter system set dg_broker_config_file2 = '+DATA/dr2ZZZDGPRI.dat' scope = spfile;System altered.备库:
SYS@dgphy>alter system set dg_broker_config_file1 = '+DATADG/dr1ZZZDGPHY.dat' scope = spfile;System altered.SYS@dgphy>alter system set dg_broker_config_file2 = '+DATADG/dr2ZZZDGPHY.dat' scope = spfile;System altered.

重启主备库

5、配置DG_BROKER监听和TNS

可以使用默认监听,也可以创建一个非默认监听,这里使用默认监听。查看domain,如果存在则需要在服务后加上domain后缀
SYS@dgpri>show parameter domainNAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
db_domain			     string**配置LISTENER**主库:
[grid@kkk admin]$ cat listener.ora
#Backup file is  /u01/app/grid/crsdata/kkk/output/listener.ora.bak.kkk.grid line added by Agent
# listener.ora Network Configuration File: /u01/app/19.2.0.0.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.16)(PORT = 1521))))SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(ORACLE_HOME=/u01/app/oracle/product/19.2.0.0.0/dbhome_1)(GLOBAL_DBNAME=ZZZDGPRI)(SID_NAME=dgpri))(SID_DESC=(ORACLE_HOME=/u01/app/oracle/product/19.2.0.0.0/dbhome_1)(GLOBAL_DBNAME=ZZZDGPRI_DGMGRL)		#DG_BROKER专用服务名(SID_NAME=dgpri)))ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON		# line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=ON		# line added by Agent备库:[grid@hhh admin]$ cat listener.ora 
#Backup file is  /u01/app/grid/crsdata/hhh/output/listener.ora.bak.hhh.grid line added by Agent
# listener.ora Network Configuration File: /u01/app/19.2.0.0.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.17)(PORT = 1521))))SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(ORACLE_HOME=/u01/app/oracle/product/19.2.0.0.0/dbhome_1)(GLOBAL_DBNAME=ZZZDGPHY)(SID_NAME=dgphy))(SID_DESC=(ORACLE_HOME=/u01/app/oracle/product/19.2.0.0.0/dbhome_1)(GLOBAL_DBNAME=ZZZDGPHY_DGMGRL)(SID_NAME=dgphy)))ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON		# line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=ON		# line added by Agent添加后lsnrctl reload配置TNS主备库tnsnames.ora文件添加如下TNS_ZZZDGPRI_DGMGRL=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.16)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ZZZDGPRI_DGMGRL)))TNS_ZZZDGPHY_DGMGRL=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.17)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ZZZDGPHY_DGMGRL)))

6、配置DG_BROKER参数文件

DGMGRL> create configuration c1 as primary database is ZZZDGPRI connect identifier is TNS_ZZZDGPRI_DGMGRL
> ;**12c环境直接添加备库会报错,清空log_archive_dest_n**
DGMGRL> add database ZZZDGPHY as connect identifier is TNS_ZZZDGPHY_DGMGRL maintained as PHYSICAL;
Error: ORA-16698: member has a LOG_ARCHIVE_DEST_n parameter with SERVICE attribute set#清空主备库log_archive_dest_n参数DGMGRL> add database ZZZDGPHY as connect identifier is TNS_ZZZDGPHY_DGMGRL maintained as PHYSICAL;
Database "zzzdgphy" added启用参数文件
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration verbose;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - Physical standby database Properties:FastStartFailoverThreshold      = '30'OperationTimeout                = '30'TraceLevel                      = 'USER'FastStartFailoverLagLimit       = '30'CommunicationTimeout            = '180'ObserverReconnect               = '0'FastStartFailoverAutoReinstate  = 'TRUE'FastStartFailoverPmyShutdown    = 'TRUE'BystandersFollowRoleChange      = 'ALL'ObserverOverride                = 'FALSE'ExternalDestination1            = ''ExternalDestination2            = ''PrimaryLostWriteAction          = 'CONTINUE'ConfigurationWideServiceName    = 'ZZZ_CFG'Fast-Start Failover:  DisabledConfiguration Status:
SUCCESSDGMGRL> show database zzzdgpri verbose;
Error: ORA-16606: unable to find property "verbose"DGMGRL> show database verbose zzzdgpriDatabase - zzzdgpriRole:               PRIMARYIntended State:     TRANSPORT-ONInstance(s):dgpriProperties:DGConnectIdentifier             = 'tns_zzzdgpri_dgmgrl'ObserverConnectIdentifier       = ''FastStartFailoverTarget         = ''PreferredObserverHosts          = ''LogShipping                     = 'ON'RedoRoutes                      = ''LogXptMode                      = 'ASYNC'DelayMins                       = '0'Binding                         = 'optional'MaxFailure                      = '0'ReopenSecs                      = '300'NetTimeout                      = '30'RedoCompression                 = 'DISABLE'PreferredApplyInstance          = ''ApplyInstanceTimeout            = '0'ApplyLagThreshold               = '30'TransportLagThreshold           = '30'TransportDisconnectedThreshold  = '30'ApplyParallel                   = 'AUTO'ApplyInstances                  = '0'StandbyFileManagement           = ''ArchiveLagTarget                = '0'LogArchiveMaxProcesses          = '0'LogArchiveMinSucceedDest        = '0'DataGuardSyncLatency            = '0'LogArchiveTrace                 = '0'LogArchiveFormat                = ''DbFileNameConvert               = ''LogFileNameConvert              = ''ArchiveLocation                 = ''AlternateLocation               = ''StandbyArchiveLocation          = ''StandbyAlternateLocation        = ''InconsistentProperties          = '(monitor)'InconsistentLogXptProps         = '(monitor)'LogXptStatus                    = '(monitor)'SendQEntries                    = '(monitor)'RecvQEntries                    = '(monitor)'HostName                        = 'kkk'StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.59.16)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ZZZDGPRI_DGMGRL)(INSTANCE_NAME=dgpri)(SERVER=DEDICATED)))'TopWaitEvents                   = '(monitor)'SidName                         = '(monitor)'Log file locations:Alert log               : /u01/app/oracle/diag/rdbms/zzzdgpri/dgpri/trace/alert_dgpri.logData Guard Broker log   : /u01/app/oracle/diag/rdbms/zzzdgpri/dgpri/trace/drcdgpri.logDatabase Status:
SUCCESSDGMGRL> show database verbose zzzdgphyDatabase - zzzdgphyRole:               PHYSICAL STANDBYIntended State:     APPLY-ONTransport Lag:      0 seconds (computed 0 seconds ago)Apply Lag:          0 seconds (computed 0 seconds ago)Average Apply Rate: 30.00 KByte/sActive Apply Rate:  0 Byte/sMaximum Apply Rate: 0 Byte/sReal Time Query:    ONInstance(s):dgphyProperties:DGConnectIdentifier             = 'tns_zzzdgphy_dgmgrl'ObserverConnectIdentifier       = ''FastStartFailoverTarget         = ''PreferredObserverHosts          = ''LogShipping                     = 'ON'RedoRoutes                      = ''LogXptMode                      = 'ASYNC'DelayMins                       = '0'Binding                         = 'optional'MaxFailure                      = '0'ReopenSecs                      = '300'NetTimeout                      = '30'RedoCompression                 = 'DISABLE'PreferredApplyInstance          = ''ApplyInstanceTimeout            = '0'ApplyLagThreshold               = '30'TransportLagThreshold           = '30'TransportDisconnectedThreshold  = '30'ApplyParallel                   = 'AUTO'ApplyInstances                  = '0'StandbyFileManagement           = ''ArchiveLagTarget                = '0'LogArchiveMaxProcesses          = '0'LogArchiveMinSucceedDest        = '0'DataGuardSyncLatency            = '0'LogArchiveTrace                 = '0'LogArchiveFormat                = ''DbFileNameConvert               = ''LogFileNameConvert              = ''ArchiveLocation                 = ''AlternateLocation               = ''StandbyArchiveLocation          = ''StandbyAlternateLocation        = ''InconsistentProperties          = '(monitor)'InconsistentLogXptProps         = '(monitor)'LogXptStatus                    = '(monitor)'SendQEntries                    = '(monitor)'RecvQEntries                    = '(monitor)'HostName                        = 'hhh'StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.59.17)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ZZZDGPHY_DGMGRL)(INSTANCE_NAME=dgphy)(SERVER=DEDICATED)))'TopWaitEvents                   = '(monitor)'SidName                         = '(monitor)'Log file locations:Alert log               : /u01/app/oracle/diag/rdbms/zzzdgphy/dgphy/trace/alert_dgphy.logData Guard Broker log   : /u01/app/oracle/diag/rdbms/zzzdgphy/dgphy/trace/drcdgphy.logDatabase Status:
SUCCESS

7、switchover测试

DGMGRL> help switchover;Switches roles between a primary and standby databaseSyntax:SWITCHOVER TO <standby database name> [WAIT [<timeout in seconds>]];DGMGRL> switchover to ZZZDGPHY;
Performing switchover NOW, please wait...
Operation requires a connection to database "zzzdgphy"
Connecting ...
Connected to "ZZZDGPHY"
Connected as SYSDBA.
New primary database "zzzdgphy" is opening...
Oracle Clusterware is restarting database "zzzdgpri" ...
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to "ZZZDGPRI"
Connected to "ZZZDGPRI"
Switchover succeeded, new primary is "zzzdgphy"DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgphy - Primary databasezzzdgpri - Physical standby database Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS   (status updated 88 seconds ago)DGMGRL> switchover to zzzdgpri;
Performing switchover NOW, please wait...
Operation requires a connection to database "zzzdgpri"
Connecting ...
Connected to "ZZZDGPRI"
Connected as SYSDBA.
New primary database "zzzdgpri" is opening...
Oracle Clusterware is restarting database "zzzdgphy" ...
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to an idle instance.
Connected to "ZZZDGPHY"
Connected to "ZZZDGPHY"
Switchover succeeded, new primary is "zzzdgpri"
DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - Physical standby database Warning: ORA-16854: apply lag could not be determinedFast-Start Failover:  DisabledConfiguration Status:
WARNING   (status updated 8 seconds ago)DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - Physical standby database Warning: ORA-16854: apply lag could not be determinedFast-Start Failover:  DisabledConfiguration Status:
WARNING   (status updated 36 seconds ago)DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - Physical standby database Warning: ORA-16854: apply lag could not be determinedFast-Start Failover:  DisabledConfiguration Status:
WARNING   (status updated 44 seconds ago)DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - Physical standby database Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS   (status updated 39 seconds ago)修改属性EDIT { RECOVERY_APPLIANCE | DATABASE | FAR_SYNC }<object name> SET PROPERTY <property name> = <value>;DGMGRL> edit database zzzdgpri set property StandbyFileManagement = 'AUTO';
Property "standbyfilemanagement" updated
DGMGRL> edit database zzzdgphy set property StandbyFileManagement = 'AUTO';
Connected to "ZZZDGPHY"
Property "standbyfilemanagement" updated主库:
SYS@dgpri>select name,db_unique_name,database_role,open_mode,switchover_status from v$database;NAME		DB_UNIQU DATABASE_ROLE	  OPEN_MODE	       SWITCHOVER_STATUS
--------------- -------- ---------------- -------------------- ------------------
ZZZ		ZZZDGPRI PRIMARY	  READ WRITE	       TO STANDBYSYS@dgpri>archive log list;
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     57
Next log sequence to archive   59
Current log sequence	       59备库:
SYS@dgphy>select name,db_unique_name,database_role,open_mode,switchover_status from v$database;NAME		DB_UNIQU DATABASE_ROLE	  OPEN_MODE	       SWITCHOVER_STATUS
--------------- -------- ---------------- -------------------- ------------------
ZZZ		ZZZDGPHY PHYSICAL STANDBY READ ONLY WITH APPLY NOT ALLOWEDSYS@dgphy>select max(sequence#) from v$archived_log where name like '+FRA%' and applied in ('YES','IN-MEMORY');MAX(SEQUENCE#)
--------------58

8、开启FAILOVER


开启主备库闪回
主库:
YS@dgpri>select flashback_on from v$database;FLA
---
NOSYS@dgpri>alter database flashback on;Database altered.SYS@dgpri>select flashback_on from v$database;FLA
---
YES备库:SYS@dgphy>select flashback_on from v$database;FLA
---
NOSYS@dgphy>alter database flashback on;
alter database flashback on
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is activeSYS@dgphy>alter database recover managed standby database cancel;Database altered.SYS@dgphy>alter database flashback on;Database altered.SYS@dgphy>select flashback_on from v$database;FLA
---
YESSYS@dgphy>alter database recover managed standby database using current logfile disconnect;Database altered.DGMGRL> enable fast_start failover;
Enabled in Potential Data Loss Mode.DGMGRL> show configuration verbose;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgpri - Primary databasezzzdgphy - (*) Physical standby database (*) Fast-Start Failover targetProperties:FastStartFailoverThreshold      = '30'OperationTimeout                = '30'TraceLevel                      = 'USER'FastStartFailoverLagLimit       = '30'CommunicationTimeout            = '180'ObserverReconnect               = '0'FastStartFailoverAutoReinstate  = 'TRUE'FastStartFailoverPmyShutdown    = 'TRUE'BystandersFollowRoleChange      = 'ALL'ObserverOverride                = 'FALSE'ExternalDestination1            = ''ExternalDestination2            = ''PrimaryLostWriteAction          = 'CONTINUE'ConfigurationWideServiceName    = 'ZZZ_CFG'Fast-Start Failover: Enabled in Potential Data Loss ModeLag Limit:          30 secondsThreshold:          30 secondsActive Target:      zzzdgphyPotential Targets:  "zzzdgphy"zzzdgphy   validObserver:           kkkShutdown Primary:   TRUEAuto-reinstate:     TRUEObserver Reconnect: (none)Observer Override:  FALSEConfiguration Status:
SUCCESS开启observer[oracle@kkk ~]$ dgmgrl
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Mon Jan 13 20:09:11 2020
Version 19.2.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.Welcome to DGMGRL, type "help" for information.
DGMGRL> help start;Starts the fast-start failover observerSyntax:START OBSERVER [FILE=<observer file>]; START OBSERVER [<observer name>] [FILE IS <observer file>] [LOGFILE IS <observer log file>] [TRACE_LEVEL IS { USER | SUPPORT }]; START OBSERVER [<observer name>] IN BACKGROUND [FILE IS <observer file>] [LOGFILE IS <observer log file>] CONNECT IDENTIFIER IS <connect identifier> [TRACE_LEVEL IS { USER | SUPPORT }]; START OBSERVING [<configuration group name>] [TRACE_LEVEL IS { USER | SUPPORT }];DGMGRL> start observer;
not logged on
Failed to start the observer.DGMGRL> conn sys/oracle@TNS_ZZZDGPRI_DGMGRL as sysdba;
Unrecognized command "conn", try "help"DGMGRL> connect sys/oracle@TNS_ZZZDGPRI_DGMGRL as sysdba;
Connected to "ZZZDGPRI"
Connected as SYSDBA.
DGMGRL> start observer;
[W000 2020-01-13T20:09:58.949+08:00] FSFO target standby is zzzdgphy
Observer 'kkk' started
[W000 2020-01-13T20:09:59.321+08:00] Observer trace level is set to USER
[W000 2020-01-13T20:09:59.321+08:00] Try to connect to the primary.
[W000 2020-01-13T20:09:59.321+08:00] Try to connect to the primary tns_zzzdgpri_dgmgrl.
[W000 2020-01-13T20:09:59.451+08:00] The standby zzzdgphy is ready to be a FSFO target
[W000 2020-01-13T20:10:00.451+08:00] Connection to the primary restored![W000 2020-01-13T20:10:02.451+08:00] Disconnecting from database tns_zzzdgpri_dgmgrl.

9、测试FAILOVER

主库:#主库关闭进行FAILOVER测试SYS@dgpri>shutdown abort;
ORACLE instance shut down.[W000 2020-01-13T20:13:17.939+08:00] Primary database cannot be reached.
[W000 2020-01-13T20:13:17.939+08:00] Fast-Start Failover threshold has not exceeded. Retry for the next 30 seconds
[W000 2020-01-13T20:13:18.940+08:00] Try to connect to the primary.
[W000 2020-01-13T20:13:20.116+08:00] Primary database cannot be reached.
[W000 2020-01-13T20:13:21.116+08:00] Try to connect to the primary.
[W000 2020-01-13T20:13:44.030+08:00] Primary database cannot be reached.
[W000 2020-01-13T20:13:44.030+08:00] Fast-Start Failover threshold has not exceeded. Retry for the next 3 seconds
[W000 2020-01-13T20:13:45.030+08:00] Try to connect to the primary.
[W000 2020-01-13T20:13:46.207+08:00] Primary database cannot be reached.
[W000 2020-01-13T20:13:46.207+08:00] Fast-Start Failover threshold has not exceeded. Retry for the next 1 second
[W000 2020-01-13T20:13:47.207+08:00] Try to connect to the primary.
[W000 2020-01-13T20:13:48.385+08:00] Primary database cannot be reached.
[W000 2020-01-13T20:13:48.385+08:00] Fast-Start Failover threshold has expired.
[W000 2020-01-13T20:13:48.385+08:00] Try to connect to the standby.
[W000 2020-01-13T20:13:48.385+08:00] Making a last connection attempt to primary database before proceeding with Fast-Start Failover.
[W000 2020-01-13T20:13:48.385+08:00] Check if the standby is ready for failover.
[S002 2020-01-13T20:13:48.402+08:00] Fast-Start Failover started...2020-01-13T20:13:48.402+08:00
Initiating Fast-Start Failover to database "zzzdgphy"...
[S002 2020-01-13T20:13:48.402+08:00] Initiating Fast-start Failover.
Performing failover NOW, please wait...
Failover succeeded, new primary is "zzzdgphy"
2020-01-13T20:14:36.545+08:00
[S002 2020-01-13T20:14:36.545+08:00] Fast-Start Failover finished...
[W000 2020-01-13T20:14:36.545+08:00] Failover succeeded. Restart pinging.
[W000 2020-01-13T20:14:36.565+08:00] Primary database has changed to zzzdgphy.
[W000 2020-01-13T20:14:36.573+08:00] Try to connect to the primary.
[W000 2020-01-13T20:14:36.573+08:00] Try to connect to the primary tns_zzzdgphy_dgmgrl.
[W000 2020-01-13T20:14:36.747+08:00] The standby zzzdgpri needs to be reinstated
[W000 2020-01-13T20:14:36.747+08:00] Try to connect to the new standby zzzdgpri.
[W000 2020-01-13T20:14:36.747+08:00] Connection to the primary restored!
ri.
[W000 2020-01-13T20:14:48.772+08:00] Connection to the new standby restored!#当主库修复好后,failover会自动就行修复[W000 2020-01-13T20:15:23.855+08:00] Connection to the new standby restored!
[W000 2020-01-13T20:15:56.921+08:00] Try to connect to the primary tns_zzzdgphy_dgmgrl.
[W000 2020-01-13T20:15:57.921+08:00] Connection to the primary restored!
[W000 2020-01-13T20:15:57.921+08:00] Wait for new primary to be ready to reinstate.
[W000 2020-01-13T20:15:58.927+08:00] New primary is now ready to reinstate.
[W000 2020-01-13T20:15:59.927+08:00] Issuing REINSTATE command.2020-01-13T20:15:59.927+08:00
Initiating reinstatement for database "zzzdgpri"...
Reinstating database "zzzdgpri", please wait...
[W000 2020-01-13T20:16:21.983+08:00] The standby zzzdgpri is ready to be a FSFO target
Reinstatement of database "zzzdgpri" succeeded
2020-01-13T20:17:09.802+08:00
[W000 2020-01-13T20:17:10.085+08:00] Successfully reinstated database zzzdgpri.DGMGRL> connect sys/oracle@TNS_ZZZDGPRI_DGMGRL as sysdba;
Connected to "ZZZDGPRI"
Connected as SYSDBA.
DGMGRL> disable fast_start failover;
Disabled.DGMGRL> show configuration verbose;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgphy - Primary databasezzzdgpri - Physical standby database Properties:FastStartFailoverThreshold      = '30'OperationTimeout                = '30'TraceLevel                      = 'USER'FastStartFailoverLagLimit       = '30'CommunicationTimeout            = '180'ObserverReconnect               = '0'FastStartFailoverAutoReinstate  = 'TRUE'FastStartFailoverPmyShutdown    = 'TRUE'BystandersFollowRoleChange      = 'ALL'ObserverOverride                = 'FALSE'ExternalDestination1            = ''ExternalDestination2            = ''PrimaryLostWriteAction          = 'CONTINUE'ConfigurationWideServiceName    = 'ZZZ_CFG'Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS

10、关闭FAILOVER

DGMGRL> connect sys/oracle@TNS_ZZZDGPRI_DGMGRL as sysdba;
Connected to "ZZZDGPRI"
Connected as SYSDBA.
DGMGRL> disable fast_start failover;
Disabled.DGMGRL> show configuration verbose;Configuration - c1Protection Mode: MaxPerformanceMembers:zzzdgphy - Primary databasezzzdgpri - Physical standby database Properties:FastStartFailoverThreshold      = '30'OperationTimeout                = '30'TraceLevel                      = 'USER'FastStartFailoverLagLimit       = '30'CommunicationTimeout            = '180'ObserverReconnect               = '0'FastStartFailoverAutoReinstate  = 'TRUE'FastStartFailoverPmyShutdown    = 'TRUE'BystandersFollowRoleChange      = 'ALL'ObserverOverride                = 'FALSE'ExternalDestination1            = ''ExternalDestination2            = ''PrimaryLostWriteAction          = 'CONTINUE'ConfigurationWideServiceName    = 'ZZZ_CFG'Fast-Start Failover:  DisabledConfiguration Status:
SUCCESS

这篇关于Oracle单实例ASM搭建DG_BROKER(Linux7.4_19C)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1028338

相关文章

【机器学习】高斯过程的基本概念和应用领域以及在python中的实例

引言 高斯过程(Gaussian Process,简称GP)是一种概率模型,用于描述一组随机变量的联合概率分布,其中任何一个有限维度的子集都具有高斯分布 文章目录 引言一、高斯过程1.1 基本定义1.1.1 随机过程1.1.2 高斯分布 1.2 高斯过程的特性1.2.1 联合高斯性1.2.2 均值函数1.2.3 协方差函数(或核函数) 1.3 核函数1.4 高斯过程回归(Gauss

搭建Kafka+zookeeper集群调度

前言 硬件环境 172.18.0.5        kafkazk1        Kafka+zookeeper                Kafka Broker集群 172.18.0.6        kafkazk2        Kafka+zookeeper                Kafka Broker集群 172.18.0.7        kafkazk3

【IPV6从入门到起飞】5-1 IPV6+Home Assistant(搭建基本环境)

【IPV6从入门到起飞】5-1 IPV6+Home Assistant #搭建基本环境 1 背景2 docker下载 hass3 创建容器4 浏览器访问 hass5 手机APP远程访问hass6 更多玩法 1 背景 既然电脑可以IPV6入站,手机流量可以访问IPV6网络的服务,为什么不在电脑搭建Home Assistant(hass),来控制你的设备呢?@智能家居 @万物互联

pico2 开发环境搭建-基于ubuntu

pico2 开发环境搭建-基于ubuntu 安装编译工具链下载sdk 和example编译example 安装编译工具链 sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib 注意cmake的版本,需要在3.17 以上 下载sdk 和ex

C++操作符重载实例(独立函数)

C++操作符重载实例,我们把坐标值CVector的加法进行重载,计算c3=c1+c2时,也就是计算x3=x1+x2,y3=y1+y2,今天我们以独立函数的方式重载操作符+(加号),以下是C++代码: c1802.cpp源代码: D:\YcjWork\CppTour>vim c1802.cpp #include <iostream>using namespace std;/*** 以独立函数

实例:如何统计当前主机的连接状态和连接数

统计当前主机的连接状态和连接数 在 Linux 中,可使用 ss 命令来查看主机的网络连接状态。以下是统计当前主机连接状态和连接主机数量的具体操作。 1. 统计当前主机的连接状态 使用 ss 命令结合 grep、cut、sort 和 uniq 命令来统计当前主机的 TCP 连接状态。 ss -nta | grep -v '^State' | cut -d " " -f 1 | sort |

Oracle type (自定义类型的使用)

oracle - type   type定义: oracle中自定义数据类型 oracle中有基本的数据类型,如number,varchar2,date,numeric,float....但有时候我们需要特殊的格式, 如将name定义为(firstname,lastname)的形式,我们想把这个作为一个表的一列看待,这时候就要我们自己定义一个数据类型 格式 :create or repla

ORACLE 11g 创建数据库时 Enterprise Manager配置失败的解决办法 无法打开OEM的解决办法

在win7 64位系统下安装oracle11g,在使用Database configuration Assistant创建数据库时,在创建到85%的时候报错,错误如下: 解决办法: 在listener.ora中增加对BlueAeri-PC或ip地址的侦听,具体步骤如下: 1.启动Net Manager,在“监听程序”--Listener下添加一个地址,主机名写计

Java Websocket实例【服务端与客户端实现全双工通讯】

Java Websocket实例【服务端与客户端实现全双工通讯】 现很多网站为了实现即时通讯,所用的技术都是轮询(polling)。轮询是在特定的的时间间隔(如每1秒),由浏览器对服务器发 出HTTP request,然后由服务器返回最新的数据给客服端的浏览器。这种传统的HTTP request 的模式带来很明显的缺点 – 浏 览器需要不断的向服务器发出请求,然而HTTP

Oracle Start With关键字

Oracle Start With关键字 前言 旨在记录一些Oracle使用中遇到的各种各样的问题. 同时希望能帮到和我遇到同样问题的人. Start With (树查询) 问题描述: 在数据库中, 有一种比较常见得 设计模式, 层级结构 设计模式, 具体到 Oracle table中, 字段特点如下: ID, DSC, PID; 三个字段, 分别表示 当前标识的 ID(主键), DSC 当