Hi
I have tested the codes too but it doesn't seem to be able to recover the database (including the tablespace which I have dropped). Why?
Code :
create tablespace test
datafile '/oracle/oradata/test01.dbf'
size 2M reuse;
create user ora_user
identified by ora_user
default tablespace test
temporary tablespace temp
quota unlimited on test;
# Login as ora_user and create a table students and insert data into table students.
# RMAN backup
run
{
allocate channel ch1 type disk;
sql 'alter system archive log current';
backup format '/backup/orcl/%d_t%t_s%s_p%p'
filesperset=4
database;
release channel ch1;
}
RMAN > list backup;
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 4072944 06-JUL-05 /oracle/oradata/system01.dbf
8 Full 4072944 06-JUL-05 /oracle/oradata/tools01.dbf
12 Full 4072944 06-JUL-05 /oracle/oradata/test01.dbf
# Drop tablespace
drop tablespace test including contents;
# RMAN Recovery
shutdown immediate;
startup mount;
# time is set to after rman backup and before tablespace dropped
RMAN>
run {
set until time "to_date('06-07-2005 16:50:00','dd-mm-yyyy hh24:mi:ss')";
restore database;
recover database;
}
RMAN > list backup;
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 4072944 06-JUL-05 /oracle/oradata/system01.dbf
8 Full 4072944 06-JUL-05 /oracle/oradata/tools01.dbf
12 Full 4072944 06-JUL-05
Why is the RMAN list empty for the deleted tablespace? That's the reason why there is nothing to reover from?