07 oracle 归档模式 inactive/current redo log损坏修复--以及错误ORA-00600: internal error code, arguments: [2663], [0], [9710724], [0], [9711142], [], [], [], [], [], [], []

--环境:

SQL*Plus: Release 11.2.0.4.0 Production

CentOS release 6.5 (Final)

单实例/归档模式

1 Inactive redo log丢失或损坏的恢复

SYS@ orcl >col member forma a50;
SYS@ orcl >select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- -------------------------------------------------- ---
2 ONLINE /u01/app/oracle/oradata/orcl/redo02.log NO
1 ONLINE /u01/app/oracle/oradata/orcl/redo01.log NO
3 ONLINE /u01/app/oracle/oradata/orcl/redo03.log NO
1 ONLINE /u01/app/oracle/oradata/orcl/redo11.log NO
SYS@ orcl >select *from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 289 52428800 512 2 NO CURRENT 9672831 04-JUN-19 2.8147E+14
2 1 287 52428800 512 1 YES INACTIVE 9656990 04-JUN-19 9658951 04-JUN-19
3 1 288 52428800 512 1 YES INACTIVE 9658951 04-JUN-19 9672831 04-JUN-19

使用dd命令破坏处于inactive状态的 redo log group 3

[oracle@DSI admin]$ dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo03.log bs=512 count=20
0+0 records in
0+0 records out
0 bytes (0 B) copied, 9.6715e-05 s, 0.0 kB/s

关闭重新启动报错

SYS@ orcl >shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@ orcl >startup
ORACLE instance started. Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 297795584 bytes
Redo Buffers 6791168 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 8282
Session ID: 125 Serial number: 5

退出,启动到mount状态

SYS@ orcl >exit
[oracle@DSI ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 5 10:16:28 2019 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount;
ORACLE instance started. Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 297795584 bytes
Redo Buffers 6791168 bytes
Database mounted.
SQL> select * from v$diag_info;

查看alert log

[oracle@DSI admin]$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace/
[oracle@DSI trace]$ tail -n 100 alert_orcl.log
Additional information: 1
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_8282.trc:
ORA-00313: open failed for members of log group 1 of thread
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/orcl/redo03.log'

查看日志组的状态,确认是处于inactive的

SYS@ orcl >set linesize 1000
SYS@ orcl >select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 289 52428800 512 2 NO CURRENT 9672831 04-JUN-19 2.8147E+14
3 1 288 52428800 512 1 YES INACTIVE 9658951 04-JUN-19 9672831 04-JUN-19
2 1 287 52428800 512 1 YES INACTIVE 9656990 04-JUN-19 9658951 04-JUN-19

进行修复

SYS@ orcl >alter database clear logfile group 3;  

Database altered.

SYS@ orcl >alter database drop logfile group 3;

Database altered.

SYS@ orcl >alter database add logfile group 3 ('/u01/app/oracle/oradata/orcl/redo03.log') size 50m;
alter database add logfile group 3 ('/u01/app/oracle/oradata/orcl/redo03.log') size 50m
*
ERROR at line 1:
ORA-00301: error in adding log file '/u01/app/oracle/oradata/orcl/redo03.log' - file cannot be created
ORA-27038: created file already exists
Additional information: 1
[oracle@DSI trace]$ rm /u01/app/oracle/oradata/orcl/redo03.log

SYS@ orcl >alter database add logfile group 3 ('/u01/app/oracle/oradata/orcl/redo03.log') size 50m;

Database altered.

SYS@ orcl >alter database open;

Database altered.
SYS@ orcl >select * from test.t1; [oracle@DSI trace]$ tail -n 100 alert_orcl.log

2 Current redo log丢失或损坏的恢复

模式数据测试

create table t6 (id int,name varchar2(100));

begin
for i in 1 .. 50000000
loop
insert into t6 values(i,'AAAAAA');
end loop;
commit;
end;
/
select * from v$log;
dd if=/dev/null of=/u01/app/oracle/oradata/orcl/redo03.log bs=512 count=20

查看日志

SQL> start mount;
SQL> alter database clear logfile group 3;
alter database clear logfile group 3
*
ERROR at line 1:
ORA-00350: log 3 of instance orcl (thread 1) needs to be archived
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/orcl/redo03.log'
SQL> recover database until cancel;
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'

创建pfile

SQL> create pfile='/tmp/pfile.ora' from spfile;

修改2个隐含参数

[oracle@DSI ~]$ vim /tmp/pfile.ora
*._allow_resetlogs_corruption=true
*._allow_error_simulation=true
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup mount pfile='/tmp/pfile.ora';
ORACLE instance started. Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 478154296 bytes
Database Buffers 297795584 bytes
Redo Buffers 6791168 bytes
Database mounted.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [], [], [], [], [], [], [], [], [], [], [], []
Process ID: 2108
Session ID: 125 Serial number: 5

ORA-600[2663]与常见的ORA-600[2662]类似,都是由于block的scn大于文件头的scn导致,只不过错误的对象不一样而已.对于该类问题,我们的处理方法一般就是简单的推scn

使用隐含参数_ALLOW_RESETLOGS_CORRUPTION后resetlogs打开数据库后,我们说很多时候你会遇到ORA-00600 2662号错误,这个错误的含义是:
A data block SCN is ahead of the current SCN.
The ORA-600 [2662] occurs when an SCN is compared to the dependent SCN
stored in a UGA variable.
If the SCN is less than the dependent SCN then we signal the ORA-600 [2662]
internal error.

参考:http://www.xifenfei.com/2014/09/ora-600-2663-%E6%95%85%E9%9A%9C%E6%81%A2%E5%A4%8D.html

ORA-600 [2662] [a] [b] [c] [d] [e]
Arg [a] Current SCN WRAP
Arg [b] Current SCN BASE
Arg [c] dependent SCN WRAP
Arg [d] dependent SCN BASE
Arg [e] Where present this is the DBA where the dependent SCN came from.
算法计算规则如下:Arg [c]*4得出一个数值,假设为V_Wrap,
如果Arg [d]=0,则V_Wrap值为需要的level
Arg [d] < 1073741824,V_Wrap+1为需要的level
Arg [d] < 2147483648,V_Wrap+2为需要的level
Arg [d] < 3221225472,V_Wrap+3为需要的level
增进SCN有两种常用方法
1.通过immediate trace name方式(在数据库Open状态下)
alter session set events 'IMMEDIATE trace name ADJUST_SCN level x';
2.通过10015事件(在数据库无法打开,mount状态下)
alter session set events '10015 trace name adjust_scn level x';
注:level 1为增进SCN 10亿 (1 billion) (1024*1024*1024),通常Level 1已经足够。也可以根据实际情况适当调整

SQL> exit
[oracle@DSI ~]$ sqlplus / as sysdba
SQL> startup mount pfile='/tmp/pfile.ora';
SQL> show parameter undo; NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> oradebug setmypid
Statement processed.
SQL> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000

##使用10015 event手工推进scn

SQL> alter session set events '10015 trace name adjust_scn level 1';
Session altered. SQL> alter database open;
Database altered.
SQL> set linesize 1000
SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 7 52428800 512 2 NO CURRENT 9733801 05-JUN-19 2.8147E+14
2 1 5 52428800 512 1 YES ACTIVE 9732698 05-JUN-19 9733241 05-JUN-19
3 1 6 52428800 512 1 YES ACTIVE 9733241 05-JUN-19 9733801 05-JUN-19
SQL> alter system switch logfile; System altered. SQL> / System altered. SQL> / System altered. SQL> / System altered. SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
1 1 13 52428800 512 2 NO CURRENT 9735561 05-JUN-19 2.8147E+14
2 1 11 52428800 512 1 YES ACTIVE 9735350 05-JUN-19 9735452 05-JUN-19
3 1 12 52428800 512 1 YES ACTIVE 9735452 05-JUN-19 9735561 05-JUN-19
[oracle@DSI ~]$ tail -f -n 100 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log
#查看是否有报错信息,一般建议这个时候进行数据库导出,导入,以防止其他问题产生
SQL> select * from test.t5; ID NAME
---------- ----------------------------------------------------------------------------------------------------
1 AAAAA
2 BBBBB
3 CCCCC SQL> select * from t6;
select * from t6
*
ERROR at line 1:
ORA-00942: table or view does not exist

07 oracle 归档模式 inactive/current redo log损坏修复--以及错误ORA-00600: internal error code, arguments: [2663], [0], [9710724], [0], [9711142], [], [], [], [], [], [], []的更多相关文章

  1. 07 oracle 非归档模式 inactive/active/current redo log损坏的恢复

    在非归档模式下缺失Redo Log后的恢复 将之前的归档模式修改为非归档 SQL> shutdown immediate; SQL> startup mount SQL> alter ...

  2. oracle 断电启动失败:ORA-00600: internal error code, arguments

    转载地址: http://www.2cto.com/database/201312/261602.html 由于服务器断电,启动 oracle 时报 ORA-00600 错误 查看 oracle tr ...

  3. Oracle归档模式和非归档模式的区别

    一.查看oracle数据库是否为归档模式: Sql代码1.select name,log_mode from v$database; NAME LOG_MODE ------------------ ...

  4. Oracle归档模式和非归档模式

    一 什么是Oracle归档模式? Oracle数据库有联机重做日志,这个日志是记录对数据库所做的修改,比如插入,删除,更新数据等,对这些操作都会记录在联机重做日志里.一般数据库至少要有2个联机重做日志 ...

  5. oracle 归档模式开启后数据库宕机解决过程

    首先按照网友说的shutdown immediately,结果hang了半个小时也么反应. 然后检查日志,全盘搜索.trc,发现 (D:\app\oracle\diag\rdbms\cms1u\cms ...

  6. Oracle归档模式与非归档模式设置

    (转自:http://www.cnblogs.com/spatial/archive/2009/08/01/1536429.html) Oracle的日志归档模式可以有效的防止instance和dis ...

  7. Silverlight项目笔记5:Oracle归档模式引起的异常&&表格控件绑定按钮

    1.Oracle归档模式产生日志文件引起数据库异常 连接数据库失败,提示监听错误,各种检查监听配置文件,删除再添加监听,无果. sqlplus下重启数据库数据库依然无果,期间碰到多个错误提示: ORA ...

  8. 关于控制文件和redo log损坏的恢复

    前段时间一朋友自己电脑上的开发测试用的数据库出了点问题,电脑操作系统是Win8,直接在Win8上安装了Oracle11g,后来系统自动升级到Win8.1,Oracle相关的服务全都不见了,想想把数据文 ...

  9. 更改oracle归档模式路径

    1.更改归档路径 在ORACLE10G中,默认的归档路径为$ORACLE_BASE/flash_recovery_area.对于这个路径,ORACLE有一个限制,就是默认只能有2G的空间给归档日志使用 ...

随机推荐

  1. 【 React - 1/100 】React绑定事件this指向问题--改变state中的值

    /** * 报错: * Cannot read property 'setState' of undefined * 原因: this指向不一致.btnAddCount中的this 和render中的 ...

  2. spring.jar是包含有完整发布的单个jar 包,spring.jar中包含除了spring-mock.jar里所包含的内容外其它所有jar包的内容,因为只有在开发环境下才会用到 spring-mock.jar来进行辅助测试,正式应用系统中是用不得这些类的。

    Spring jar包的描述:针对3.2.2以上版本 org.springframework spring-aop ——Spring的面向切面编程,提供AOP(面向切面编程)实现 org.spring ...

  3. XIB约束布局问题(button)

    button默认不给宽度:系统Xib自动适配,最小宽度30.在使用宽度计算时,无法小于这个值

  4. Out of memory: Kill process 25280 (php-fpm) score 86 or sacrifice child

    php-fpm 耗尽服务器内存的办法 java服务今天突然宕机,通过 cat /var/log/messages进行查看,发现是系统内存溢出导致系统把java的进程杀掉了 使用top查看系统内存使用情 ...

  5. 使用vim打造python-ide

    一.前言 一直希望在linux下进行python开发,但是linux不想启动图形化界面,所以干脆直接用上了万能的VIM,用VIM打造了属于自己的python-IDE 二.插件 标签导航(tagbar和 ...

  6. 020-VMware虚拟机作为OpenStack计算节点,上面的虚拟机无法启动问题解决

      问题描述: VMware虚拟机作为OpenStack计算节点,如果安装的操作系统是CentOS7.3,则在此计算节点放置的虚拟机无法正常启动,报如下错误: 在创建计算节点时,为了能让 KVM 能创 ...

  7. PAT Advanced 1006 Sign In and Sign Out (25 分)

    At the beginning of every day, the first person who signs in the computer room will unlock the door, ...

  8. 计蒜客 蓝桥模拟 B.素数个数

    用 0,1,2,3⋯70,1,2,3 \cdots 70,1,2,3⋯7 这 888 个数组成的所有整数中,质数有多少个(每个数字必须用到且只能用一次). 提示:以 000 开始的数字是非法数字. 代 ...

  9. namenode和datanode的高可用性和故障处理

    一.Hadoop单点故障问题如何解决 Hadoop 1.0内核主要由两个分支组成:MapReduce和HDFS,众所周知,这两个系统的设计缺陷是单点故障,即MR的JobTracker和HDFS的Nam ...

  10. apache-2.4.x 编译安装方法

    apache-2.4.x 编译安装方法 作者:朱 茂海 /分类:Apache 字号:L M S apache-.2与新出的apache-.4安装不同的地方在于,.4版的已经不自带apr库,所以在安装a ...