- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Oracle Truncate Table Question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 08:32 AM
тАО02-02-2004 08:32 AM
I understand that the data is unrecoverable unless I do a point in time recovery before the truncate or go to a previous database export.
My question is:
Will changes to the table after the truncate is executed continue to be be logged so that the new entries will be protected and recoverable? Let's say say I ran truncate a table today and next week I need to restore the table to sometime after the truncate operation. Will the online backups work for the new contents?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 08:43 AM
тАО02-02-2004 08:43 AM
Re: Oracle Truncate Table Question
truncate is permanent. You can not back off on it even if you have archive logs running.
In your scenario I believe once the table data is restored it will be included in hot backups or cold backups.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 08:52 AM
тАО02-02-2004 08:52 AM
Re: Oracle Truncate Table Question
Scenario:
Today I truncate table my_table
I now insert 3000 rows. Table is static, won't change anymore.
Tonight I do a normal online backup.
Archiving remains on. Cold backup is not taken.
Server crashes two days from now.
When database is restored two days from now, will I still have the 3000 rows. I don't care about the data that got truncated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 08:56 AM
тАО02-02-2004 08:56 AM
Solution"truncate" table is a special way to delete all data belonging to a table.
It is considered a DDL-statement, which means it autocommits !
This is why you can not use it in a transaction and "rollback" out of it.
It works directly on storage, by de-allocatine the attached extents from a table (and related indexes) and returns them to the freespace.
This is, why it is so speedy against DELETE, which works on rows. So there is no ROLLBACK possible for this statement within a transaction.
But
t1) truncate table ....
t2) insert into table
commit;
A point in time recovery including the SCN which commited t2) will lead to the table containing the rows inserted from t2) and nothing else.
Truncate can be compared to a drop/create, with many additional nice things, because in oposition to drop, all dependend dictionary objects (views, constraints, index, ...) will remain active !
After a drop and create, you have to recreate/recompile all of them, after a truncate not.
Not to be mixed up with statements that have a NOLOGGING-clause attached to it. Whenever these are used, special actions might be neccessary after a recovery !
Hope this helps
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 08:59 AM
тАО02-02-2004 08:59 AM
Re: Oracle Truncate Table Question
Thanks...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 05:05 PM
тАО02-02-2004 05:05 PM
Re: Oracle Truncate Table Question
You are correct in your understading that truncate will not generate undo information.
Truncate does not change the behaviour of future DML operations (like Insert/Update/Delete) done on that table.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 05:55 PM
тАО02-02-2004 05:55 PM
Re: Oracle Truncate Table Question
Truncate a table is shooting the horse immediately. Data are completely lost.
You cannot rollback anything from this table.
But what is also important is the deallocating of the extents and resetting the highwater mark in the table you truncated. That is different to the delete command ( with a commit ). The delete keeps thge highwater mark, where it is.
Rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 06:44 PM
тАО02-02-2004 06:44 PM
Re: Oracle Truncate Table Question
please note that:
the operation (truncate) is recoverable. it is considered DDL so it is done as an atomic statement all by itself -- but it is "recoverable".
you do not need a backup after a truncate.
if you are deleting all of the data -- you obviously do not care about it.
a single:
truncate table t;
is quite simply an efficient:
delete from t;
commit;
hope this helps too!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-02-2004 07:28 PM
тАО02-02-2004 07:28 PM
Re: Oracle Truncate Table Question
Being a DDL, it has a implict commit and therefore rollback can't be issued.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2004 06:14 AM
тАО02-03-2004 06:14 AM
Re: Oracle Truncate Table Question
Jack...