ITPub博客

首页 > 数据库 > Oracle > ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

原创 Oracle 作者:wuweilong 时间:2014-09-03 22:55:54 0 删除 编辑
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode


问题现象:
我在执行开启归档命令后报错误ORA-00265
  1. SQL> alter database archivelog;
  2. alter database archivelog
  3. *
  4. ERROR at line 1:
  5. ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

问题分析:
     从如上错误我们可以看到是因为datafile,controlfile,redolog中的SCN号不一致导致无法开启归档,那么导致该问题的原因是因为我重启数据库到mount的时候采用的是startup force mount;因为这个命令实际上是做了两步操作,分别如下:
1、shutdown abort    ---强制关闭数据库
2、startup mount

      既然我们隐含的做了shutdown abort操作之后,也就意味着datafile,controlfile,redolog这里面的SCN号肯定不一致,需要在open数据库的过程中做recover,由于他们的SCN号不一致,所以会导致无法在mount状态下开启archivelog,如下:
  1. SQL> startup mount force;
  2. ORACLE instance started.

  3. Total System Global Area 2505338880 bytes
  4. Fixed Size 2255832 bytes
  5. Variable Size 620758056 bytes
  6. Database Buffers 1862270976 bytes
  7. Redo Buffers 20054016 bytes
  8. Database mounted.

  9. SQL> alter database archivelog;
  10. alter database archivelog
  11. *
  12. ERROR at line 1:
  13. ORA-00265: instance recovery required, cannot set ARCHIVELOG mode

问题解决办法:
针对该问题,最简单的解决办法是,将数据库open,这个时候会进行recover操作,完成之后再进行shutdown immediate后启动到statup mount就可以开启归档了,详细见如下:

  1. SQL> alter database open;

  2. Database altered.

  3. ####recover日志信息如下
  4. alter database open
  5. Beginning crash recovery of 1 threads
  6.  parallel recovery started with 3 processes
  7. Started redo scan
  8. Completed redo scan
  9.  read 1522 KB redo, 175 data blocks need recovery
  10. Started redo application at
  11.  Thread 1: logseq 7, block 10941
  12. Recovery of Online Redo Log: Thread 1 Group 1 Seq 7 Reading mem 0
  13.   Mem# 0: /DBData/woo2/redo01.log
  14. Completed redo application of 0.44MB
  15. Completed crash recovery at
  16.  Thread 1: logseq 7, block 13985, scn 991198
  17.  175 data blocks read, 175 data blocks written, 1522 redo k-bytes read
  18. Wed Sep 03 22:39:35 2014
  19. Thread 1 advanced to log sequence 8 (thread open)
  20. Thread 1 opened at log sequence 8
  21.   Current log# 2 seq# 8 mem# 0: /DBData/woo2/redo02.log
  22. Successful open of redo thread 1
  23. MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
  24. Wed Sep 03 22:39:35 2014
  25. SMON: enabling cache recovery
  26. [13499] Successfully onlined Undo Tablespace 2.
  27. Undo initialization finished serial:0 start:3565124 end:3565194 diff:70 (0 seconds)
  28. Verifying file header compatibility for 11g tablespace encryption..
  29. Verifying 11g file header compatibility for tablespace encryption completed
  30. SMON: enabling tx recovery
  31. Database Characterset is AL32UTF8
  32. No Resource Manager plan active
  33. replication_dependency_tracking turned off (no async multimaster replication found)
  34. Starting background process QMNC
  35. Wed Sep 03 22:39:36 2014
  36. QMNC started with pid=23, OS id=16119
  37. Completed: alter database open
  38. Wed Sep 03 22:39:37 2014
  39. db_recovery_file_dest_size of 4182 MB is 0.00% used. This is a
  40. user-specified limit on the amount of space that will be used by this
  41. database for recovery-related files, and does not reflect the amount of
  42. space available in the underlying filesystem or ASM diskgroup.
  43. Wed Sep 03 22:39:37 2014
  44. Starting background process CJQ0
  45. Wed Sep 03 22:39:37 2014
  46. CJQ0 started with pid=24, OS id=16134
  47. Starting background process SMCO
  48. Wed Sep 03 22:39:43 2014
  49. SMCO started with pid=30, OS id=16149

#####immediate关闭数据库,重新开启归档,即可。
  1. SQL> shutdown immediate
  2. Database closed.
  3. Database dismounted.
  4. ORACLE instance shut down.
  5. SQL> startup mount;
  6. ORACLE instance started.

  7. Total System Global Area 2505338880 bytes
  8. Fixed Size 2255832 bytes
  9. Variable Size 620758056 bytes
  10. Database Buffers 1862270976 bytes
  11. Redo Buffers 20054016 bytes
  12. Database mounted.
  13. SQL> alter database archivelog;

  14. Database altered.

  15. SQL> alter database open;

  16. Database altered.

  17. SQL>

  18. ###打开归档alert日志信息如下
  19. ALTER DATABASE MOUNT
  20. Successful mount of redo thread 1, with mount id 3606990310
  21. Database mounted in Exclusive Mode
  22. Lost write protection disabled
  23. Completed: ALTER DATABASE MOUNT
  24. Wed Sep 03 22:45:06 2014
  25. alter database archivelog
  26. Completed: alter database archivelog
  27. alter database open
  28. Wed Sep 03 22:45:12 2014
  29. LGWR: STARTING ARCH PROCESSES
  30. Wed Sep 03 22:45:12 2014
  31. ARC0 started with pid=20, OS id=16867
  32. ARC0: Archival started
  33. LGWR: STARTING ARCH PROCESSES COMPLETE
  34. ARC0: STARTING ARCH PROCESSES
  35. Wed Sep 03 22:45:13 2014
  36. ARC1 started with pid=21, OS id=16871
  37. Wed Sep 03 22:45:13 2014
  38. ARC2 started with pid=22, OS id=16873
  39. Wed Sep 03 22:45:13 2014
  40. ARC3 started with pid=23, OS id=16875
  41. ARC1: Archival started
  42. ARC2: Archival started
  43. ARC1: Becoming the \


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

下一篇: expdp 导出多路径
请登录后发表评论 登录
全部评论
Oracle ACE Associate; 12cOCM;11gOCM;MySQL OCP;PGCA;PGCE;KCA; KCP; 本人拥有十年以上运营商,广电传媒,能源,制造等行业DBA从业经验; 有着丰富的管理及运维经验,经历过国家级重点项目,省级标杆项目,新型试点项目

注册时间:2010-01-08

  • 博文量
    779
  • 访问量
    4931756