在这篇文章中,我们将带领您了解Oracle中Failover和Switchover的区别的全貌,包括oracleswitchover_status的相关情况。同时,我们还将为您介绍有关-failove
在这篇文章中,我们将带领您了解Oracle 中 Failover 和 Switchover 的区别的全貌,包括oracle switchover_status的相关情况。同时,我们还将为您介绍有关-failover-abort-not-elected master mymaster问题、11G、12C Data Guard Physical Standby Switchover 转换参考手册、12c DataGuard switchover to 'primary'、4.1 ORACLE DATAGUARD SWITCHOVER 步骤的知识,以帮助您更好地理解这个主题。
本文目录一览:- Oracle 中 Failover 和 Switchover 的区别(oracle switchover_status)
- -failover-abort-not-elected master mymaster问题
- 11G、12C Data Guard Physical Standby Switchover 转换参考手册
- 12c DataGuard switchover to 'primary'
- 4.1 ORACLE DATAGUARD SWITCHOVER 步骤
Oracle 中 Failover 和 Switchover 的区别(oracle switchover_status)
1. 什么是 Failover?
2. 什么是 Switchover?
3. 配置 Connect Time Failover
4. 配置 Transparent Application Failover
1. 什么是 Failover?
A failover is when the primary database is unavailable. Failover is performed only in the event of a catastrophic failure of the primary database, and the failover results in a transition of a standby database to the primary role. The database administrator can configure Data Guard to ensure no data loss.
2. 什么是 Switchover?
A switchover is a role reversal between the primary database and one of its standby databases. A switchover ensures no data loss. This is typically done for planned maintenance of the primary system. During a switchover, the primary database transitions to a standby role, and the standby database transitions to the primary role. The transition occurs without having to re-create either database.
3. 配置 Connect Time Failover
Connect time failover will reroute incoming connections to the instance that has just become primary. This type of failover should work in cases where the old primary node is down, old primary network is down, old primary listener is down,
or old primary instance is now the standby.
When the old primary network is down, failover functionality is built into the basic layer of Oracle Net. We simply tcp timeout and fail to the next host in the list.
DBname_alias =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_host)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_host)(PORT = 1521))
)
(CONNECT_DATA =
(INSTANCE_NAME=DBname_primary)
(SERVICE_NAME = DBname)
)
)
4. 配置 Transparent Application Failover
For application failover, all existing connections from the current primary must failover to the new primary. One of the biggest obstacles to overcome is the lag time from when the standby database becomes the primary database. Client connections should continue to retry the failover until the standby has been opened as the new production.
This could be done by having an alias similar to the following:
DBname_TAF=
(DESCRIPTION=
(address_list=
(load_balance=off)
(failover=on)
(ADDRESS = (PROTOCOL = TCP)(HOST = primary_host)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = standby_host)(PORT = 1521))
)
(CONNECT_DATA=
(instance_name=DBname_primary)
(SERVICE_NAME=DBname)
(FAILOVER_MODE=
(TYPE=session)
(METHOD=BASIC)
(RETRIES=200)
(DELAY = 3)))
)
TAF will try to failover to the second node in the address_list. If it cannot connect, it will wait 3 seconds and retry again. It will retry a total of 200 times. This delay will provide the DBA with enough time to perform a switchover or activate the standby as the new production.
参考资料:
Switchover and Failover Operations
Oracle Database Failover and Switchover
-failover-abort-not-elected master mymaster问题
redis配置sentinel,master shutdown后主从切换失败,提示错误
-failover-abort-not-elected master mymaster x.x.x.x 6379
原因是sentinel.conf缺少配置,若redis.conf中添加
protected-mode yes
bind 0.0.0.0
则sentinel.conf中添加该属性。
11G、12C Data Guard Physical Standby Switchover 转换参考手册
12c DataGuard switchover to 'primary'
一、环境描述
Oracle 12c
RHEL 7
二、操作
注意:需要在物理standby节点执行切换,因为主节点要重启。
1.查看配置
DGMGRL> show configuration;
Configuration - dg_config
Protection Mode: MaxAvailability
Members:
orcl - Primary database
orcldg - Physical standby database
Fast-Start Failover: disABLED
Configuration Status:
SUCCESS (status updated 30 seconds ago)
2.验证主库
DGMGRL> validate database orcl;
Database Role: Primary database
Ready for Switchover: Yes
Flashback Database Status:
orcl: Off
3.验证物理备库
DGMGRL> validate database orcldg;
Database Role: Physical standby database
Primary Database: orcl
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
orcl: Off
orcldg: On
Standby Apply-Related information:
Apply State: Running
Apply Lag: 13 hours 29 minutes 48 seconds (computed 1 second ago)
Apply Delay: 0 minutes
4.进行切换
DGMGRL> switchover to orcldg;
Performing switchover Now, please wait...
New primary database "orcldg" is opening...
Oracle Clusterware is restarting database "orcl" ...
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
shut down instance "orcl" of database "orcl"
start up instance "orcl" of database "orcl"
5.切换后确认
DGMGRL> show configuration;
Configuration - dg_config
Protection Mode: MaxAvailability
Members:
orcldg - Primary database
orcl - Physical standby database
Fast-Start Failover: disABLED
Configuration Status:
SUCCESS (status updated 30 seconds ago)
DGMGRL>
4.1 ORACLE DATAGUARD SWITCHOVER 步骤
-
验证主库是否能执行角色转换到备库 原主库执行
sql> SELECT SWITCHOVER_STATUS FROM V$DATABASE; SWITCHOVER_STATUS ----------------- TO STANDBY 1 row selected
-
开始把物理主库改变为物理备库 在原主库执行。
sql> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY; 或 sql> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY with session shutdown;
- Note
- 如果有活动的session可以使用此选项,否则转换会遇到ORA-01093错误,也可以杀掉活动会话或等活动会话后进行转换.
-
关闭并重启主库(原主库执行)
sql> SHUTDOWN IMMEDIATE; sql> STARTUP MOUNT;
-
验证备库是否能执行角色转换到主库(原备库执行)
sql> SELECT SWITCHOVER_STATUS FROM V$DATABASE; SWITCHOVER_STATUS ----------------- TO_PRIMARY 1 row selected
-
开始把物理备库转换成物理主库(原备库执行)
sql> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
如果报ORA-16139: media recovery required,可能是由于未应用日志引起,可先执行 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE disCONNECT FROM SESSION;
-
打开备库,然后关闭重启.(原备库执行)
sql> ALTER DATABASE OPEN; sql> SHUTDOWN IMMEDIATE; sql> STARTUP;
-
验证是否转换成功(原备库执行)
sql> ALTER SYstem SWITCH LOGFILE;
-
应用归档日志(原主库上执行)
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE disCONNECT FROM SESSION; --非实时应用日志,此为应用归档日志
-
关于Oracle 中 Failover 和 Switchover 的区别和oracle switchover_status的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于-failover-abort-not-elected master mymaster问题、11G、12C Data Guard Physical Standby Switchover 转换参考手册、12c DataGuard switchover to 'primary'、4.1 ORACLE DATAGUARD SWITCHOVER 步骤的相关知识,请在本站寻找。
本文标签: