views:

50

answers:

1

hi Experts

I want backup with RMAN and after that for example delete scott.dept and then restore it.

but i can't :(

I write it :

1)rman target sys/manager@db

2)in sql*plus
   shutdown immediate;
   startup mount exclusive;
   ALTER DATABASE ARCHIVELOG;

2)CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'g:\db\db_cf%F';

3)BACKUP DATABASE PLUS ARCHIVELOG;

4)alter database open;

5)drop scott.dept

6)in sql*plus
   shutdown immediate;
   startup mount exclusive;
   ALTER DATABASE ARCHIVELOG;

7)Restore Database;

8)Recover Database;

It show me : successfully completed .

but scott.dept no restore; why? Thanks ..

+2  A: 

If you did a full recovery then that is the result I would expect.

The DROP SCOTT.DEPT action was applied do the database when you recovered and fed RMAN all the outstanding archived logs.

You want to do a point in time recovery to a time before you issued the DROP statement.

rman target sys/manager@db 

RUN
{
  SET UNTIL TIME 'Feb 3 2010 08:30:00'; 
  RESTORE CONTROLFILE ;
  ALTER DATABASE MOUNT; 
  RESTORE DATABASE;
  RECOVER DATABASE;
}

More info here: Oracle 10.2 Backup and Recovery Basics - Performing Database Point-In-Time Recovery

ALternately you could leave the RECOVER DATABASE step off and just RESTORE the database followed by an OPEN RESETLOGS. That would allow you to skip applying any changes in the Archived Logs.

David Mann