重庆思庄Oracle、Redhat认证学习论坛

标题: oracle主库在做switchover切换时报ORA-01093 [打印本页]

作者: 王亮    时间: 2020-8-25 10:42
标题: oracle主库在做switchover切换时报ORA-01093
1.主库在进行物理主备库角色转换的时候遇到ORA-01093错误
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY;
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

查看switchover_status状态
SQL> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE ----------有活动会话。
此错误的因为主库中有活动的会话造成的,解决的办法有两种:(推荐第二两种方法)
1.查询出活动会话,然后杀掉活动会话,再重新执行该命令,但如果活动会话较多时,操作很麻烦,而且还会遇到有些会话,直接kill不掉,且出现ORA-01031的错误;
2.在该命令后面加上with session shutdown即可
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

参考来源:https://www.linuxidc.com/linux/2014-04/100795.htm







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2