受限模式对用户的影响
将数据进入受限模式后,会重启MMNL和MMON进程(在altert.log中看到)
Stopping background process MMNL
Mon Nov 28 19:13:10 2011
Stopping background process MMON
Starting background process MMON
Starting background process MMNL
MMON started with pid=11, OS id=15006
Mon Nov 28 19:13:11 2011
ALTER SYSTEM enable restricted session;
MMNL started with pid=12, OS id=15008
MMON、MMNL 和Mnnn:可管理性监视器(Manageability Monitor)
这些进程用于填充自动工作负载存储库(Automatic WorkloadRepository,AWR),这是Oracle 10g中新增的一个特性。
MMNL进程会根据调度从SGA 将统计结果刷新输出至数据库表。
MMON进程用于“自动检测”数据库性能问题,并实现新增的自调整特性。
Mnnn 进程类似于作业队列的Jnnn 或Qnnn 进程;MMON 进程会请求这些从属进程代表它完成工作。Mnnn 进程本质上是临时性的,它们将根据需要来来去去
受限会话访问模式:(只有拥有RESTRICTED SESSION权限
的用户才可以创建会话)
例子:
将restricted session授权给scott用用户,不授权给hr 用户
情景一:scott用户和hr用户都先建立了会话,然后sysdba才建立限制模式,看两个用户是否访问受限
==========================================
sys用户:
SQL> select logins from v$instance;
LOGINS
----------
ALLOWED
SQL> grant restricted session to scott;
Grant succeeded.
scott用户:
SQL> select * from cat;
TABLE_NAME TABLE_TYPE
------------------------------ -----------
DEPT TABLE
EMP TABLE
BONUS TABLE
SALGRADE TABLE
hr用户:
SQL> select * from cat;
TABLE_NAME TABLE_TYPE
------------------------------ -----------
REGIONS TABLE
COUNTRIES TABLE
LOCATIONS TABLE
DEPARTMENTS TABLE
JOBS TABLE
EMPLOYEES TABLE
JOB_HISTORY TABLE
LOCATIONS_SEQ SEQUENCE
DEPARTMENTS_SEQ SEQUENCE
EMPLOYEES_SEQ SEQUENCE
EMP_DETAILS_VIEW VIEW
11 rows selected.
=================================
sys用户
SQL> alter system enable restricted session;
System altered.
SQL> select logins from v$instance;
LOGINS
----------
RESTRICTED
scott退出,再进入,,成功了
[oracle@samlee bdump]$ sqlplus scott/tiger
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 28 19:41:13 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from cat;
TABLE_NAME TABLE_TYPE
------------------------------ -----------
DEPT TABLE
EMP TABLE
BONUS TABLE
SALGRADE TABLE
相反hr用户就被限制,不允许建立session进入
[oracle@samlee ~]$ sqlplus hr/hr
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 28 19:41:30 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege
Enter user-name:
再用sys改为非限制模式:hr用户就可以进入了
结论:
如果用户都先建立了session,再将数据库改为受限模式,即使没用授予用户restricted session权限,也不影响已建立session用户的操作;当用户退出当前session再登录就会受限
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26465805/viewspace-712390/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26465805/viewspace-712390/