Results 1 to 4 of 4

Thread: Difference between Delete and Truncate

  1. #1
    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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;

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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.

Similar Threads

  1. Replies: 5
    Last Post: 06-05-2012, 08:19 AM
  2. Replies: 6
    Last Post: 13-01-2012, 02:31 PM
  3. Overview of SQL Truncate command
    By Sabastiaan in forum Software Development
    Replies: 5
    Last Post: 27-02-2010, 09:48 AM
  4. What is the difference between delete table & truncate table?
    By Swati in forum Software Development
    Replies: 4
    Last Post: 13-02-2009, 05:24 PM
  5. How To Delete Files Which Windows Wont Delete?
    By Hardik in forum Windows Software
    Replies: 2
    Last Post: 06-03-2007, 12:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,043,404.52333 seconds with 17 queries