RMAN Table Point in Time Recovery (PITR) Oracle 12c

RMAN Table Point in Time Recovery (PITR) Oracle 12c

Step 1:create new table and insert data

CREATE TABLE test (id NUMBER);
INSERT INTO test VALUES (1);
COMMIT;

 
Step 2:Note the SCN number upto which restore test

select dbms_flashback.get_system_change_number from dual;

GET_SYSTEM_CHANGE_NUMBER
————————
                 2800000

 
Step 3: insert the data into the table

INSERT INTO test VALUES (2);
COMMIT;
SELECT * FROM test;
        ID
———-
         1
         2

  
Step 4:For recovery point on time to table connect rman:

rman target=/
RECOVER TABLE ‘HR’.’TEST’ UNTIL SCN 2800000 AUXILIARY DESTINATION ‘/u01/db2’
REMAP TABLE ‘HR’.’Test’:’Test_PREV’;

Note:
auxiliary destination is for auxiliary database
remap table : give alternative name to that table and restore.
 
Step 5:Check the new table

SELECT * FROM test_prev;
ID
———-
    1

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s