oracle asm rman 异机还原 到disk path环境

asm dbfile 先查询出来, 为了要做datafile的newname

SQL> select file_id,file_name from dba_data_files;

在还原时要确认备份文件权限为oracle.oinstall

chown oracle.oinstall *

在新机要确认归档打开, 以及备份空间大小
我这环境默认是4G, 直接给改成400G
因为在recover时是消耗此空间的

SQL>  archive log list;
SQL> show parameter db_recover
SQL> alter system set db_recovery_file_dest_size=400G;

修改db_files数量

SQL > alter system set db_files=1000 scope=spfile;

做完所有检查与配置记得关闭重起

$ export ORACLE_SID=ORCL
SQL> shut abort
SQL> startup nomount 

开始还原

$ rman target /
RMAN> set dbid=1644883930;

RMAN> restore controlfile from '/dbfiles/shares/c-1644883930-20231103-01";

SQL> alter database mount

$ rman target /

catalog start with '/dbfiles/shares/";  # 指定日志路径
run{
set newname for datafile 1 to "/dbfiles/app/oracle/oradata/orcl/1.dbf";
set newname for datafile 2 to "/dbfiles/app/oracle/oradata/orcl/2.dbf";
set newname for datafile 3 to "/dbfiles/app/oracle/oradata/orcl/3.dbf";
set newname for datafile 4 to "/dbfiles/app/oracle/oradata/orcl/4.dbf";
set newname for datafile 5 to "/dbfiles/app/oracle/oradata/orcl/5.dbf";
#....
#....
#....
set newname for datafile 341 to "/dbfiles/app/oracle/oradata/orcl/341.dbf";
set newname for datafile 342 to "/dbfiles/app/oracle/oradata/orcl/342.dbf";
set newname for datafile 343 to "/dbfiles/app/oracle/oradata/orcl/343.dbf";
set newname for datafile 344 to "/dbfiles/app/oracle/oradata/orcl/344.dbf";
set newname for datafile 345 to "/dbfiles/app/oracle/oradata/orcl/345.dbf";

allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
RESTORE DATABASE ;
#将newname异动同步到 dba_data_files / v$datafile
switch datafile all;
#recover database using backup controlfile until cancel;
recover database until time "to_date('2023-11-03 15:42:00','yyyy-mm-dd hh24:mi:ss')";
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值