时间点恢复
1.查询恢复期间可能丢失的对象
SELECT * FROM SYS.ts_pitr_objects_to_be_dropped WHERE tablespace_name='FIXF';
备份所有对象
2.执行TSPITR
recover tablespace FIXF
until database "to_date('2019-11-25 10:30:00','yyyy-mm-dd hh24:mi:ss')"
auxiliary destination '/opt/oracle/back';
3.修改表空间为联机状态
alter tablespcace FIXF online;
4.恢复失败删除辅助实例
exec dbms_backup_restore.manageauxinstance
('auxiliary_sid_name',1);
CDB级别的表空间不完全恢复
archive log list;
create tablespace TS_XXT3 datafile '/u04/oradata/CDBLHR/TS_XXT30xx.dbf' size 10M;
create user c##lhrts identified by lhr;
grant dba to c##lhrts;
create table c##lhrts.xxt6 tablespace TS_XXT3 as select * from dual;
run{
backup database;
alter system archive log current;
backup archivelog all;
backup current controlfile;
}
select current_scn from v$database;
alter system switch logfile;
drop table c##lhrts.xxt6;
rman target /
RMAN> RECOVER TABLESPACE TS_XXT3 UNTIL SCN 1756899 AUXILIARY DESTINATION '/u01/app/oracle/oradata';
RMAN> ALTER TABLESPACE TS_XXT3 ONLINE;
select * from c##lhrts.xxt6;
pdb表空间不完全恢复
archive log list;
alter session set container=PDBLHR1;
create tablespace TS_XXT datafile '/u04/oradata/CDBLHR/PDBLHR1/ts_xxt01.dbf' size 10M;
grant dba to lhr;
create table lhr.xxt tablespace ts_xxt as select * from dual;
run{
backup database;
alter system archive log current;
backup archivelog all;
backup current controlfile;
}
select current_scn from v$database;
alter system switch logfile;
alter session set container=PDBLHR1;
drop table lhr.xxt;
rman target /
RMAN> RECOVER TABLESPACE PDBLHR1:TS_XXT UNTIL SCN 832972 AUXILIARY DESTINATION '/u01/app/oracle/oradata';
RMAN> ALTER TABLESPACE PDBLHR1:TS_XXT ONLINE;