QUIESCE and UNQUIESCE the Oracle Database
Quiesce a Database will help the DBA to perform their administrative task without user intervention in the database. Schema changes are especially hard to make while users are doing live transactions in the database. In Quiesce, Only members of the SYSDBA group can perform the activities. Default only sys or system have privileges to login and perform operation.
Quiescing a database allows you to put the database in a single-user mode without having to ever shut the database down.
When we fired the command to change the database into Quiesce State then Oracle waited to complete all the running transactions before it successfully changed the state to Quiesce. Once the database is in Quiesce state, then all other transaction is held/waiting until it is turned back into Unquiesce state.
Note: If the User is already connected and fires any command then the user has to wait before acquiring any lock, the user is in a hang state until DBA puts make database in unquiesce state.
Benefit for Quiesce database:
In the OLTP Environment, if you want to perform DDL Operation and acquire a lock on the object then DBA needs to make the database in Quiesce state to perform database maintenance/administrative tasks.
Check database is Quiesce State
Query the ACTIVE_STATE column of the V$INSTANCE view
select active_State from v$instance;
Values:
NORMAL: Normal unquiesced state.
QUIESCING: Being quiesced, but some non-DBA sessions are still active.
QUIESCED: Quiesced; no non-DBA sessions are active or allowed
Enabled the Quiescing of Oracle Database:
Sql> ALTER SYSTEM QUIESCE RESTRICTED;
Determine the sessions that are blocking the quiesce operation
select bl.sid, user, osuser, type, program
from v$blocking_quiesce bl, v$session se
where bl.sid = se.sid;
Unquiesce database after performing your administrative operations:
Sql> ALTER SYSTEM UNQUIESCE;
Note:
-In RAC, the Instance cannot open at the time of database is in a quiesce state.
ORA-25503:cannot open database because the database is being quiesced
-Application user is going in waiting until unquiesce is done.
-All inactive sessions are prevented from issuing any database commands until the database is unquiesced.
-All new login attempts will be queued. A user trying to log in when the database is in a quiesced state won’t get an error message. Rather, his or her login attempts will seem to “hang.”