停库前执行alter system checkpoint 很重要!

近期几次停一个库迁文件时, 发现srvctl stop instance xxx 停库后, 迁完文件在open时报
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 113 failed verification check
ORA-01110: data file 113: '+DATA2/isddw/datafile/isdh36m201006032.30232.732834105'
ORA-01207: file is more recent than control file - old control file


检查没有发现diskgroup有disk offline(以前遇到过有disk offline时,也报类似的错, online后recover成功),没有发现有datafile offline
尝试了以下几个方法均不行:
1) 直接recover database noparallel
2)尝试逐个使用单个的控制文件
3)尝试将所有节点的asm instance停掉,只启动节点1的asm, 再open
4)尝试alter system check datafiles;
5) alter database recover datafile 113 ?
6)recover database using backup controlfile;
(controle_files参数仍是当前的控制文件) 发现不能自动寻找online redolog

7) 最后recreate control file解决,具体步骤见
. alter database backup controfile to trace
. 修改trc, 重建controfile file
. 执行recover database noparallel; auto
. open db
. 重建temp tbs, redo log file







这个错误是因cache中的信息没有及时写入controlfile导致, 避免的方法是在每次停库前,对DB作一次checkpoint, 即
ALTER SYSTEM CHECKPOINT;


要注意的是alter system switch logfile; 也会触发checkpoint,但只会对执行sql的那个节点,不会对RAC中的所有节点
 

checkpoint_clause

Specify CHECKPOINT to explicitly force Oracle Database to perform. a checkpoint, ensuring that all changes made by committed transactions are written to datafiles on disk. You can specify this clause only when your instance has the database open. Oracle Database does not return control to you until the checkpoint is complete.

GLOBAL In an Oracle Real Application Clusters (RAC) environment, this setting causes Oracle Database to perform. a checkpoint for all instances that have opened the database. This is the default.

LOCAL In an Oracle RAC environment, this setting causes Oracle Database to perform. a checkpoint only for the thread of redo log file groups for the instance from which you issue the statement.

Forcing a Checkpoint: Example The following statement forces a checkpoint:

ALTER SYSTEM CHECKPOINT;
 

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

转载于:http://blog.itpub.net/94384/viewspace-684442/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值