启用和禁用受限制的会话 - Amazon Relational Database Service

启用和禁用受限制的会话

要启用和禁用受限制的会话,请使用 Amazon RDS 过程 rdsadmin.rdsadmin_util.restricted_sessionrestricted_session 过程具有以下参数。

参数名称 数据类型 默认值 描述

p_enable

布尔值

true

设置为 true 则启用受限制的会话;设置为 false 则禁用受限制的会话。

以下示例介绍了如何启用和禁用受限制的会话。

/* Verify that the database is currently unrestricted. */ SELECT LOGINS FROM V$INSTANCE; LOGINS ------- ALLOWED /* Enable restricted sessions */ EXEC rdsadmin.rdsadmin_util.restricted_session(p_enable => true); /* Verify that the database is now restricted. */ SELECT LOGINS FROM V$INSTANCE; LOGINS ---------- RESTRICTED /* Disable restricted sessions */ EXEC rdsadmin.rdsadmin_util.restricted_session(p_enable => false); /* Verify that the database is now unrestricted again. */ SELECT LOGINS FROM V$INSTANCE; LOGINS ------- ALLOWED