Purpose
The ALTER SYSTEM ENABLE RESTRICTED SESSION statement is used to enable restricted mode, and the ALTER SYSTEM DISABLE RESTRICTED SESSION statement is used to disable restricted mode.
After restricted mode is enabled, the database refuses to establish new regular connections. Only users with the RESTRICTED SESSION system privilege can continue logging in. This mode is commonly used for access control during application upgrades and maintenance. After the upgrade or maintenance is complete, you can restore normal service status by executing ALTER SYSTEM DISABLE RESTRICTED SESSION.
Note
This statement is available starting with V4.6.1.
Syntax
ALTER SYSTEM { ENABLE | DISABLE } RESTRICTED SESSION;
Parameters
Parameter |
Description |
|---|---|
| ENABLE | Enables restricted mode. After it is enabled, the database refuses to establish new regular connections. Users with the RESTRICTED SESSION system privilege can still log in. Once enabled, restricted mode remains valid after the tenant is restarted. |
| DISABLE | Disables restricted mode. After it is disabled, the database returns to its normal service state. |
Examples
Enable restricted mode.
obclient> ALTER SYSTEM ENABLE RESTRICTED SESSION;Disable restricted mode.
obclient> ALTER SYSTEM DISABLE RESTRICTED SESSION;
References
- RESTRICTED SESSION privilege
- After enabling or disabling restricted mode, you can check the instance mode via the
LOGINSfield in the [G]V$INSTANCE view. If it isRESTRICTED, restricted mode is enabled.
