分类: 服务器与存储
2008-06-16 19:04:00
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
SQL> DECLARE
2 devtype varchar2(256);
3 done boolean;
4 BEGIN
5 devtype:=sys.dbms_backup_restore.deviceAllocate (type=>'',ident=>'t1');
6 sys.dbms_backup_restore.restoreSetDatafile;
7 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>01, toname=>'/usr/app//oradata/devb/system01.dbf');
8 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>02, toname=>'/usr/app//oradata/devb/undotbs01.dbf');
9 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>03, toname=>'/usr/app//oradata/devb/cwmlite01.dbf');
10 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>04, toname=>'/usr/app//oradata/devb/drsys01.dbf');
11 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>05, toname=>'/usr/app//oradata/devb/example01.dbf');
12 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>06, toname=>'/usr/app//oradata/devb/indx01.dbf');
13 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>07, toname=>'/usr/app//oradata/devb/odm01.dbf');
14 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>08, toname=>'/usr/app//oradata/devb/tools01.dbf');
15 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>09, toname=>'/usr/app//oradata/devb/users01.dbf');
16 sys.dbms_backup_restore.restoreDatafileTo(dfnumber=>10, toname=>'/usr/app//oradata/devb/xdb01.dbf');
17 sys.dbms_backup_restore.restoreBackupPiece(done=>done,handle=>'/home//backup/devb/df_DEVB_43_1_1.bak', params=>null);
18 sys.dbms_backup_restore.deviceDeallocate;
19 END;
20 /
PL/SQL procedure successfully completed.
SQL> alter database mount;
Database altered.
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> recover database using backup controlfile until cancel;
ORA-00283: recovery session canceled due to errors
ORA-01190: controlfile or data file 1 is from before the last RESETLOGS
ORA-01110: data file 1: '/usr/app//oradata/devb/system01.dbf'
SQL>
SQL>
SQL>
SQL>
SQL> alter database backup controlfile to trace;
Database altered.
SQL>
原来的controlfile 已不能使用,所以重建controlfile;
trace文件在 user_dump_desc 下。即 /usr/app//admin/devb/udump
找到最新的trc文件
SQL>
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
SQL>
SQL> CREATE CONTROLFILE REUSE DATABASE "DEVB" RESETLOGS ARCHIVELOG
2 -- SET STANDBY TO MAXIMIZE PERFORMANCE
3 MAXLOGFILES 50
4 MAXLOGMEMBERS 5
5 MAXDATAFILES 100
6 MAXINSTANCES 1
7 MAXLOGHISTORY 226
8 LOGFILE
9 GROUP 1 '/usr/app//oradata/devb/redo01.log' SIZE 100M,
10 GROUP 2 '/usr/app//oradata/devb/redo02.log' SIZE 100M,
11 GROUP 3 '/usr/app//oradata/devb/redo03.log' SIZE 100M
12 -- STANDBY LOGFILE
13 DATAFILE
14 '/usr/app//oradata/devb/system01.dbf',
15 '/usr/app//oradata/devb/undotbs01.dbf',
16 '/usr/app//oradata/devb/cwmlite01.dbf',
17 '/usr/app//oradata/devb/drsys01.dbf',
18 '/usr/app//oradata/devb/example01.dbf',
19 '/usr/app//oradata/devb/indx01.dbf',
20 '/usr/app//oradata/devb/odm01.dbf',
21 '/usr/app//oradata/devb/tools01.dbf',
22 '/usr/app//oradata/devb/users01.dbf',
23 '/usr/app//oradata/devb/xdb01.dbf'
24 CHARACTER SET ZHS16GBK
25 ;
Control file created.
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 20469549 generated at 05/10/2006 11:52:29 needed for thread 1
ORA-00289: suggestion : /usr/app//product/9.2.0.4/dbs/arch1_3.dbf
ORA-00280: change 20469549 for thread 1 is in sequence #3
Specify log: {
CANCEL
Media recovery cancelled.
SQL>
SQL> alter database open resetlogs;
Database altered.
SQL>