ITPub博客

首页 > 数据库 > Oracle > 非当前日志组所有文件丢失

非当前日志组所有文件丢失

原创 Oracle 作者:zzh_ds 时间:2016-12-12 14:16:03 0 删除 编辑
----#非当前日志组的所有成员丢失(在正常关库下)
---查询日志组的状态
  1. SQL> select group#,status from v$log;

  2.     GROUP# STATUS
  3. ---------- ----------------
  4.          1 INACTIVE
  5.          2 INACTIVE
  6.          3 CURRENT
---查询日志组的地址

  1. SQL> select group#,member from v$logfile;

  2.     GROUP# MEMBER
  3. ---------- ---------------------------------------------
  4.          3 /u01/app/oracle/oradata/ORA/redo03.log
  5.          2 /u01/app/oracle/oradata/ORA/redo02.log
  6.          1 /u01/app/oracle/oradata/ORA/redo01.log
---关闭数据库(模拟实验 )

  1. SQL> shutdown immediate
  2. Database closed.
  3. Database dismounted.
  4. ORACLE instance shut down.
  5. SQL>
  6. [oracle@zh ORA]$ pwd
  7. /u01/app/oracle/oradata/ORA
  8. [oracle@zh ORA]$ ls
  9. control01.ctl redo01.log sysaux01.dbf undotbs01.dbf
  10. control02.ctl redo02.log system01.dbf users01.dbf
  11. example01.dbf redo03.log temp01.dbf
  12. [oracle@zh ORA]$ rm redo02.log
  13. [oracle@zh ORA]$ ls
  14. control01.ctl example01.dbf redo03.log system01.dbf undotbs01.dbf
  15. control02.ctl redo01.log sysaux01.dbf temp01.dbf users01.dbf
---启动数据库(直接open下会报错)

  1. SQL> startup
  2. ORACLE instance started.

  3. Total System Global Area 939495424 bytes
  4. Fixed Size 2258840 bytes
  5. Variable Size 595593320 bytes
  6. Database Buffers 335544320 bytes
  7. Redo Buffers 6098944 bytes
  8. Database mounted.
  9. ORA-03113: end-of-file on communication channel
  10. Process ID: 8034
  11. Session ID: 125 Serial number: 5

  12. SQL>
----查看警告日志(提示找不到日志文件)

  1. ALTER DATABASE OPEN
  2. Errors in file /u01/app/oracle/diag/rdbms/ora/ORA/trace/ORA_lgwr_8012.trc:
  3. ORA-00313: open failed for members of log group 2 of thread 1
  4. ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/ORA/redo02.log'
  5. ORA-27037: unable to obtain file status
  6. Linux-x86_64 Error: 2: No such file or directory
----需要启到mount状态下

点击(此处)折叠或打开

  1. SQL> startup mount
  2. ORACLE instance started.

  3. Total System Global Area 939495424 bytes
  4. Fixed Size 2258840 bytes
  5. Variable Size 595593320 bytes
  6. Database Buffers 335544320 bytes
  7. Redo Buffers 6098944 bytes
  8. Database mounted.
  9. SQL>
  10. ----查看报错日志组是否为当前日志组
  11. SQL> select group#,status from v$log;
  12. \
  13.     GROUP# STATUS
  14. ---------- ----------------
  15.          1 INACTIVE
  16.          3 CURRENT
  17.          2 INACTIVE

  18. SQL>
  19. ----clear日志组
  20. SQL> alter database clear logfile group 2 ;

  21. Database altered.

  22. SQL>
  23. --把库启到open下
  24. SQL> alter database open;

  25. Database altered.

  26. SQL>
---查看回复的日志组成员

  1. SQL> ! ls /u01/app/oracle/oradata/ORA
  2. control01.ctl redo01.log sysaux01.dbf undotbs01.dbf
  3. control02.ctl redo02.log system01.dbf users01.dbf
  4. example01.dbf redo03.log temp01.dbf

  5. SQL>









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

上一篇: 归档启动与关闭
下一篇: 临时表
请登录后发表评论 登录
全部评论

注册时间:2016-09-29

  • 博文量
    61
  • 访问量
    47810