Published by : Obay Salah , November 19, 2024

 Let's assume that you have a database that you do a cold backup of daily at 5 pm, and on Tuesday at 2 am one of the users deleted the Employee table by mistake and you did not discover this until Thursday morning, what is the solution?

1- Do a cold backup of the entire database now.

2- Return the database to its state before deleting the table Point in Time Recovery by restoring the database to the last backup copy before deleting the table, i.e. we need to restore the database from the backup copy on Monday evening and then restore the database to the state before deleting the table for a minute, for example.

ALTER DATABASE RECOVER AUTOMATIC USING BACKUP CONTROLFILE UNTIL TIME '02/12/2018:02:29:12' ;

3- Then we open the database in Resetlogs mode.

ALTER DATABASE OPEN RESETLOGS;

4- Then we export the table that we want to retrieve.

EXP USER/PASSWORD FILE=C:\EMP.DMP TBLES=EMPLOYEE

5- Now we restore the database from the backup we made in the first step of this scenario and then open the database.

6- Finally we import the Employee table from the export file C:\emp.dmp

IMP USER/PASSWORD FILE=C:\EMP.DMP TABLES=EMPLOYEE FROMUSER=USER TOUSER=USER

Thus we have retrieved the required table, but the following must be taken into account:-

1- The table has also been deleted from the Recycle Bin.

2- The table is not present in the Undo Tablespace so Flashback cannot be done.

3- If the database cannot be closed due to work conditions, the retrieval process must be done elsewhere until the required table is imported and then supplied to the original database.

4- Knowing the time of deleting the table is important in the retrieval process.

Tags : Backup and Recovery

You May Also Like

Comments

no comment yet!