ITPub博客

首页 > 数据库 > 数据库开发技术 > How a Database Is Quiesced (331)

How a Database Is Quiesced (331)

原创 数据库开发技术 作者:tsinglee 时间:2007-12-08 13:45:02 0 删除 编辑

The database administrator uses the ALTER SYSTEM QUIESCE RESTRICTED statement to quiesce
the database. Only users SYS and SYSTEM can issue the ALTER SYSTEM QUIESCE RESTRICTED
statement. For all instances with the database open, issuing this statement has the
following effect:
■ Oracle instructs the Database Resource Manager in all instances to prevent all
inactive sessions (other than SYS and SYSTEM) from becoming active. No user
other than SYS and SYSTEM can start a new transaction, a new query, a new fetch,
or a new PL/SQL operation.
■ Oracle waits for all existing transactions in all instances that were initiated by a
user other than SYS or SYSTEM to finish (either commit or terminate). Oracle also
waits for all running queries, fetches, and PL/SQL procedures in all instances that
were initiated by users other than SYS or SYSTEM and that are not inside
transactions to finish. If a query is carried out by multiple successive OCI fetches,
Oracle does not wait for all fetches to finish. It waits for the current fetch to finish
and then blocks the next fetch. Oracle also waits for all sessions (other than those
of SYS or SYSTEM) that hold any shared resources (such as enqueues) to release
those resources. After all these operations finish, Oracle places the database into
quiesced state and finishes executing the QUIESCE RESTRICTED statement.
■ If an instance is running in shared server mode, Oracle instructs the Database
Resource Manager to block logins (other than SYS or SYSTEM) on that instance. If
an instance is running in non-shared-server mode, Oracle does not impose any
restrictions on user logins in that instance.
During the quiesced state, you cannot change the Resource Manager plan in any
instance.

The ALTER SYSTEM UNQUIESCE statement puts all running instances back into normal
mode, so that all blocked actions can proceed. An administrator can determine which
sessions are blocking a quiesce from completing by querying the
v$blocking_quiesce view.

数据库如何进入静默模式
1. 使用 ALTER SYSTEM QUIESCE RESTRICTED 语句 可使数据库进入静默模式
数据库进入静默模式后的变化:
2. 阻止非活动连接变为活动 , 除了SYS,SYSTEM,其他用户不能新起一个事务,查询等
3. 等待所有的事务结束 . 如果一个查询是由多个连续的 OCI 数据提取操作执行的,Oracle
不会等待所有的数据提取全部结束.Oracle 只会等待当前的数据提取结束并阻塞之后的数据提取.
还会等待所有拥有共享资源的会话释放资源.
这些操作结束后 , 数据库进入静默模式 , QUIESCE RESTRICTED 语句结束
4. 数据库运行在共享服务模式下, Oracle指示资源管理器阻塞非SYS,SYSTEM用户登录
数据库运行在专有模式下 , 则对用户登录不进行阻塞
5. 使用 ALTER SYSTEM UNQUIESCE 语句将实例恢复为正常状态,各实例中所有被
阻塞的操作都得以继续执行。
6. 在将数据库置为静默状态的过程中,可以通过查询V$BLOCKING_QUIESCE 视图来查询系统中哪些
会话正在阻碍数据库进入静默状态。

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-989867/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Quiesce Database (330)
请登录后发表评论 登录
全部评论
  • 博文量
    740
  • 访问量
    1892256