Go Premium for a chance to win a PS4. Enter to Win


delete table

Posted on 2011-03-24
Medium Priority
Last Modified: 2012-08-14
I accidently delete a table
and commit  accidently

delete from tab1;
Is there any way to recover that table?
Question by:nobleit
  • 3
  • 3
  • 2
  • +1
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35211717
What version of Oracle?

QUICK:  google flashback table!!!

You might be able to use flashback to recover.

Expert Comment

ID: 35211719

Author Comment

ID: 35211759
oracle 11g is the version
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


Expert Comment

ID: 35211815
more info here, hope it helps
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35211876
And did flashback table work?

Author Comment

ID: 35211906
This is what I did..
I did timestamp function myselft -- data backed up anyway.

But still I have doubts..
SQL> desc emp;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 EMPNO                                     NOT NULL NUMBER(4)
 ENAME                                              VARCHAR2(10)
 JOB                                                VARCHAR2(9)
 MGR                                                NUMBER(4)
 HIREDATE                                           DATE
 SAL                                                NUMBER(7,2)
 COMM                                               NUMBER(7,2)
 DEPTNO                                             NUMBER(2)

SQL> select * from emp;

no rows selected

Elapsed: 00:00:00.01
SQL> insert into emp(select * from emp as of timestamp(sysdate - 5/1440));

0 rows created.

Elapsed: 00:00:00.14
SQL> select count(*) from emp;


Elapsed: 00:00:00.00
SQL> insert into emp(select * from emp as of timestamp(sysdate - 40/1440));

14 rows created.

Elapsed: 00:00:00.06
SQL> select count(*) from emp;


but to convince my logic can I ask you this

in that 40/1440 what is 40 and 1440 respectively,

40 is minutes or what and what is 1440..

LVL 28

Expert Comment

by:Naveen Kumar
ID: 35211980
that means flashback the table as of 40 mins before the current time.

40 means mins and 1440 total mins per day ( 24 * 60 ).
LVL 78

Accepted Solution

slightwv (䄆 Netminder) earned 2000 total points
ID: 35211991
1440 is the number of minutes in a day.

You add and subtract the number of days from sysdate.

If I did my math right, sysdate-40/1440 is 40 minutes ago.

You do realize that the longer you take to flashback, the harder it will be to recover.

If you know when you did the delete, do as of timestamp to_timestamp('01/01/2010 01:01','MM/DD/YYYY HH24:MI')

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question