0

我在“MOUNTED”模式下有备用数据库(版本:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0)。

SQL> select database_role,open_mode from v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED

当我想将 OPEN_MODE 从“MOUNTED”更改为“READ ONLY WITH APPLY”模式时,将发生错误(ORA-01093)。

SQL> SHUTDOWN IMMEDIATE;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 2.7793E+10 bytes
Fixed Size                  2189008 bytes
Variable Size            1.1207E+10 bytes
Database Buffers         1.6576E+10 bytes
Redo Buffers                7385088 bytes
Database mounted.
SQL> ALTER DATABASE OPEN READ ONLY;

Database altered.

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected

如何修复错误,换句话说如何杀死其他会话?

4

3 回答 3

0

您正在正常挂载中启动 db

假设您处于会话断开模式的自动恢复...

然后您将停止恢复,然后以只读模式打开

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER DATABASE OPEN READ ONLY;

然后开启自动恢复

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
于 2019-10-09T22:57:59.373 回答
0

我们之前已将数据库从版本 10g(10.2.0.4.0) 升级到 11gR2(11.2.0.1.0),然后为了使用 Active Data Guard,兼容参数必须至少设置为 11.0.0。兼容参数的当前值为 10.2.0.4.0,如以下查询所示:

SQL> show parameter compatible

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
compatible                           string      10.2.0.4.0
于 2018-01-17T08:42:54.863 回答
0

正确的语法如下所示:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE;
于 2018-01-17T06:40:01.387 回答