ORA-16433,ORA-01173恢复

同学打包上传了一个有问题的库,正好这几天没啥事,下载下来试着恢复了一下,恢复过程如下:

不知道他之前做过什么操作,也不知道这个库是怎么损坏的,下载下来后大致看了一下
打包文件信息如下:
+++initorcl.ora文件内容:
orcl.__oracle_base='D:\app\oracle'#ORACLE_BASE set from environment
*.audit_file_dest='D:\app\oracle\admin\orcl\adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='D:\app\oracle\oradata\orcl\control01.ctl','D:\app\oracle\oradata\orcl\control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='D:\app\oracle\flash_recovery_area\orcl'
*.db_recovery_file_dest_size=4259315712
*.diagnostic_dest='D:\app\oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.memory_target=1000M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_management='manual'
*.undo_tablespace='UNDOTBS2'
*._corrupted_rollback_segments=(_SYSSMU1_4293228286$,_SYSSMU2_2039428205$,_SYSSMU3_62847029$,_SYSSMU4_2852015879$,_SYSSMU5_865959144$,_SYSSMU6_4222004433$,_SYSSMU7_3167120690$,_SYSSMU8_3640122478$,_SYSSMU9_4125436319$,_SYSSMU10_1599800294$,_SYSSMU11_4274605233$,_SYSSMU12_3262263327$,_SYSSMU13_3701178243$,_SYSSMU14_2274826003$,_SYSSMU15_3989461359$,_SYSSMU16_2896103364$,_SYSSMU17_1001039816$,_SYSSMU18_826213832$,_SYSSMU19_2524552265$,_SYSSMU20_3030429363$,_SYSSMU21_3208651888$,_SYSSMU22_136948633$,_SYSSMU23_3630425231$,_SYSSMU24_3375812654$,_SYSSMU25_3954145094$,_SYSSMU26_3823963024$,_SYSSMU27_2697353812$,_SYSSMU28_1119046978$,_SYSSMU29_2253969065$,_SYSSMU30_722648610$)
event="10513 trace name context forever, level 2"
_allow_resetlogs_corruption=true 

+++回滚段信息:
0|SYSTEM|0|1|128|0|0|0|0|0|3|0|||||0
1|_SYSSMU1_4293228286$|1|3|128|3881187275|5|20968|4649|0|1|2|||||2
2|_SYSSMU2_2039428205$|1|3|144|3881268583|5|21187|4932|0|1|2|||||2
3|_SYSSMU3_62847029$|1|3|160|3881289026|5|21114|4529|0|1|2|||||2
4|_SYSSMU4_2852015879$|1|3|176|3881268894|5|20916|4748|0|1|2|||||2
5|_SYSSMU5_865959144$|1|3|192|3881187325|5|21124|4727|0|1|2|||||2
6|_SYSSMU6_4222004433$|1|3|208|3881289031|5|21119|4764|0|1|2|||||2
7|_SYSSMU7_3167120690$|1|3|224|3881248186|5|20900|4652|0|1|2|||||2
8|_SYSSMU8_3640122478$|1|3|240|3881188948|5|21076|4745|0|1|2|||||2
9|_SYSSMU9_4125436319$|1|3|256|3881188825|5|21702|4482|0|1|2|||||2
10|_SYSSMU10_1599800294$|1|3|272|3881187314|5|40815|7452|0|1|2|||||2
11|_SYSSMU11_4274605233$|1|8|128|0|0|1|1|0|1|5|||||1
12|_SYSSMU12_3262263327$|1|8|144|973770|0|2|1|0|1|5|||||1
13|_SYSSMU13_3701178243$|1|8|160|0|0|1|1|0|1|5|||||1
14|_SYSSMU14_2274826003$|1|8|176|974088|0|2|1|0|1|5|||||1
15|_SYSSMU15_3989461359$|1|8|192|973768|0|2|1|0|1|5|||||1
16|_SYSSMU16_2896103364$|1|8|208|973760|0|2|1|0|1|5|||||1
17|_SYSSMU17_1001039816$|1|8|224|973750|0|2|1|0|1|5|||||1
18|_SYSSMU18_826213832$|1|8|240|973731|0|2|1|0|1|5|||||1
19|_SYSSMU19_2524552265$|1|8|256|973756|0|2|1|0|1|5|||||1
20|_SYSSMU20_3030429363$|1|8|272|973728|0|2|1|0|1|5|||||1
21|_SYSSMU21_3208651888$|1|8|288|3991768091|5|25469|5157|0|3|5|||||2
22|_SYSSMU22_136948633$|1|8|304|3991768081|5|23679|4811|0|3|5|||||2
23|_SYSSMU23_3630425231$|1|8|320|3991768109|5|26254|4637|0|3|5|||||2
24|_SYSSMU24_3375812654$|1|8|336|3991768115|5|24196|4408|0|3|5|||||2
25|_SYSSMU25_3954145094$|1|8|352|3991768105|5|23238|4431|0|3|5|||||2
26|_SYSSMU26_3823963024$|1|8|368|3991768121|5|24647|4752|0|3|5|||||2
27|_SYSSMU27_2697353812$|1|8|384|3991768119|5|24611|4912|0|3|5|||||2
28|_SYSSMU28_1119046978$|1|8|400|3991768099|5|24495|5224|0|3|5|||||2
29|_SYSSMU29_2253969065$|1|8|416|3991768063|5|25127|5246|0|3|5|||||2
30|_SYSSMU30_722648610$|1|8|432|3991768111|5|48683|7543|0|3|5|||||2

+++有一个重建控制文件的脚本,如下:
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'D:\app\oracle\oradata\orcl\redo01.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 'D:\app\oracle\oradata\orcl\redo02.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 'D:\app\oracle\oradata\orcl\redo03.log'  SIZE 50M BLOCKSIZE 512
DATAFILE
 'D:\app\oracle\oradata\orcl\system01.dbf',
'D:\app\oracle\oradata\orcl\sysaux01.dbf',
'D:\app\oracle\oradata\orcl\users01.dbf',
'D:\app\oracle\oradata\orcl\example01.dbf'
CHARACTER SET US7ASCII
;

+++数据文件,控制文件,日志文件的信息如下:
D:\app\oracle\oradata\orcl>ls -l
total 4626340
-rwx------+ 1 Administrators None     10076160 Apr 17 16:28 CONTROL01.CTL
-rwx------+ 1 Administrators None     10076160 Apr 17 16:28 CONTROL02.CTL
-rwx------+ 1 Administrators None    362422272 Apr 17 16:28 EXAMPLE01.DBF
-rwx------+ 1 Administrators None     52429312 Apr 17 16:28 REDO01.LOG
-rwx------+ 1 Administrators None     52429312 Apr 17 16:28 REDO02.LOG
-rwx------+ 1 Administrators None     52429312 Apr 17 16:28 REDO03.LOG
-rwx------+ 1 Administrators None   1226842112 Apr 17 16:28 SYSAUX01.DBF
-rwx------+ 1 Administrators None   2380275712 Apr 17 16:28 SYSTEM01.DBF
-rwx------+ 1 Administrators None     50339840 Jan 28 05:37 TEMP01.DBF
-rwx------+ 1 Administrators None    524296192 Apr 17 16:20 UNDOTBS02.DBF
-rwxrwx---+ 1 Administrators SYSTEM   10493952 Apr 17 16:28 UNTO01.DBF
-rwx------+ 1 Administrators None      5251072 Apr 17 16:28 USERS01.DBF

+++以下是恢复过程,恢复过程中被打扰过几次,可能贴的不全

C:\Users\Administrator>set ORACLE_SID=orcl
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 4月 14 14:12:56 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-12560: TNS: 协议适配器错误

C:\Users\Administrator>oradim -new -sid orcl
实例已创建。
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 4月 14 14:13:43 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
已连接到空闲例程。

SQL> startup mount;
ORACLE 例程已经启动。

Total System Global Area 1043886080 bytes
Fixed Size                  2182344 bytes
Variable Size             603980600 bytes
Database Buffers          432013312 bytes
Redo Buffers                5709824 bytes
数据库装载完毕。

SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-01157: ????/?????? 1 - ??? DBWR ????
ORA-01110: ???? 1: 'H:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'

+++解决一下乱码问题:
打开注册表(regedit)
HKEY_LOCAL_MACHINES / OFTWARE / ORACLE: 在ORACLE目录下选中KEY_OraClient10g_home , 修改一下NLS_LANG的值 

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: 'H:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'

+++open的时候报错,是因为datafile路径不对,我的环境和原路劲不一样
+++修改一下数据文件的指针

SQL> select name from v$datafile
  2  union all
  3  select name from v$tempfile
  4  union all
  5  select member from v$logfile;

NAME
------------------------------------------------------------

H:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
H:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
H:\ORACLE\ORADATA\ORCL\USERS01.DBF
H:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
H:\ORACLE\ORADATA\ORCL\CONET.DBF
H:\ORACLE\ORADATA\ORCL\REDO03.LOG
H:\ORACLE\ORADATA\ORCL\REDO02.LOG
H:\ORACLE\ORADATA\ORCL\REDO01.LOG

8 rows selected.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF' to 'D:\app\oracle\oradata\orcl\SYSTEM01.DBF';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF' to 'D:\app\oracle\oradata\orcl\SYSAUX01.DBF';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\USERS01.DBF' to 'D:\app\oracle\oradata\orcl\USERS01.DBF';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF' to 'D:\app\oracle\oradata\orcl\EXAMPLE01.DBF';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\CONET.DBF' to 'D:\app\oracle\oradata\orcl\CONET.DBF';
alter database rename file 'H:\ORACLE\ORADATA\ORCL\CONET.DBF' to 'D:\app\oracle\
oradata\orcl\CONET.DBF'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01141: error renaming data file 7 - new file
'D:\app\oracle\oradata\orcl\CONET.DBF' not found
ORA-01110: data file 7: 'H:\ORACLE\ORADATA\ORCL\CONET.DBF'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟
斤拷

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\REDO01.LOG' to 'D:\app\oracle\oradata\orcl\REDO01.LOG';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\REDO02.LOG' to 'D:\app\oracle\oradata\orcl\REDO02.LOG';

Database altered.

SQL> alter database rename file 'H:\ORACLE\ORADATA\ORCL\REDO03.LOG' to 'D:\app\oracle\oradata\orcl\REDO03.LOG';

Database altered.


+++datafile 7有问题,是因为打包的文件里没有这个数据文件,offline处理
SQL> alter database datafile 7 offline;

Database altered.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'D:\APP\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'

+++提示库需要恢复
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.

+++查看change信息
SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
        2.5473E+10

SQL> set numw 15
SQL> select checkpoint_change# from v$database;

CHECKPOINT_CHANGE#
------------------
       25472922843

SQL> select file#,checkpoint_change# from v$datafile;

          FILE# CHECKPOINT_CHANGE#
--------------- ------------------
              1        25472922843
              2        25472922843
              4        25472922843
              5        25472922843
              7        25472922843


SQL> select file#,checkpoint_change# from v$datafile_header;

          FILE# CHECKPOINT_CHANGE#
--------------- ------------------
              1        25472922843
              2        25472922843
              4        25472922843
              5        25472922843
              7                  0
SQL> select open_mode from v$database;

OPEN_MODE
------------------------------------------------------------
MOUNTED


SQL> recover database until cancel;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.

SQL> recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.
 
+++重建一下控制文件
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  NOARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 'D:\app\oracle\oradata\orcl\redo01.log'  SIZE 50M BLOCKSIZE 512
  9    GROUP 2 'D:\app\oracle\oradata\orcl\redo02.log'  SIZE 50M BLOCKSIZE 512
 10    GROUP 3 'D:\app\oracle\oradata\orcl\redo03.log'  SIZE 50M BLOCKSIZE 512
 11  DATAFILE
 12   'D:\app\oracle\oradata\orcl\system01.dbf',
 13  'D:\app\oracle\oradata\orcl\sysaux01.dbf',
 14  'D:\app\oracle\oradata\orcl\users01.dbf',
 15  'D:\app\oracle\oradata\orcl\example01.dbf'
 16  CHARACTER SET US7ASCII
 17  ;

Control file created.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00704: bootstrap process failure
ORA-00604: error occurred at recursive SQL level 1
ORA-01173: data dictionary indicates missing data file from system tablespace
Process ID: 17736
Session ID: 192 Serial number: 1

+++检查发现ORA-01173这个错误是因为打包文件里,重建控制文件的sql里,漏了UNDOTBS02.DBF文件信息,加进去重建控制文件
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1043886080 bytes
Fixed Size                  2182344 bytes
Variable Size             603980600 bytes
Database Buffers          432013312 bytes
Redo Buffers                5709824 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  NOARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 'D:\app\oracle\oradata\orcl\redo01.log'  SIZE 50M BLOCKSIZE 512,
  9    GROUP 2 'D:\app\oracle\oradata\orcl\redo02.log'  SIZE 50M BLOCKSIZE 512,
 10    GROUP 3 'D:\app\oracle\oradata\orcl\redo03.log'  SIZE 50M BLOCKSIZE 512
 11  DATAFILE
 12   'D:\app\oracle\oradata\orcl\system01.dbf',
 13  'D:\app\oracle\oradata\orcl\sysaux01.dbf',
 14  'D:\app\oracle\oradata\orcl\users01.dbf',
 15  'D:\app\oracle\oradata\orcl\example01.dbf',
 16  'D:\app\oracle\oradata\orcl\UNDOTBS02.DBF'
 17  CHARACTER SET US7ASCII
 18  ;
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01189: file is from a different RESETLOGS than previous files
ORA-01110: data file 8: 'D:\app\oracle\oradata\orcl\UNDOTBS02.DBF'

+++重建报错,这个错误是因为undotbs02.dbf这个文件,是上一次resetlog之前的文件
+++由于没有任何备份和归档,这里我们就通过bbed来修正一下


[oracle@goolen bbed]$ ll *.dbf
-rw-r--r-- 1 oracle oinstall 524296192 Feb 11 16:00 undotbs02.dbf
-rw-r--r-- 1 oracle oinstall   5251072 Apr 14 15:07 users01.dbf

[oracle@goolen bbed]$ vim filelist.txt
1 /home/oracle/xiaoming/bbed/undotbs02.dbf                 524296192
2 /home/oracle/xiaoming/bbed/users01.dbf                   5251072

[oracle@goolen bbed]$ bbed parfile=bbed.par 
Password: 
BBED: Release 2.0.0.0.0 - Limited Production on Thu Apr 17 15:36:02 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************

BBED> info
 File#  Name                                                        Size(blks)
 -----  ----                                                        ----------
     1  /home/oracle/xiaoming/bbed/undotbs02.dbf                         64001
     2  /home/oracle/xiaoming/bbed/users01.dbf                             641

BBED> p kcvfhrlc dba 1,1
ub4 kcvfhrlc                                @112      0x32061a9a

BBED> p kcvfhrlc dba 2,1
ub4 kcvfhrlc                                @112      0x325bbf9a

BBED> m /x 9abf5b32 dba 1,1 offset 112
BBED-00209: invalid number (9abf5b32)

BBED> m /x 9abf dba 1,1 offset 112
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  112 to  623           Dba:0x00400001
------------------------------------------------------------------------
 9abf0632 acf44dee 05000000 00000000 00000000 00000000 00000400 db060000 
 811a0632 da060000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> m /x 5b32 dba 1,1 offset 114
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  114 to  625           Dba:0x00400001
------------------------------------------------------------------------
 5b32acf4 4dee0500 00000000 00000000 00000000 00000000 0400db06 0000811a 
 0632da06 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>


BBED> p kcvfhrlc dba 1,1
ub4 kcvfhrlc                                @112      0x325bbf9a

BBED> p kcvfhrlc dba 2,1
ub4 kcvfhrlc                                @112      0x325bbf9a

BBED> p kcvfhrls dba 1,1
struct kcvfhrls, 8 bytes                    @116     
   ub4 kscnbas                              @116      0xee4df4ac
   ub2 kscnwrp                              @120      0x0005

BBED> p kcvfhrls dba 2,1
struct kcvfhrls, 8 bytes                    @116     
   ub4 kscnbas                              @116      0xee4df4e2
   ub2 kscnwrp                              @120      0x0005

BBED> m /x e2f4 dba 1,1 offset 116
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  116 to  627           Dba:0x00400001
------------------------------------------------------------------------
 e2f44dee 05000000 00000000 00000000 00000000 00000400 db060000 811a0632 
 da060000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 


 <32 bytes per line>

BBED> p kcvfhrls dba 1,1
struct kcvfhrls, 8 bytes                    @116     
   ub4 kscnbas                              @116      0xee4df4e2
   ub2 kscnwrp                              @120      0x0005

BBED> p file 1 block 1 offset 484
pad
---
ub1 pad                                     @484      0xaf

BBED> p file 2 block 1 offset 484
pad
---
ub1 pad                                     @484      0xe5

BBED> m /x e5 file 1 block 1 offset 484
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  484 to  995           Dba:0x00400001
------------------------------------------------------------------------
 e5f44dee 05000000 9a1a0632 01000000 01000000 02000000 10000000 02000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> p file 1 block 1 offset 484
pad
---
ub1 pad                                     @484      0xe5

BBED> p file 1 block 1 offset 492
pad
---
ub1 pad                                     @492      0x9a

BBED> p file 2 block 1 offset 492
pad
---
ub1 pad                                     @492      0x9b

BBED> p file 2 block 1 offset 140
pad
---
ub1 pad                                     @140      0xd2

BBED> p file 2 block 1 offset 148
pad
---
ub1 pad                                     @148      0xd1

BBED> m /x 9b file 1 block 1 offset 492
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  492 to 1003           Dba:0x00400001
------------------------------------------------------------------------
 9b1a0632 01000000 01000000 02000000 10000000 02000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> m /x d2 file 1 block 1 offset 140
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  140 to  651           Dba:0x00400001
------------------------------------------------------------------------
 d2060000 811a0632 da060000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> m /x d1 file 1 block 1 offset 148
 File: /home/oracle/xiaoming/bbed/undotbs02.dbf (1)
 Block: 1                Offsets:  148 to  659           Dba:0x00400001
------------------------------------------------------------------------
 d1060000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> sum apply;
Check value for File 1, Block 1:
current = 0x955b, required = 0x955b

BBED> exit

+++再次重建控制文件
SQL> /

Control file created.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-39700: database must be opened with UPGRADE option
Process ID: 5320
Session ID: 192 Serial number: 1

SQL> startup upgrade
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup upgrade
ORACLE instance started.


Total System Global Area 1043886080 bytes
Fixed Size                  2182344 bytes
Variable Size             603980600 bytes
Database Buffers          432013312 bytes
Redo Buffers                5709824 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: 'D:\APP\ORACLE\ORADATA\ORCL\SYSTEM01.DBF'


SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.

SQL> recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-16433: The database must be opened in read/write mode.


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs upgrade;
alter database open resetlogs upgrade
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number  with name "" too small
Process ID: 5432
Session ID: 192 Serial number: 1


+++alter日志信息:
Errors in file d:\app\oracle\diag\rdbms\orcl\orcl\trace\orcl_smon_5508.trc  (incident=7307):
ORA-00600: internal error code, arguments: [2662], [5], [3998088425], [5], [3998096603], [4194496], [], [], [], [], [], []
Incident details in: d:\app\oracle\diag\rdbms\orcl\orcl\incident\incdir_7307\orcl_smon_5508_i7307.trc
Non-fatal internal error happenned while SMON was doing temporary segment drop.
SMON encountered 1 out of maximum 100 non-fatal internal errors.
Errors in file d:\app\oracle\diag\rdbms\orcl\orcl\trace\orcl_smon_5508.trc  (incident=7308):
ORA-00600: internal error code, arguments: [2662], [5], [3998088660], [5], [3998096603], [4194496], [], [], [], [], [], []
Incident details in: d:\app\oracle\diag\rdbms\orcl\orcl\incident\incdir_7308\orcl_smon_5508_i7308.trc
Errors in file d:\app\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_5328.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number  with name "" too small
Errors in file d:\app\oracle\diag\rdbms\orcl\orcl\trace\orcl_ora_5328.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-01555: snapshot too old: rollback segment number  with name "" too small
Error 604 happened during db open, shutting down database
USER (ospid: 5328): terminating the instance due to error 604
Non-fatal internal error happenned while SMON was doing temporary segment drop.
SMON encountered 2 out of maximum 100 non-fatal internal errors.
Instance terminated by USER, pid = 5328
ORA-1092 signalled during: alter database open resetlogs upgrade...
opiodr aborting process unknown ospid (5328) as a result of ORA-1092
Thu Apr 17 16:07:27 2014
ORA-1092 : opitsk aborting process


+++ora-600(2662),这个错误还是遇到过好几次了,手工推进一下scn

SQL> alter session set events '10015 trace name adjust_scn level 1';

Session altered.

SQL> alter database open resetlogs upgrade;
alter database open resetlogs upgrade
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery

SQL> recover database until cancel;
ORA-00279: change 25472922869 generated at 04/17/2014 16:07:23 needed for
thread 1
ORA-00289: suggestion :
D:\APP\ORACLE\FLASH_RECOVERY_AREA\ORCL\ORCL\ARCHIVELOG\2014_04_17\O1_MF_1_1_%U_.

ARC
ORA-00280: change 25472922869 for thread 1 is in sequence #1

Specify log: {=suggested | filename | AUTO | CANCEL}
D:\app\oracle\oradata\orcl\REDO01.LOG
Log applied.
Media recovery complete.

SQL> alter database open resetlogs upgrade;

Database altered.

SQL> create undo tablespace undo01 datafile 'D:\app\oracle\oradata\orcl\unto01.bf' size 10m autoextend on;

Tablespace created.

+++修改默认undo表空间为undo01,删除undotbs2表空间

SQL> drop tablespace undotbs2;

Tablespace dropped.

+++至此,恢复结束

+++如果大家还有什么好的恢复办法,欢迎回复分享。。。





你可能感兴趣的:(ORA-16433,ORA-01173恢复)