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

[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确实有点不好理解。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-1817029/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/267265/viewspace-1817029/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值