[20151028]理解数据文件offline+drop.txt

简介: [20151028]理解数据文件offline+drop.txt --前几天做删除数据文件的恢复测试,自己在理解offline drop的方式存在错误,做一个记录: The ALTER DATABASE DATAFILE OFFLINE DROP command, is not meant to allow you to remove a datafile.
[20151028]理解数据文件offline+drop.txt

--前几天做删除数据文件的恢复测试,自己在理解offline drop的方式存在错误,做一个记录:

The ALTER DATABASE DATAFILE <datafile name> OFFLINE DROP command, is not meant to allow you to remove a datafile. What
the command really means is that you are offlining the datafile with the intention of dropping the tablespace.

If you are running in archivelog mode, you can also use:

ALTER DATABASE DATAFILE <datafile name> OFFLINE;

instead of OFFLINE DROP.  Once the datafile is offline, Oracle no longer attempts to access it, but it is still
considered part of that tablespace. This datafile is marked only as offline in the controlfile and there is no SCN
comparison done between the controlfile and the datafile during startup (This also allows you to startup a database with
a non-critical datafile missing).  The entry for that datafile is not deleted from the controlfile to give us the
opportunity to recover that datafile.

alter database datafile '...' offline drop;  --非归档模式使用
alter database datafile '...' offline;       --归档模式使用

--换一句话讲在归档模式下使用offline 或者 offline drop是一样的,不存在区别,而在非归档模式仅仅使用offline drop。
--而是实际上即使加入drop也不会移除数据文件,并且也不会从控制文件中剔除(注:这个是最迷惑人的地方)。

--可以理解为oracle这样设置,提示你在非归档下OFFLINE 一个DATAFILE 需要勇气,因为如果需要的REDO被覆盖,你将面临无法RECOVER
--的状况,也就没法ONLINE了.

--实际上在归档模式没有什么区别,在非归档模式必须加入drop,也许oracle想标识要恢复有点困难,必须要有一系列日志。
--理解这些对于恢复很重要!而且drop确实有点不好理解。

目录
相关文章
|
机器学习/深度学习 Oracle 关系型数据库
[20180412]logminer使用问题(10g).txt
[20180412]logminer使用问题(10g).txt --//今天使用logminer下遇到一个问题,做一个记录: 1.环境: SYSTEM@xxx> @ &r/ver1 PORT_STRING                    VERSION...
1636 0
|
测试技术 数据库
[20180202]备库数据文件offline.txt
[20180202]备库数据文件offline.txt --//今天测试,不小心导致日志无法应用.我想把主库文件拷贝过去,做了备库数据文件offline. --//恢复遇到问题,做一个记录.
1260 0
|
Oracle 关系型数据库 Linux
[20171208]rman与truncate3.txt
[20171208]rman与truncate3.txt --//前几天测试truncate表依旧备份一部分信息,测试几次确定备份8extent.当时的测试几个extents是相邻的.
886 0
|
Oracle 关系型数据库 测试技术
[20171206]rman与truncate.txt
[20171206]rman与truncate.txt --//昨天下班在回家的路上,突然想起以前遇到的问题,就是truncate表后,rman做备份时会备份多少truncate表的信息, --//当时在itpub上,还存在讨论,就是rman会备份空block吗?参考链接:http://www.
989 0
|
Oracle 关系型数据库 Linux
[20171206]rman与truncate2.txt
[20171206]rman与truncate2.txt --//上午测试发现truncate的表在做rman备份时还要做8个extents的备份. --//不知道自己的猜测是否正确,选择一个使用UNIFORM SIZE 的表空间测试看看.
1070 0
|
监控 Oracle 关系型数据库
[20170203]关于flashback的问题.txt
[20170203]关于flashback的问题.txt --今天生产系统遇到的问题,dataguard机器磁盘空间不足,需要释放磁盘空间,无论如何删除日志,空间回收都是很少.
890 0
|
Oracle 关系型数据库 数据库
[20161019]数据文件offline与open resetlog
[20161019]数据文件offline与open resetlog.txt --上午做了数据文件offline后恢复到那个scn号,恢复到该数据文件的LAST_CHANGE#的scn值。
697 0
|
Oracle 关系型数据库 测试技术
[20160805]logminer使用问题1.txt
[20160805]logminer使用问题1.txt --前一阵子看itpub有人想通过logminer来抽取归档同步数据库,实际上这个非常不科学,存在一定的风险,我觉得很多情况下会漏掉一些sql --语句,通过例子来说明。
813 0
|
Oracle 关系型数据库 测试技术
[20160805]logminer使用问题2.txt
[20160805]logminer使用问题2.txt --前一阵子看itpub有人想通过logminer来抽取归档同步数据库,实际上这个非常不科学,存在一定的风险,我觉得很多情况下会漏掉一些sql --语句,通过例子来说明。
1051 0