oracle启动限制模式

来源:互联网 发布:凯聪智云软件pc版 编辑:程序博客网 时间:2024/05/13 17:26
  • 在执行如下任务时,可以把数据库启动到限制模式
    • 数据导入导出(import、export)
    • 数据的装载(SQL*Loader)
    • 阻止某些用户访问数据
    • 执行升级和迁移操作
      在限制模式下,只有create session和restricted session权限用户能访问数据库

数据库关闭条件下

[oracle@prod1 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 22 18:50:04 2015Copyright (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 2015Copyright (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 2015Copyright (c) 1982, 2009, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsscott@PROD> 
0 0