Oracle表空间OFFLINE的三种参数
Oracle表空间Offline的三种参数--1-CSDN博客
引言
在 Oracle 数据库基础管理中,表空间管理尤为重要。而表空间 OFFLINE 是我们经常会用到的知识点,在进行
数据库管理的时候,留足备份、慎删数据是非常重要的原则。没有绝对把握的时候,绝对不要动手删除数据。
这里谈到的offline tablespace 和 lock user都是非常好的屏蔽数据访问的手段。
1、关于表空间 OFFLINE 的概念
当数据库处于 OPNE 状态时,表空间处于联机状态(可访问)或脱机状态(不可访问)。表空间通常是联机的以便
用户可以使用。SYSTEM 和临时表空间不可以脱机。表空间可以手动脱机或者自动脱机,例如可以手动将表空间脱
机以便进行维护,备份和恢复。数据库在遇到某些问题时会自动将一个表空间脱机,比如数据库写进程(DBWn)
多次试图写入数据文件但遇到失败时。当用户试图访问一个脱机表空间中的表时会收到错误。
当一个表空间进入脱机状态时,数据库执行以下任务:
数据库不允许后续 DML 语句引用脱机表空间中的对象。脱机的表空间无法被除 Oracle 数据库之外的任务其它
使用程序读取或编辑。
活动事务中的某些已完成的语句,曾引用了脱机表空间中的数据,这些事务在事务级别不受影响。
数据库将那些已完成语句相应的撤销数据,保存在 SYSTEM 表空间中的延迟撤销段中。当表空间被联机时,
数据库在必要时将撤销数据应用到该表空间中。
Oracle 表空间在正常 ONLINE 的情况下,一个表空间中若干个数据文件是维持在动态一致状态中,文件头上的
SCN 根据 DBWR 和 CKPT 维持一致或者不一致的状态。
Online and Offline Tablespaces
A tablespace can be online (accessible) or offline (not accessible), whenever the database is open. A
tablespace is usually online so that its data is available to users. The SYSTEM tablespace and temporary
tablespaces cannot be taken offline. A tablespace can go offline automatically or manually. For example,
you can take a tablespace offline for maintenance or backup and recovery. The database automatically
takes a tablespace offline when certain errors are encountered, as when the database writer (DBWn)
process fails in several attempts to write to a data file. Users trying to access tables in an offline tablespace
receive an error.
When a tablespace goes offline, the database does the following:
The database does not permit subsequent DML statements to reference objects in the offline
tablespace. An offline tablespace cannot be read or edited by any utility other than Oracle Database.
Active transactions with completed statements that refer to data in that tablespace are not affected at
the transaction level.
The database saves undo data corresponding to those completed statements in a deferred undo
segment in the SYSTEM tablespace. When the tablespace is brought online, the database applies the
undo data to the tablespace, if needed.
文档被以下合辑收录
评论