数据库进入静默状态 以及与restricted介绍
2008-10-03 23:17
453 查看
DBA偶然也需要从并发非dba操作中孤立出来,换句话说,隔离并发非DBA事务,查询或PL/SQL语句。隔离的一种方法是取关闭数据库并以restricted模式打开。你也能不中断用户,使系统进入静默状态。在静默状态中,DBA能安全地执行某些操作,这些操作要求从当前非DBA用户中隔离出来操作。
在静默状态下,只有具有DBA权限的用户能够在数据库中执行查询/更新操作, 运行PL/SQL程序, 任何非DBA用户都不能在数据库中执行任何操作.
DBA在执行某些操作时,必须排队其他用户的活动这类操作包括如下两类:
1.某些操作在执行过程,如果有其他用户访问操作的对象,该操作将会失败. 比如, 当DBA正在为某个表添加一个新的字段时,如果有用户恰好正在使用这个表,添加字段的操作将失败.
2.某些操作在执行过程中产生的中间结果不应当被其他用户看到.比如,假设DBA要执行一项分为多个步骤的操作:首先导出一个表的数据,然后删除这个表, 最后再重新导入数据建立新的表,以达到重建该表的目的.而如果有某个用户在删除表之后,重建表之前访问这个表,将会得到错误的结果.
如果没有静默功能, 要保证成功完成上述类型的操作必须首先关闭数据库, 然后再使用受限模式打开数据库. 这样做的代价是很大的, 尤其是在必须保证数据库不间断运行的环境中.而使用数据库进入静默状态可以快速达到相同的目的,但是却并不需要中断数据库的运行.
处于静默状态时只允许SYS和SYSTEM两个DBA操作操作, 其他用户即使被授予DBA角色或SYSDBA权限也不能够在静默状态的数据库中进行操作. 因此,静默状态是比受限状态更为"干净"的状态.
SQL> alter system quiesce restricted;
alter system quiesce restricted
*
ERROR at line 1:
ORA-25507: resource manager has not been continuously on
SQL> alter system quiesce restricted;
alter system quiesce restricted
*
ERROR at line 1:
ORA-25507: resource manager has not been continuously on
SQL>
SQL> show parameter resource_manager_plan
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
resource_manager_plan string
SQL>
SQL> alter system set resource_manager_plan=’SYSTEM_PLAN’ scope=spfile ;
System altered.
SQL> startup force;
ORACLE instance started.
Total System Global Area 4732717392 bytes
Fixed Size 743760 bytes
Variable Size 738197504 bytes
Database Buffers 3992977408 bytes
Redo Buffers 798720 bytes
Database mounted.
Database opened.
SQL> alter system quiesce restricted;
System altered.
SQL> select status,active_state from v$instance;
STATUS ACTIVE_ST
------------ ---------
OPEN QUIESCED
Restricting Access to an Instance at Startup
You can start an instance, and optionally mount and open a database, in restricted mode so that the instance is available only to administrative personnel (not general database users). Use this mode of instance startup when you need to accomplish one of the following tasks:
Perform an export or import of data
Perform a data load (with SQL*Loader)
Temporarily prevent typical users from using data
Perform certain migration or upgrade operations
Typically, all users with the CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the CREATE SESSION and RESTRICTED SESSION system privilege. Only database administrators should have the RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.
The following command starts an instance (and mounts and opens the database) in restricted mode:
STARTUP RESTRICT
You can use the RESTRICT clause in combination with the MOUNT, NOMOUNT, and OPEN clauses.
Later, use the ALTER SYSTEM statement to disable the RESTRICTED SESSION feature:
ALTER SYSTEM DISABLE RESTRICTED SESSION;Restricting Access to an Instance at StartupYou can start an instance, and optionally mount and open a database, in restricted mode so that the instance is available only to administrative personnel (not general database users). Use this mode of instance startup when you need to accomplish one of the following tasks:Perform an export or import of dataPerform a data load (with SQL*Loader)Temporarily prevent typical users from using dataPerform certain migration or upgrade operationsTypically, all users with the CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the CREATE SESSION and RESTRICTED SESSION system privilege. Only database administrators should have the RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.The following command starts an instance (and mounts and opens the database) in restricted mode:STARTUP RESTRICT
You can use the RESTRICT clause in combination with the MOUNT, NOMOUNT, and OPEN clauses.Later, use the ALTER SYSTEM statement to disable the RESTRICTED SESSION feature:ALTER SYSTEM DISABLE RESTRICTED SESSION;
本文转自
http://www.cublog.cn/u/20078/showart_496620.html
在静默状态下,只有具有DBA权限的用户能够在数据库中执行查询/更新操作, 运行PL/SQL程序, 任何非DBA用户都不能在数据库中执行任何操作.
DBA在执行某些操作时,必须排队其他用户的活动这类操作包括如下两类:
1.某些操作在执行过程,如果有其他用户访问操作的对象,该操作将会失败. 比如, 当DBA正在为某个表添加一个新的字段时,如果有用户恰好正在使用这个表,添加字段的操作将失败.
2.某些操作在执行过程中产生的中间结果不应当被其他用户看到.比如,假设DBA要执行一项分为多个步骤的操作:首先导出一个表的数据,然后删除这个表, 最后再重新导入数据建立新的表,以达到重建该表的目的.而如果有某个用户在删除表之后,重建表之前访问这个表,将会得到错误的结果.
如果没有静默功能, 要保证成功完成上述类型的操作必须首先关闭数据库, 然后再使用受限模式打开数据库. 这样做的代价是很大的, 尤其是在必须保证数据库不间断运行的环境中.而使用数据库进入静默状态可以快速达到相同的目的,但是却并不需要中断数据库的运行.
处于静默状态时只允许SYS和SYSTEM两个DBA操作操作, 其他用户即使被授予DBA角色或SYSDBA权限也不能够在静默状态的数据库中进行操作. 因此,静默状态是比受限状态更为"干净"的状态.
SQL> alter system quiesce restricted;
alter system quiesce restricted
*
ERROR at line 1:
ORA-25507: resource manager has not been continuously on
SQL> alter system quiesce restricted;
alter system quiesce restricted
*
ERROR at line 1:
ORA-25507: resource manager has not been continuously on
SQL>
SQL> show parameter resource_manager_plan
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
resource_manager_plan string
SQL>
SQL> alter system set resource_manager_plan=’SYSTEM_PLAN’ scope=spfile ;
System altered.
SQL> startup force;
ORACLE instance started.
Total System Global Area 4732717392 bytes
Fixed Size 743760 bytes
Variable Size 738197504 bytes
Database Buffers 3992977408 bytes
Redo Buffers 798720 bytes
Database mounted.
Database opened.
SQL> alter system quiesce restricted;
System altered.
SQL> select status,active_state from v$instance;
STATUS ACTIVE_ST
------------ ---------
OPEN QUIESCED
Restricting Access to an Instance at Startup
You can start an instance, and optionally mount and open a database, in restricted mode so that the instance is available only to administrative personnel (not general database users). Use this mode of instance startup when you need to accomplish one of the following tasks:
Perform an export or import of data
Perform a data load (with SQL*Loader)
Temporarily prevent typical users from using data
Perform certain migration or upgrade operations
Typically, all users with the CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the CREATE SESSION and RESTRICTED SESSION system privilege. Only database administrators should have the RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.
The following command starts an instance (and mounts and opens the database) in restricted mode:
STARTUP RESTRICT
You can use the RESTRICT clause in combination with the MOUNT, NOMOUNT, and OPEN clauses.
Later, use the ALTER SYSTEM statement to disable the RESTRICTED SESSION feature:
ALTER SYSTEM DISABLE RESTRICTED SESSION;Restricting Access to an Instance at StartupYou can start an instance, and optionally mount and open a database, in restricted mode so that the instance is available only to administrative personnel (not general database users). Use this mode of instance startup when you need to accomplish one of the following tasks:Perform an export or import of dataPerform a data load (with SQL*Loader)Temporarily prevent typical users from using dataPerform certain migration or upgrade operationsTypically, all users with the CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the CREATE SESSION and RESTRICTED SESSION system privilege. Only database administrators should have the RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.The following command starts an instance (and mounts and opens the database) in restricted mode:STARTUP RESTRICT
You can use the RESTRICT clause in combination with the MOUNT, NOMOUNT, and OPEN clauses.Later, use the ALTER SYSTEM statement to disable the RESTRICTED SESSION feature:ALTER SYSTEM DISABLE RESTRICTED SESSION;
本文转自
http://www.cublog.cn/u/20078/showart_496620.html
相关文章推荐
- Nova 各个组件介绍以及功能分析(逻辑架构,运行架构,开发架构以及数据库)
- Android 联系人数据库介绍以及对联系人的基本操作
- 数据库的静默和挂起状态(http://blog.chinaunix.net/u/22151/showart_1165163.html)
- MySQL5.7(安装版)的安装,配置,全家桶的简要介绍,以及它的文件结构和数据库文件夹的修改
- 深入学习Hibernate4_05hibernate中对象的四种状态(临时状态,持久化状态,游离状态,删除状态),以及常用方法的介绍
- [转]mysql 导入导出数据库以及函数、存储过程的介绍
- RMAN与数据库状态的联系以及RMAN-20021错误
- 安卓listView下拉刷新,已读未读状态以及SQLite做本地缓存,详细介绍
- PostgreSQL介绍以及如何开发框架中使用PostgreSQL数据库
- 无论程序是否安装,都使setup.exe直接进入安装状态,不出现反安装;以及由此延伸出的同一安装程序允许在同一机器上安装多套软件的探讨
- Android学习笔记---SQLite介绍,以及使用Sqlite,进行数据库的创建,完成数据添删改查的理解
- UISwitch开关控件属性介绍以及获取开关状态并做出响应
- mysql 数据库表分区 方式以及优化查询查看方式介绍
- Nova 各个组件介绍以及功能分析(逻辑架构,运行架构,开发架构以及数据库)
- ObjectContext 是开发人员在查询、添加和删除其实体实例以及将新状态保存回数据库时用到的主要构造
- Android 联系人数据库介绍以及对联系人的基本操作
- ORACLE归档模式下的热备以及数据库打开状态状态下普通数据文件损坏后的还原
- ok6410中dnw的连接,以及uboot状态的进入
- mysql 导入导出数据库以及函数、存储过程的介绍
- 从CMD进入MySql,以及PHP连接数据库时的字符串设置