存在 alter database read only with application吗?

[复制链接]
查看11 | 回复1 | 2010-11-11 18:03:08 | 显示全部楼层 |阅读模式
本帖最后由 jayli426 于 2013-2-21 07:59 编辑
我的问题是这样的:
因为Oracle11G 可以 数据库在read only的状态,也能支持 apply log
这个状态就是read only with application
可是我却没有找到
alter database read only with application 这样一个命令
那么Oracle是如何实现数据块状态为read only with application 呢?
请看这个URL
http://juliandyke.wordpress.com/2010/10/14/oracle-11gr2-active-data-guard/
If you start a database in SQL*Plus using the STARTUP command and then invoke managed recovery,
the Active Data Guard will be enabled.
For example:
[oracle@server14]$ sqlplus / as sysdba
SQL> STARTUP
ORACLE instance started.
Total System Global Area 6497189888 bytes
Fixed Size 2238672 bytes
Variable Size 3372222256 bytes
Database Buffers 3103784960 bytes
Redo Buffers 18944000 bytes
Database mounted
Database opened
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLEOPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
USING CURRENT LOGFILE
WITH SESSION SHUTDOWN;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLEOPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
原来数据库状态变成READ ONLY WITH APPLY
并没有这样直接的命令
alter database read only with application
而是要靠
先打开数据后,然后再启动日志应用,数据库的状态就自动变成了 read only with application
那么我的问题是,如果我执行
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
是否数据库又变回了 read only状态?
但这好像有个稍微wierd地方
就是
However, if the database is started in SQL*Plus using the STARTUP MOUNT command and then managed recovery is invoked,
Active Data Guard will not be enabled.
[oracle@server14]$ sqlplus / as sysdba
SQL> STARTUP MOUNT
ORACLE instance started.
Total System Global Area 6497189888 bytes
Fixed Size 2238672 bytes
Variable Size 3372222256 bytes
Database Buffers 3103784960 bytes
Redo Buffers 18944000 bytes
Database mounted
Database opened
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLEOPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
USING CURRENT LOGFILE
WITH SESSION SHUTDOWN;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLEOPEN_MODE
---------------- --------------------
PHYSICAL STANDBY MOUNTED
就是说如果数据库已经在MOUNTED状态下,但是又处于日志应用状态,这时再想变成 read only with option
却不行了
因为这是数据库不会再允许执行
alter database read only
不知Oracle基于什么考虑不让执行这个?


回复

使用道具 举报

千问 | 2010-11-11 18:03:08 | 显示全部楼层
> 如果我执行
> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
> 是否数据库又变回了 read only状态?
Yes. Try it.
> 就是说如果数据库已经在MOUNTED状态下,但是又处于日志应用状态,这时再想变成 read only with option却不行了
> 因为这是数据库不会再允许执行
> alter database read only
> 不知Oracle基于什么考虑不让执行这个?
Because you never opened the database. "Alter database read only" seems to be an old command. Newer versions only have "alter database open read only", emphasizing the point that putting it in read only mode can only be done at the time you open the database, not later.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行