<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Oracle Truncate Table Question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180659#M794856</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;"truncate" table is a special way to delete all data belonging to a table.&lt;BR /&gt;It is considered a DDL-statement, which means it autocommits !&lt;BR /&gt;This is why you can not use it in a transaction and "rollback" out of it.&lt;BR /&gt;It works directly on storage, by de-allocatine the attached extents from a table (and related indexes) and returns them to the freespace.&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;But&lt;BR /&gt;&lt;BR /&gt;t1) truncate table ....&lt;BR /&gt;t2) insert into table&lt;BR /&gt;    commit;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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 !&lt;BR /&gt;After a drop and create, you have to recreate/recompile all of them, after a truncate not.&lt;BR /&gt;&lt;BR /&gt;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 !&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
    <pubDate>Mon, 02 Feb 2004 16:56:14 GMT</pubDate>
    <dc:creator>Volker Borowski</dc:creator>
    <dc:date>2004-02-02T16:56:14Z</dc:date>
    <item>
      <title>Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180656#M794853</link>
      <description>Got an oracle database where I want to run truncate table on.  [ 7.3.4 on HP-UX ]&lt;BR /&gt;&lt;BR /&gt;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.  &lt;BR /&gt;&lt;BR /&gt;My question is:&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Feb 2004 16:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180656#M794853</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-02T16:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180657#M794854</link>
      <description>Old Oracle.&lt;BR /&gt;&lt;BR /&gt;truncate is permanent. You can not back off on it even if you have archive logs running.&lt;BR /&gt;&lt;BR /&gt;In your scenario I believe once the table data is restored it will be included in hot backups or cold backups.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 02 Feb 2004 16:43:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180657#M794854</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-02-02T16:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180658#M794855</link>
      <description>Don't think I'm clear in the question.&lt;BR /&gt;&lt;BR /&gt;Scenario:&lt;BR /&gt;&lt;BR /&gt;Today I truncate table my_table&lt;BR /&gt;&lt;BR /&gt;I now insert 3000 rows.  Table is static, won't change anymore.&lt;BR /&gt;Tonight I do a normal online backup.&lt;BR /&gt;Archiving remains on.  Cold backup is not taken.&lt;BR /&gt;&lt;BR /&gt;Server crashes two days from now.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Feb 2004 16:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180658#M794855</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-02T16:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180659#M794856</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;"truncate" table is a special way to delete all data belonging to a table.&lt;BR /&gt;It is considered a DDL-statement, which means it autocommits !&lt;BR /&gt;This is why you can not use it in a transaction and "rollback" out of it.&lt;BR /&gt;It works directly on storage, by de-allocatine the attached extents from a table (and related indexes) and returns them to the freespace.&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;But&lt;BR /&gt;&lt;BR /&gt;t1) truncate table ....&lt;BR /&gt;t2) insert into table&lt;BR /&gt;    commit;&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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 !&lt;BR /&gt;After a drop and create, you have to recreate/recompile all of them, after a truncate not.&lt;BR /&gt;&lt;BR /&gt;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 !&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Volker</description>
      <pubDate>Mon, 02 Feb 2004 16:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180659#M794856</guid>
      <dc:creator>Volker Borowski</dc:creator>
      <dc:date>2004-02-02T16:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180660#M794857</link>
      <description>If it's similar to a drop and create then I should be ok.  I just want to be sure that the new data is protected by archiving.&lt;BR /&gt;&lt;BR /&gt;Thanks...&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Feb 2004 16:59:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180660#M794857</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-02T16:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180661#M794858</link>
      <description>To add on:&lt;BR /&gt;&lt;BR /&gt;You are correct in your understading that truncate will not generate undo information.&lt;BR /&gt;&lt;BR /&gt;Truncate does not change the behaviour of future DML operations (like Insert/Update/Delete) done on that table.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Tue, 03 Feb 2004 01:05:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180661#M794858</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-02-03T01:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180662#M794859</link>
      <description>Hi there.&lt;BR /&gt;Truncate a table is shooting the horse immediately. Data are completely lost.&lt;BR /&gt;You cannot rollback anything from this table.&lt;BR /&gt;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.&lt;BR /&gt;Rgds&lt;BR /&gt;Alexander M. Ermes&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Feb 2004 01:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180662#M794859</guid>
      <dc:creator>Alexander M. Ermes</dc:creator>
      <dc:date>2004-02-03T01:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180663#M794860</link>
      <description>hi, &lt;BR /&gt;&lt;BR /&gt;please note that:&lt;BR /&gt;&lt;BR /&gt;the operation (truncate) is recoverable.  it is considered DDL so it is done as an atomic statement all by itself -- but it is "recoverable".&lt;BR /&gt;&lt;BR /&gt;you do not need a backup after a truncate.&lt;BR /&gt;&lt;BR /&gt;if you are deleting all of the data -- you obviously do not care about it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;a single:&lt;BR /&gt;&lt;BR /&gt;truncate table t;&lt;BR /&gt;&lt;BR /&gt;is quite simply an efficient:&lt;BR /&gt;&lt;BR /&gt;delete from t;&lt;BR /&gt;commit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 03 Feb 2004 02:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180663#M794860</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-02-03T02:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180664#M794861</link>
      <description>Yes recoverable to the extent that it will be incomplete/point-in-time recovery.&lt;BR /&gt;&lt;BR /&gt;Being a DDL, it has a implict commit and therefore rollback can't be issued.&lt;BR /&gt;&lt;BR /&gt;sks</description>
      <pubDate>Tue, 03 Feb 2004 03:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180664#M794861</guid>
      <dc:creator>Sanjay Kumar Suri</dc:creator>
      <dc:date>2004-02-03T03:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Truncate Table Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180665#M794862</link>
      <description>Thanks all...&lt;BR /&gt;Jack...</description>
      <pubDate>Tue, 03 Feb 2004 14:14:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-truncate-table-question/m-p/3180665#M794862</guid>
      <dc:creator>Jack C. Mahaffey</dc:creator>
      <dc:date>2004-02-03T14:14:12Z</dc:date>
    </item>
  </channel>
</rss>

