部分表空間不恢復
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/