Oracle RMAN 在一台新机器上恢复另台机器的全备份

在一台新机器上恢复另台机器的全备份

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 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值