How a Database Is Quiesced (331)

tsinglee發表於2007-12-08

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章