rman恢復部分script

部分表空間不恢復
run {
allocate channel t1 type DISK parms="ENV=(NB_ORA_CLIENT=chengxi)";
set archivelog destination to '/opt/oracle/arch/';
restore database skip tablespace TEMP,USERS;
recover database skip forever tablespace USERS;
release channel c1;
}


恢復全庫
run {
allocate channel t1 type DISK parms="ENV=(NB_ORA_CLIENT=chengxi)";
set archivelog destination to '/opt/oracle/arch/';
restore database;
recover database;
release channel c1;
}


恢復控制文件
run{
allocate channel t1 type DISK;
send 'NB_ORA_SERV=nbutest01,NB_ORA_CLIENT=chengxi';
set archivelog destination to '/opt/oracle/arch/';
sql 'alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss"';
restore controlfile until time '2010-07-14 02:00:00';
release channel t1;
}

恢復數據文件
run{
allocate channel ch00 type DISK;
send 'nb_ora_serv=nbutest01';
send 'nb_ora_client=chengxi';
restore datafile 0002;
release channel ch00;
}


恢復到時間點
run{
allocate channel ch00 type 'SBT_TAPE';
send 'NB_ORA_SERV=nbutest01,NB_ORA_CLIENT=standbydb';
sql 'alter session set nls_date_format="yyyy-mm-dd hh24:mi:ss"';
restore database until time '2010-08-25 10:00:00';
recover database until time '2010-08-25 10:00:00';
sql 'alter database open resetlogs';
release channel ch00;
}

恢復archivelog
run{ allocate channel c1 type disk;
restore archivelog all;
release channel c1;
}


run {
allocate channel t1 type 'sbt_tape' parms="ENV=(NB_ORA_CLIENT=old_host)";
set until time "to_date('06/30/02 13:00:00','MM/DD/YY HH24:MI:SS')"
restore database;
recover database;
sql 'alter database open resetlogs';
release channel t1;
}

control file是二进制文件,需要用"strings 控制文件名"来查看


ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP

恢復到某個scn
run{
set until scn 2595310;
restore database;
recover database;
alter database open resetlogs;
}


run{
allocate channel d1 type disk;
allocate channel d2 type disk;
set until sequence 41 thread 1;
recover database;
release channel d1;
release channel d2;
}

閃回恢復
alter database flashback on;

flashback database to timestamp to_timestamp('08/24/10 18:00:00','MM/DD/YY HH24:MI:SS');

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25402324/viewspace-715478/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25402324/viewspace-715478/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值