Placing a Database into a Quiesced State

Once all non-DBA sessions become inactive, the ALTER SYSTEM QUIESCE RESTRICTED statement completes, and the database is in a quiesced state. In an Oracle Real Application Clusters environment, this statement affects all instances, not just the one that issues the statement.

The ALTER SYSTEM QUIESCE RESTRICTED statement may wait a long time for active sessions to become inactive. You can determine the sessions that are blocking the quiesce operation by querying the V$BLOCKING_QUIESCE view. This view returns only a single column: SID (Session ID). You can join it with V$SESSION to get more information about the session, as shown in the following example:

select bl.sid, user, osuser, type, program
from v$blocking_quiesce bl, v$session se
where bl.sid = se.sid;

For both dedicated and shared server connections, all non-DBA logins after this statement is issued are queued by the Database Resource Manager, and are not allowed to proceed. To the user, it appears as if the login is hung. The login will resume when the database is unquiesced.

The following statement restores the database to normal operation:
ALTER SYSTEM UNQUIESCE;

From 11g R2 e10595.pdf   第 125/1000 页

SQL> alter system quiesce restricted;

系统已更改。

已用时间:  00: 00: 03.04

SQL> select host_name,instance_name,status,active_state from gv$instance;

HOST_NAME    INSTANCE_NAM STATUS       ACTIVE_ST
———— ———— ———— ———
THINKPAD     test         OPEN         QUIESCED

SQL> alter system unquiesce;

系统已更改。

SQL> select host_name,instance_name,status,active_state from gv$instance;

HOST_NAME    INSTANCE_NAM STATUS       ACTIVE_ST
———— ———— ———— ———
THINKPAD     test         OPEN         NORMAL

后台日志:

Sat Oct 24 14:51:50 2009
Database in quiesce mode
Sat Oct 24 14:57:18 2009
Stopping background process CJQ0
Sat Oct 24 15:05:31 2009
Database out of quiesce mode

Random Posts

留下评论