情况描述:
所有控制文件损坏,掉电(shutdown abort),无归档,无备份的成功恢复。
一个例子希望给大家以帮助。
注意:创建控制文件的时候,正常的话使用红色部分的reuse and noresetlogs,这样就不用
手工apply日志而是直接就可以自动恢复了。
SQL> drop table rn;
SQL> alter system checkpoint;
SQL> drop table test_group;
SQL> conn / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> CREATE CONTROLFILE SET/reuse DATABASE "billy" RESETLOGS/NOresetlogs NOARCHIVELOG
2 MAXLOGFILES 64
3 MAXLOGMEMBERS 2
4 MAXDATAFILES 254
5 MAXINSTANCES 32
6 MAXLOGHISTORY 113
7 LOGFILE
8 GROUP 1 'E:\Oracle\ORADATA\BILLY\REDO01.LOG' SIZE 1048576 ,
9 GROUP 2 'E:\Oracle\ORADATA\BILLY\REDO02.LOG' SIZE 1048576 ,
10 GROUP 3 'E:\Oracle\ORADATA\BILLY\REDO03.LOG' SIZE 1048576
11 DATAFILE
12 'E:\Oracle\ORADATA\BILLY\SYSTEM01.DBF',
13 'E:\Oracle\ORADATA\BILLY\RBS01.DBF',
14 'E:\Oracle\ORADATA\BILLY\USERS01.DBF',
15 'E:\Oracle\ORADATA\BILLY\TEMP01.DBF',
16 'E:\Oracle\ORADATA\BILLY\TOOLS01.DBF',
17 'E:\Oracle\ORADATA\BILLY\INDX01.DBF',
18 'E:\Oracle\ORADATA\BILLY\DR01.DBF',
19 'E:\Oracle\ORADATA\BILLY\DB4K.DBF'
20 CHARACTER SET ZHS16GBK
21 ;
数据簇已更改。
SQL> shutdown
ORA-01109: ??????
已经卸载数据库。
Oracle 例程已经关闭。
SQL> startup mount
SQL> recover database using backup controlfile until cancel;
ORA-00279: ?? 25526706 (? 03/20/2003 09:45:25 ??) ???? 1 ????
ORA-00289: ??: E:\Oracle\ORA81\RDBMS\ARC00001.001
ORA-00280: ?? 25526706 ???? 1 ???? # 1 ???
指定日志: {=suggested | filename | AUTO | CANCEL}
'E:\Oracle\ORADATA\BILLY\REDO01.LOG'
ORA-00339: ???????????
ORA-00334: ????: 'E:\Oracle\ORADATA\BILLY\REDO01.LOG'
ORA-01547: ??: RECOVER ??? OPEN RESETLOGS ???????
ORA-01194: ??1?????????????
ORA-01110: ???? 1: 'E:\Oracle\ORADATA\BILLY\SYSTEM01.DBF'
SQL> recover database using backup controlfile until cancel;
ORA-00279: ?? 25526706 (? 03/20/2003 09:45:25 ??) ???? 1 ????
ORA-00289: ??: E:\Oracle\ORA81\RDBMS\ARC00001.001
ORA-00280: ?? 25526706 ???? 1 ???? # 1 ???
指定日志: {=suggested | filename | AUTO | CANCEL}
'E:\Oracle\ORADATA\BILLY\REDO03.LOG'
已应用的日志。
完成介质恢复。
SQL> recover database using backup controlfile until cancel;
ORA-00279: ?? 25526718 (? 03/20/2003 09:45:38 ??) ???? 1 ????
ORA-00289: ??: E:\Oracle\ORA81\RDBMS\ARC00001.001
ORA-00280: ?? 25526718 ???? 1 ???? # 1 ???
指定日志: {=suggested | filename | AUTO | CANCEL}
'E:\Oracle\ORADATA\BILLY\REDO01.LOG'
ORA-00339: ???????????
ORA-00334: ????: 'E:\Oracle\ORADATA\BILLY\REDO01.LOG'
SQL> alter database open resetlogs;
数据库已更改。
SQL>
在最后一步注意日志文件选择的正确,一个一个试都没有关系
或问曰:
CREATE CONTROLFILE SET DATABASE "billy" RESETLOGS NOARCHIVELOG ??
应该不要resetlogs吧? redo log file做shut abort之前的数据不就全没有了吗?
答:
如果reuse 创建控制文件就可以不用resetlogs。
即使使用set 创建控制文件也可以进行完全恢复。
看下面:
SQL> conn rainy/rainy
SQL> truncate table trans;
SQL> alter system checkpoint;
SQL> insert into trans values(1);
SQL> commit;
SQL> conn / as sysdba
SQL> shutdown abort
SQL> startup nomount
SQL> CREATE CONTROLFILE SET DATABASE "billy" NORESETLOGS NOARCHIVELOG
2 MAXLOGFILES 64
3 MAXLOGMEMBERS 2
4 MAXDATAFILES 254
5 MAXINSTANCES 32
6 MAXLOGHISTORY 113
7 LOGFILE
8 GROUP 1 'E:\Oracle\ORADATA\BILLY\REDO01.LOG' SIZE 1048576 ,
9 GROUP 2 'E:\Oracle\ORADATA\BILLY\REDO02.LOG' SIZE 1048576 ,
10 GROUP 3 'E:\Oracle\ORADATA\BILLY\REDO03.LOG' SIZE 1048576
11 DATAFILE
12 'E:\Oracle\ORADATA\BILLY\SYSTEM01.DBF',
13 'E:\Oracle\ORADATA\BILLY\RBS01.DBF',
14 'E:\Oracle\ORADATA\BILLY\USERS01.DBF',
15 'E:\Oracle\ORADATA\BILLY\TEMP01.DBF',
16 'E:\Oracle\ORADATA\BILLY\TOOLS01.DBF',
17 'E:\Oracle\ORADATA\BILLY\INDX01.DBF',
18 'E:\Oracle\ORADATA\BILLY\DR01.DBF',
19 'E:\Oracle\ORADATA\BILLY\DB4K.DBF'
20 CHARACTER SET ZHS16GBK
21 ;
CREATE CONTROLFILE SET DATABASE "billy" NORESETLOGS NOARCHIVELOG
*
ERROR 位于第 1 行:
ORA-01503: CREATE CONTROLFILE ??
ORA-01223: ???? RESETLOGS ?????????
SQL> CREATE CONTROLFILE SET DATABASE "billy" RESETLOGS NOARCHIVELOG
2 MAXLOGFILES 64
3 MAXLOGMEMBERS 2
4 MAXDATAFILES 254
5 MAXINSTANCES 32
6 MAXLOGHISTORY 113
7 LOGFILE
8 GROUP 1 'E:\Oracle\ORADATA\BILLY\REDO01.LOG' SIZE 1048576 ,
9 GROUP 2 'E:\Oracle\ORADATA\BILLY\REDO02.LOG' SIZE 1048576 ,
10 GROUP 3 'E:\Oracle\ORADATA\BILLY\REDO03.LOG' SIZE 1048576
11 DATAFILE
12 'E:\Oracle\ORADATA\BILLY\SYSTEM01.DBF',
13 'E:\Oracle\ORADATA\BILLY\RBS01.DBF',
14 'E:\Oracle\ORADATA\BILLY\USERS01.DBF',
15 'E:\Oracle\ORADATA\BILLY\TEMP01.DBF',
16 'E:\Oracle\ORADATA\BILLY\TOOLS01.DBF',
17 'E:\Oracle\ORADATA\BILLY\INDX01.DBF',
18 'E:\Oracle\ORADATA\BILLY\DR01.DBF',
19 'E:\Oracle\ORADATA\BILLY\DB4K.DBF'
20 CHARACTER SET ZHS16GBK
21 ;
数据簇已更改。
SQL> shutdown
ORA-01109: ??????
已经卸载数据库。
Oracle 例程已经关闭。
SQL> startup mount
SQL> recover database using backup controlfile until cancel;
ORA-00279: ?? 25546853 (? 03/20/2003 11:51:40 ??) ???? 1 ????
ORA-00289: ??: E:\Oracle\ORA81\RDBMS\ARC00002.001
ORA-00280: ?? 25546853 ???? 1 ???? # 2 ???
指定日志: {=suggested | filename | AUTO | CANCEL}
'E:\Oracle\ORADATA\BILLY\REDO03.LOG'
ORA-00310: ???????? 1????? 2
ORA-00334: ????: 'E:\Oracle\ORADATA\BILLY\REDO03.LOG'
ORA-01547: ??: RECOVER ??? OPEN RESETLOGS ???????
ORA-01194: ??1?????????????
ORA-01110: ???? 1: 'E:\Oracle\ORADATA\BILLY\SYSTEM01.DBF'
SQL> recover database using backup controlfile until cancel;
ORA-00279: ?? 25546853 (? 03/20/2003 11:51:40 ??) ???? 1 ????
ORA-00289: ??: E:\Oracle\ORA81\RDBMS\ARC00002.001
ORA-00280: ?? 25546853 ???? 1 ???? # 2 ???
指定日志: {=suggested | filename | AUTO | CANCEL}
'E:\Oracle\ORADATA\BILLY\REDO01.LOG'
已应用的日志。
完成介质恢复。
SQL> alter database open resetlogs;
SQL> conn rainy/rainy
SQL> select * from trans;
A
----------
1