在一台新机器上恢复另台机器的全备份
1 要记住原机器的各种目录结构和DBID
2 在新机器上创建对应的目录结构 注意用户权限
/u01/oracle/admin/dbname/pfile bdump udump dpdump cdump
/oradata/dbname/rman_backup flash_recover_sea archivelog
3 把备份集文件放到新机器原来的备份目录中
3 Rman 连接到默认处
]$ export ORACLE_SID=surgesms
]$ ./rman target /
connected to target database (not started)
3 startup nomount 启动默认spfile
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2.0/dbs/initsurgesms.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area 159383552 bytes
Fixed Size 1218244 bytes
Variable Size 58722620 bytes
Database Buffers 92274688 bytes
Redo Buffers 7168000 bytes
4 还原spfile 文件和控制文件
RMAN> set dbid 4223770157;
RMAN> restore spfile from '/oradata/{DB_NAME}/rman_backup/full.bak';
RMAN> restore controlfile from '/oradata/{DB_NAME}/rman_backup/full.bak';
5退出RMAN 再重进RMAN
RMAN> shutdown
RMAN> EXIT
bin]$ ./rman target /
RMAN> startup mount
6 察看是否使用了控制文件
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/oradata/{DB_NAME}/rman_backup/full_%d_%s_%T_%t.bak';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/product/10.2.0/dbs/snapcf_{DB_NAME}.f'; # default
7 还原数据库
RMAN> restore database;
8 恢复数据库
RMAN> recover database
9 打开数据库
alter database open resetlog