在Oracle数据库实例的v$instance
动态视图查看状态信息时,其中,logins列表示实例模式类型:
注意:
- 在将数据库改为Restricted 模式之前已建立连接的用户不受限制,它们仍然拥有操作数据库的权限
grant restricted session to biu;
alter system enable restricted session;
-- 检查确认
select status,instance_name,logins from v$instance;
# 1.
srvctl modify database -d <dbname> -s "open restrict"
# 2.
srvctl start database -d <dbname> -o "open restrict"
srvctl start database -d <db name> -o restrict
srvctl start instance -d <db name> -i <instance name> -o restrict
# 检查
srvctl config database -d <dbname> -a |grep ‘START_OPTIONS‘
sqlplus -S "/ as sysdba" <<EOF
select instance_name,status,logins,database_status from gv$instance;
EOF
原文:https://www.cnblogs.com/binliubiao/p/15134345.html