Saturday, 6 December 2014

Oracle database -Point in Time Recovery

Oracle DB -Point in Time Recovery
-------------------------------------

SQL>conn scott/tiger

SQL>select count(*) from emp;

SQL>select count(*) from salgrade;

SQL>insert into emp select * from emp;
SQL>/
SQL>commit;

SQL>set time on

SQL>select count(*) from emp; - Note down the records

SQL>drop table emp purge;

SQL>insert into salgrade select * from salgrade;
SQL>/
SQL>/
SQL>/
SQL>commit;


SQL>conn /as sysdba

SQL>alter system switch logfile;
SQL>/

SQL>shut immediate;

$cd /u01/app/oracle/oradata

$rm -rf *

$cp /u01/app/oracle/backups/* /u01/app/oracle/oradata/ORCL1

$sqlplus '/as sysdba'

SQL>startup mount;

SQL>recover database using backup controlfile until time '2011/12/7/18:00:00';

Popular Posts