select * from v$version
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production 0
PL/SQL Release 12.1.0.2.0 - Production 0
CORE 12.1.0.2.0 Production 0
TNS for Linux: Version 12.1.0.2.0 - Production 0
NLSRTL Version 12.1.0.2.0 - Production 0
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
2016-03-01 17:23:02
create table t_jason(id number,insert_time date);
insert into t_jason values(1,sysdate);
select count(*) from t_jason;
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
2015-03-01 17:36:23
SQL> alter system switch logfile;
备份数据库:
rman target /
backup as compressed backupset database format '/tmp/oracle/jason_db_%U';
次插入数据
SQL> insert into t_jason select * from t_jason;
drop table t_jason purge;
rman target sys/Oracle12 log=/tmp/oracle/recover_table.log
直接恢复出来dmp文件(不impdp导入)
RECOVER TABLE RMAN_TEST.T_JASON OF PLUGGABLE DATABASE PDB1 UNTIL TIME "to_date('2015-03-01 17:45:00','YYYY-MM-DD HH24:MI:SS')" AUXILIARY DESTINATION '/tmp/oracle' DATAPUMP DESTINATION '/tmp/oracle' DUMP FILE 'test_dump.dump' NOTABLEIMPORT;
直接恢复出来dmp文件(impdp导入)并重命名表
RECOVER TABLE RMAN_TEST.T_JASON OF PLUGGABLE DATABASE PDB1 UNTIL TIME "to_date('2015-03-01 17:45:00','YYYY-MM-DD HH24:MI:SS')" AUXILIARY DESTINATION '/tmp/oracle' DATAPUMP DESTINATION '/tmp/oracle' DUMP FILE 'test_dump2.dump' REMAP TABLE 'RMAN_TEST'.'T_JASON':'T_JASON_NEW';
查询结果:
select * from tab;
阅读(2135) | 评论(0) | 转发(0) |