Wednesday 16 March 2016

POINT IN TIME RECOVERY via RMAN



Scenario:

DBA dropped the tablespace TEST which is important for application.

Requirement:

We need to restore the database before the TEST tablespace was dropped.

I have Already taken a FullDatabase Backup using Below command

RMAN> backup database plus archivelog;

I have The following Tablespace :
SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
RMAN
RECOTEST

7 rows selected.


Now Lets Simulate the Scenarios:
I will first Drop a tablespace and check alert Log,

SQL> drop tablespace fbtest including contents and datafiles;
Tablespace dropped.

SQL> shut abort
Oh .. Now my tablespace is Dropped accidently..L I want that BACK…!

 Altert Log will Show these Lines :

Mon Mar 14 19:16:07 2016
drop tablespace fbtest including contents and datafiles
Deleted file /u01/app/oracle/oradata/rman/fbtest.dbf
Completed: drop tablespace fbtest including contents and datafiles
Mon Mar 14 19:25:39 2016

Startup RMAN
$ rman target /
RMAN> run {
2> startup mount
3> set until time "TO_DATE ('14-03-16 19:24:30' , 'DD-MM-YY HH24:MI:SS')";
4> RESTORE CONTROLFILE;
5> ALTER DATABASE MOUNT;
6> RESTORE DATABASE;
7> RECOVER DATABASE;
8> ALTER DATABASE OPEN RESETLOGS; }


See Also

No comments:

Post a Comment