由ORA-01502: index 'SYS.I_DEPENDENCY1'导致的ORA-01092

想做个AWR报告,结果提示SQL_ID但是我出的是普通报告没有针对某个SQL,就退出了。退出后不能连接Oracle,打开其他之前连接的session想重启,immediate不行错误如下
SQL> shutdown immediate
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
就用了abort。重启后还是不能open,重启Linux后还是不能open。报告

ORA-01092 ORACLE instance terminated. Disconnection forced  
Cause :The instance connected to was terminated abnormally, probably due to a SHUTDOWN ABORT. The current process was forced to disconnect from the instance.  
Action :Contact the database administrator to determine when the instance is restarted. Attempt to reconnect after the instance is running again.
idle> startup nomount
ORACLE instance started.
idle>
alter database mount;
Database altered.
idle>
alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
 
检查alert检查trc结果如下
 
tail -200 /u01/app/oracle/admin/.../bdump/alert_....log
Errors in file /u01/app/oracle/admin/.../udump/etmcdb_ora_2640.trc:
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-01502: index 'SYS.I_DEPENDENCY1' or partition of such index is in unusable s
Fri Dec 25 12:48:01 2009
Error 704 happened during db open, shutting down database
USER: terminating instance due to error 704
Instance terminated by USER, pid = 2640
ORA-1092 signalled during: alter database open...
 
more /u01/app/oracle/admin/.../udump/etmcdb_ora_2640.trc
tkcrrsarc: (WARN) Failed to find ARCH for message (message:0x1)
tkcrrpa: (WARN) Failed initial attempt to send ARCH message (message:0x1)
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-01502: index 'SYS.I_DEPENDENCY1' or partition of such index is in unusable sta
 
幸好只是个测试库,要是生产就疯了,问题是我没有动系统的任何视图啊,怎么会出现这个错误?

--尝试恢复方法
1.冷备份恢复
SQL> startup
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size                  1223540 bytes
Variable Size             658506892 bytes
Database Buffers          411041792 bytes
Redo Buffers                2969600 bytes

ORA-01511: error in renaming log/data files
ORA-01141: error renaming data file 10 - new file
'/u01/oradata/xxd/devbase02_bak.dbf' not found
ORA-01110: data file 10: '/u01/oradata/xxd/devbase02.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
SQL> alter database datafile '/u01/oradata/xxd/devbase02.dbf' offline drop; --解决
更全的ORA-01141解决方案

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
随后查看alter还是一样的错误,然后试图关闭

SQL> shutdown immediate
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
又回到了最初的错误。找到了从linux平台killoracle进程的方法

终止与ORACLE_SID有关的所有Oracle过程。
用ipcs –pmb命令来识别所有占用的RAM内存片断。
用ipcrm -m 命令来从UNIX中释放占用的RAM内存。
只对Non-AIX:用ipcs -sa命令来显示占用标记,用ipcrm –s命令来释放该实例的占用标记。
创建单一命令来终止与挂起(hung)的数据库实例有关的Oracle过程是很简单的。在下面的例子之中,我们用ps指令来识别Oracle过程,然后用 awk程序来获取Oracle过程的过程ID(process ID,PID)。然后,我们把过程ID输入到UNIX的kill命令之中。
root> ps -ef|grep $ORACLE_SID| grep -v grep|awk '{print $2}'|xargs -i kill -9 {}   
在终止所有Oracle过程之后,我们可以用ipcs –pmb指令来检查占用的内存并清除数据库所占用的内存。我们首先显示出数据库服务器上所有占用内存:
root> ipcs -pmb
IPC status from /dev/kmem as of Mon Sep 10 16:45:16 2001
T      ID     KEY        MODE     OWNER  GROUP  SEGSZ  CPID  LPID
Shared Memory:
m   24064 0x4cb0be18 --rw-r----- oracle    dba 28975104  1836 23847
m       1 0x4e040002 --rw-rw-rw-   root   root    31008   572   572
m       2 0x411ca945 --rw-rw-rw-   root   root     8192   572   584
m    4611 0x0c6629c9 --rw-r-----   root   root  7216716  1346 23981
m       4 0x06347849 --rw-rw-rw-   root   root    77384  1346  1361

在这里,我们看到Oracle只拥有一个ID=24064的RAM内存。下面的命令将会释放这个内存片断:
root> ipcrm -m 24064

2.建立表空间然后exp/imp
oracle-> exp sys file=/tmp/etmcdb.dmp log=/tmp/etmcdb.dmp full=y BUFFER=64000
Export: Release 10.2.0.1.0 - Production on Mon Dec 28 14:17:21 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Password:
EXP-00056: ORACLE error 1033 encountered
ORA-01033: ORACLE initialization or shutdown in progress

3.RMAN异地异机恢复

3.1 全库恢复-错误肯定还是一样,因为sys试图丢失了,就当练习了,做一遍
先将DBID设置的和生产库一样
RMAN>set DBID=12345678
RMAN>connect target /;
RMAN>startup force nomount;
RMAN>restore controlfile from  ‘/u02/oradump//SCMDB/backup/current/XXX.controlfile.XXX’;
RMAN>alter database mount;
RMAN>restore database (这里注意空间问题,回滚段需要很多空间)
RMAN>recover database using controlfile until cancel;(这里的不完全恢复根据实际情况确定)
这里可能会报错,没关系,你看日志号完全应用完了就可以了,继续往下做。
RMAN>alter database open resetlogs;

3.2 单表空间恢复

直接把表空间下的两个DBF考回
SQL> startup
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size                  1223540 bytes
Variable Size             662701196 bytes
Database Buffers          406847488 bytes
Redo Buffers                2969600 bytes
Database mounted.
ORA-01122: database file 4 failed verification check
ORA-01110: data file 4: '/u01/oradata/ETMCDB/ETMCDB_data.dbf'
ORA-01203: wrong incarnation of this file - wrong creation SCN

目前还没有找到好的恢复方法,RMAN单独表空间恢复?

posted @ 2009-12-25 15:56  xxd  阅读(1234)  评论(0编辑  收藏  举报