全部博文(147)
分类: Oracle
2012-07-11 13:44:57
ORACLE rman 只有数据库备份及ARCHIVELOG备份,无CONTROLFILE ;
实现方法:
一\ 恢复数据文件
DECLARE
devtype varchar2(256);
done boolean;
BEGIN
devtype:=sys.dbms_backup_restore.deviceallocate(type=>'',ident=>'t1');
dbms_backup_restore.RestoreSetDatafile;
dbms_backup_restore.RestoreDatafileTo(dfnumber => 1,toname => '/oradata/system01.dbf');
dbms_backup_restore.RestoreDatafileTo(dfnumber => 2,toname => '/oradata/undotbs01.dbf');
dbms_backup_restore.RestoreDatafileTo(dfnumber => 3,toname => '/oradata/sysaux01.dbf');
dbms_backup_restore.RestoreDatafileTo(dfnumber => 4,toname => '/oradata/users01.dbf');
dbms_backup_restore.RestoreDatafileTo(dfnumber => 5,toname => '/data/CENTERDBT.ora');
dbms_backup_restore.RestoreBackupPiece(done => done,handle => '/backup/etfdb_full_20120709_788142596_0enfk6g4_1_1', params => null);
dbms_backup_restore.DeviceDeallocate;
END;
/
二\ 创建控制文件---注意:resetlogs( 非NORESETLOGS)---创建好后数据库自动MOUNT;
CREATE CONTROLFILE REUSE DATABASE ETFDB RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1000
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 (
'/redolog1/redo01.log',
'/redolog2/redo01_02.log'
) SIZE 100M,
GROUP 2 (
'/redolog1/redo02.log',
'/redolog2/redo02_02.log'
) SIZE 100M,
GROUP 3 (
'/redolog1/redo03.log',
'/redolog2/redo03_02.log'
) SIZE 100M
-- STANDBY LOGFILE
-- GROUP 11 (
-- '/redolog1/redo11.log',
-- '/redolog2/redo11_02.log'
-- ) SIZE 100M,
-- GROUP 12 (
-- '/redolog1/redo12.log',
-- '/redolog2/redo12_02.log'
-- ) SIZE 100M,
-- GROUP 13 (
-- '/redolog1/redo13.log',
-- '/redolog2/redo13_02.log'
-- ) SIZE 100M,
-- GROUP 14 (
-- '/redolog1/redo14.log',
-- '/redolog2/redo14_02.log'
-- ) SIZE 100M
DATAFILE
'/oradata/system01.dbf',
'/oradata/undotbs01.dbf',
'/oradata/sysaux01.dbf',
'/oradata/users01.dbf',
'/data/CENTERDBT.ora'
CHARACTER SET ZHS16GBK
;