IT开放社区

重做日志文件(current状态)故障恢复实验

环境:

OS:centos7.3

DB:oracle11.2.0.4

重做日志文件(current状态)故障恢复实验

1.确认数据库为归档模式;

centos@SYS> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/arch
Oldest online log sequence     10
Next log sequence to archive   12
Current log sequence           12
centos@SYS>

2.查看处于current状态的日志文件;

centos@SYS> select group#,members,archived,status from v$log;
    GROUP#    MEMBERS ARC STATUS
---------- ---------- --- ----------------
         1          1 YES INACTIVE
         2          1 YES UNUSED
         3          1 NO  CURRENT
centos@SYS> select group#,member from v$logfile order by 1;
    GROUP# MEMBER
---------- --------------------------------------------------
         1 /u01/app/oracle/oradata/centos/redo01.log
         2 /u01/app/oracle/oradata/centos/redo02.log
         3 /u01/app/oracle/oradata/centos/redo03.log
centos@SYS>

3.模拟故障rm删除current状态日志文件;

centos@SYS> !rm /u01/app/oracle/oradata/centos/redo03.log
centos@SYS> !ls /u01/app/oracle/oradata/centos/redo03.log
ls: cannot access /u01/app/oracle/oradata/centos/redo03.log: No such file or directory
centos@SYS>

4.重启报错恢复;

centos@SYS> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
centos@SYS> startup
ORACLE instance started.
Total System Global Area  830930944 bytes
Fixed Size                2257800 bytes
Variable Size             587205752 bytes
Database Buffers          239075328 bytes
Redo Buffers              2392064 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 2414
Session ID: 1 Serial number: 5

centos@SYS>

4.1启动至mount状态,修改数据库为非归档模式;

centos@SYS> startup mount
ORACLE instance started.
Total System Global Area  830930944 bytes
Fixed Size                2257800 bytes
Variable Size             587205752 bytes
Database Buffers          239075328 bytes
Redo Buffers              2392064 bytes
Database mounted.
centos@SYS> alter database noarchivelog;
Database altered.
centos@SYS>

4.2重建日志组;

centos@SYS> select status from v$instance;
STATUS
------------
MOUNTED
centos@SYS> alter database clear logfile group 3;
Database altered.
centos@SYS> alter database open;
Database altered.
centos@SYS> select group#,member from v$logfile ;
    GROUP# MEMBER
---------- --------------------------------------------------
         3 /u01/app/oracle/oradata/centos/redo03.log
         2 /u01/app/oracle/oradata/centos/redo02.log
         1 /u01/app/oracle/oradata/centos/redo01.log
centos@SYS> !ls /u01/app/oracle/oradata/centos/redo03.log
/u01/app/oracle/oradata/centos/redo03.log
centos@SYS>

 ---END---Good Luck---

相关文章

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

网站分类
最新文章
    随机文章
      站点信息
      • 文章总数:113
      • 页面总数:2
      • 分类总数:3
      • 标签总数:0
      • 评论总数:0
      • 浏览总数:29694
      左邻右舍

      BlogPowerBy Z-BlogPHP 1.5 Zero ;Theme By 爱墙纸

      IT开放社区:京ICP备13044647号.初创于Oracle DBA实战班.邮箱:admin@itkaifang.com

      分享:

      支付宝

      微信