如何将PHYSICAL STANDBY设置为"只读应用"模式

时间:2017-10-05 10:03:15

标签: oracle11gr2 dataguard

我在" MOUNTED"中有备用数据库(版本:Oracle Database 11g企业版版本11.2.0.1.0)。模式。

SQL> select database_role,open_mode from v$database;

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

当我想从" MOUNTED"更改OPEN_MODE时到#34;只读应用"模式,将发生错误(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

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

3 个答案:

答案 0 :(得分:0)

正确的语法如下所示:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE;

答案 1 :(得分: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

答案 2 :(得分:0)

您正在以普通挂载方式启动数据库

让我们说您处于会话断开连接模式下的自动恢复...

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

android.databinding.incremental=true

然后将自动恢复置于

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