生产报表数据库出现了活动事务的回滚段损坏(二)

王朝other·作者佚名  2006-03-18
窄屏简体版  字體: |||超大  

现在开始想办法处理这个活动事务和含有活动事务的回滚段了。

首先准备drop这个表试试看(先备份,然后drop,然后重建):

先是使用CTAS备份这个表:

SQL> create table WAP_AUTHPRICE_USER_SP_RD060308 tablespace INDEX_SUBN01 nologging as

select * from WAP_AUTHPRICE_USER_SP_RD where 1=2;

2

Table created.

SQL> insert into WAP_AUTHPRICE_USER_SP_RD060308 nologging

2 select * from WAP_AUTHPRICE_USER_SP_RD;

insert into WAP_AUTHPRICE_USER_SP_RD060308 nologging

*

ERROR at line 1:

ORA-01555: snapshot too old: rollback segment number 19 with name "_SYSSMU19$"

too small

SQL> insert into WAP_AUTHPRICE_USER_SP_RD060308 nologging

2 select * from WAP_AUTHPRICE_USER_SP_RD where rownum<100;

99 rows created.

SQL> rollback;

Rollback complete.

SQL>

我们看到,每次扫表到那个回滚段中的数据库时,系统就会报ORA-01555了。

由此推断,所有的对表的FTS都会失败,比如exp:

oracle@rdb01:/oracle > exp report/slienttop parfile=a.par

Export: Release 9.2.0.5.0 - Production on Thu Mar 9 14:31:45 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production

With the Partitioning and OLAP options

JServer Release 9.2.0.5.0 - Production

Export done in ZHS16GBK character set and UTF8 NCHAR character set

About to export specified tables via Direct Path ...

. . exporting table WAP_AUTHPRICE_USER_SP_RD

EXP-00056: ORACLE error 942 encountered

ORA-00942: table or view does not exist

Export terminated successfully with warnings.

oracle@rdb01:/oracle >

现在,只有使用DUL了:

DUL> unload report.WAP_AUTHPRICE_USER_SP_RD;

. unloading table WAP_AUTHPRICE_USER_SP_RD

9430056 rows unloaded

DUL> exit

oracle@rdb01:/data/tmp/dul > gzip REPORT_WAP_AUTHPRICE_USER_SP_RD.dmp

oracle@rdb01:/data/tmp/dul > ll REPORT_WAP_AUTHPRICE_USER_SP_RD.dm*

-rw-r--r-- 1 oracle dba 49514464 Mar 13 14:18 REPORT_WAP_AUTHPRICE_USER_SP_RD.dmp.gz

oracle@rdb01:/data/tmp/dul >

这时,忽然想到使用oracledebug来跟踪一下进程或者会话,或许会有点收获:

SQL> oradebug setospid 15664

ORA-00072: process "Unix process pid: 15664, image: " is not active

SQL> oradebug setospid 15664

ORA-00072: process "Unix process pid: 15664, image: " is not active

SQL>

SQL> select pid, spid, username from v$process where spid=15664;

PID SPID USERNAME

---------- ------------ ---------------

63 15664 oracle

SQL>

SQL> oradebug setorapid 63

ORA-00072: process "Unix process pid: 15664, image: oracle@rdb01 (TNS V1-V3)" is not active

SQL>

显然,这个结果是和我们刚刚在操作系统上kill process,以及在数据库中kill session的结果是一致的——我们不能找到这些process和session的行为了。

由于alert.log的内容已经被人清空了,但是数据库中可以看到:

USN NAME STATUS TABLESPACE_NAME ADDR SID SERIAL# USERNAME PROGRAM MACHINE OSUSER

---------- ---------- --------------- -------------------- ---------------- ------ ------- ---------- -------------------- ---------- ----------

19 _SYSSMU19$ PENDING OFFLINE UNDOTBS1 C0000001A7BF5218 71 39809 REPORT sqlldr@RPT01 (TNS CS_RPT01 report16

这个回滚段已经损坏,并且活动事务是一个sqlloader的进程(刚刚看到的数据库中sid 71正在执行的sql语句刚好也是这样一个insert语句)。由此证实了我最初的猜测。由于某种原因,开发人员将正在执行的sqlloader进程kill了,而此时正好有一行活动在回滚段中,这个事情发生在12/30/05 01:48:33 以后,由于没有及时的发现和处理这个问题,数据库的日志已经被覆盖多次,再之后,就发生了我们现在看到的情况。

虽然alert.log的内容不在了,但是根据事情发生的时间,我们找到了相应的trace--report_ora_15664.trc,里面有如下的内容:

*** SESSION ID:(71.25999) 2005-12-30 01:48:33.580

*** 2005-12-30 01:48:33.580

ksedmp: internal or fatal error

ORA-00600: internal error code, arguments: [4193], [2987], [2984], [], [], [], [], []

Current SQL statement for this session:

INSERT INTO WAP_AUTHPRICE_USER_SP_RD (LOCATIONID,ICPID,SUBSCAT,ICPATTR,ICPCODE,COUNTS,PERIOD,STAT_TIME) VALUES (:LOCATIONID,:ICPID,:SUBSCAT,:ICPATTR,:ICPCODE,:COUNTS,:PERIOD,TO_DATE(:STAT_TIME,'yyyy-mm-dd hh24:mi:ss'))

ORA-00600 [4193],这类错误一般就是活动回滚段损坏一类的错误了,具体的可以查看metalink。

现在我已经制定了一套执行计划,下周一开始处理这个问题(因为24*7,这类有风险的操作必须要写报告报到公司的领导和客户的领导,层层审批,呵呵)。。。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航