Wednesday, January 5, 2022

RMAN Table PIT Recovery Notes

 --recover table and let rman import it in place. 

run {

recover table drs.test_me until scn 22044407

auxiliary destination '+SBD818_FRA_01';

}


--pluggable pdb option.

run {

recover table drs.test_me of pluggable database PDB2

until scn 22044407

auxiliary destination '/u02/CDB2/aux';

}


-- recover table and create import dump file.

run {

recover table drs.test_me until scn 22044407

auxiliary destination '+SBD818_FRA_01'

datapump destination '+SBD818_FRA_01/SBD818/tspitr'

dump file 'drs_test_me.dmp'

notableimport;

}


run {

recover table test_dummy.test_table until scn 861867

auxiliary destination '+SBD818_FRA_01'

datapump destination '+SBD818_FRA_01/dpdump_rman'

dump file 'test_my_drop.dmp'

notableimport;

}



create directory FRA_DATAPUMP as '+SBD818_FRA_01/dpdump_rman';

grant read, write on directory FRA_DATAPUMP to public;


create directory DP_LOG as '/srv/users/dba/oracle';

grant read, write on directory DP_LOG to public;


test_restore.par

DUMPFILE=test_my_drop.dmp

TABLES=test_dummy.test_table

LOGFILE=DP_LOG:impdp_test_dummy.log

JOB_NAME=test_import

DIRECTORY=FRA_DATAPUMP


oracle> impdp / parfile=test_dummy.par


Import: Release 19.0.0.0.0 - Production on Tue Nov 2 14:07:52 2021

Version 19.11.0.0.0


Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Master table "OS_ORACLE"."TEST_IMPORT" successfully loaded/unloaded

Starting "OS_ORACLE"."TEST_IMPORT":  /******** parfile=test_dummy.par

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

. . imported "TEST_DUMMY"."TEST_TABLE"                       0 KB       0 rows

Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

Job "OS_ORACLE"."TEST_IMPORT" successfully completed at Tue Nov 2 14:07:56 2021 elapsed 0 00:00:04


No comments:

Post a Comment