什么是数据库的RESTRICTED 模式
注:以下内容来至:
1 --数据库受限模式,在这个模式下只有RESTRICTED SESSION 权限的人才可以登陆,一般用与数据库维护的时候使用。 2 RESTRICTED Clause 3 The RESTRICTED clause lets you logon Oracle. 4 You can this clause regardless whether your instance has the 5 dismounted mounted, closed. 6 Restricting Logons: Example You may want logons you 7 performing application maintenance you want application developers 8 RESTRICTED system privilege log . logons, issue the 9 following statement: 10 SYSTEM 11 ENABLE RESTRICTED ; 12 You can terminate existing sessions the clause the 13 SYSTEM statement. 14 After performing maintenance your application, issue the following statement 15 allow system privilege log : 16 SYSTEM 17 DISABLE RESTRICTED ;
1 --oracle DBA在做一些操作的时候不希望有人登入数据库可以使用restrict模式: 2 3 4 --开启限制会话模式: 5 6 system enable restricted ; 7 --取消限制会话模式: 8 system disable restricted ; 9 10 --RESTRICTED模式以后 除了管理员都不能登录,如果需要非管理员登录,必须 11 restricted test; 12 13 14 --那么以限制会话模式登入有两种方法: 15 16 --一:正常登入数据库后执行 17 system enable restricted ; 18 19 20 --二: 21 sqlplus /nolog 22 23 conn / sysdba 24 25 ; 26 27 startup 28 29 30 --个人喜欢用第二种方法,第一种有的时候居然 alter system disable restricted session; 后无效。 31 32
本文来源于: 的 《 》
1 1. > system enable restricted ; 2 System altered. 3 --或者 4 > startup 5 6 --2. 没有RESTRICTED SESSION的用户无法登录: 7 > scott/scott 8 ERROR: 9 ORA-01035: ORACLE available users RESTRICTED privilege 10 11 --3. 赋权限 12 , restricted scott; 13 14 --4. 取消restricted 15 system disable restricted ; 16 17 18 --启用restricted mode方式启动和运行数据库后,只有那些具有create session和restricted session权限的用户,才能登录入系统数据库。默认情况下,只有SYSDBA和SYSOPER用户拥有restricted session权限。意味着只有数据库管理权限的用户才能进行restricted mode下的数据管理工作。 19 20 --在restricted mode下,用户即使拥有restricted session权限,只能本地登录并且不经过监听程序才可以。Remote方式登录是被拒绝的。
以下内容来源于: 的 《》
1 --公司一台机器上安装了多个数据库,这几个数据库共用一个监听器,而且是动态监听,在维护其中一台机器的时候,不想用户登录,停止监听看来是不可能了的,因为用户在访问其他数据库,如下的方法可以使没有RESTRICTED SESSION的权限登录. 2 --1.启用restricted session 3 > system enable restricted ; 4 System altered. 5 6 --2. 没有RESTRICTED SESSION的用户无法登录 7 > scott/scott 8 ERROR: 9 ORA-01035: ORACLE available users RESTRICTED privilege 10 11 --3.数据库维护好后,禁用RESTRICTED SESSION 12 > system disable restricted ; 13 System altered. 14 15 16 --4.用户可以恢复登录 17 > scott/scott 18 Connected. 19 20 --说明: 21 --要是维护单个数据库,也可以startup restrict方式启动数据.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------