- 在执行如下任务时,可以把数据库启动到限制模式
- 数据导入导出(import、export)
- 数据的装载(SQL*Loader)
- 阻止某些用户访问数据
- 执行升级和迁移操作
在限制模式下,只有create session和restricted session权限用户能访问数据库
数据库关闭条件下
[oracle@prod1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 22 18:50:04 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
idle> startup restrict;
数据库已启动条件下
idle> alter system enable restricted session;
关闭限制模式
idle> alter system disable restricted session;
测试
[oracle@prod1 ~]$ sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 22 18:53:42 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege
#赋予scott用户restricted session权限
idle> grant restricted session to scott;
Grant succeeded.
#登录成功
[oracle@prod1 ~]$ sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 22 18:55:15 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
scott@PROD>