Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



Difference between Delete and Truncate

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-01-2010
Member
 
Join Date: Nov 2009
Posts: 43
Difference between Delete and Truncate

Accidentally, I have deleted the some tables from my database and I am a beginner in oracle,I wanted to restore the deleted tables,now can you tell me some procedure to restore it back.Your suggestion will be appreciated.
Can you tell me what happens when I use delete and truncate.In which scenario it comes in use.
Reply With Quote
  #2  
Old 29-01-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
Delete command in oracle

The Deletecommand is used to remove the tuple from table.Through this command,you can delete the selected rows from the table.You can use Rollback and Commit statement after delete command.

Enter this command to calculate the number of rows
Code:
SQL> Select count(*) from my_table;
Delete the selected rows from table,The record which contains the Mem_post as a security would be deleted
Code:
SQL>Delete from my_table where Mem_post='Security';
Then enter the first command again to ensure number of rows.
Reply With Quote
  #3  
Old 29-01-2010
Member
 
Join Date: May 2008
Posts: 1,990
Truncate in oracle

Truncate command:

Truncate command removes all rows from the table at one fire,you can't specify any condition between this statement.You can't rollback the action of this statement.

Code:
SQL> Truncate table my_table;
Reply With Quote
  #4  
Old 29-01-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
restoration after Delete and Truncate command

Hello friend !
As you are new in oracle and you just have deleted a table from your database and willing to restore it back. It is possible to restore it back but it is administrative task.

Before this task,you need to take a physical backup of database.If you have taken any backup before using delete or truncate.You can recover your database but as you mentioned you are a beginner in oracle so go through the sequence of study.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Difference between Delete and Truncate"
Thread Thread Starter Forum Replies Last Post
"delete all prior" option delete all email in my blackberry 9650 inbox DeepakTij Portable Devices 6 4 Weeks Ago 02:31 PM
Overview of SQL Truncate command Sabastiaan Software Development 5 27-02-2010 09:48 AM
What is the difference between delete table & truncate table? Swati Software Development 4 13-02-2009 05:24 PM
How To Delete Files Which Windows Wont Delete? Hardik Windows Software 2 06-03-2007 12:45 PM
failed/successfull audit delete folder and delete file and folder steef83 Windows Security 7 18-11-2006 01:23 AM


All times are GMT +5.5. The time now is 05:26 AM.