Re: TRUNCATE Table Command

From: Tony Jambu <aaj_at_phantom.telecom.com.au>
Date: 1995/06/23
Message-ID: <3se0l9$9ke_at_newsserver.trl.OZ.AU>#1/1


In article <3s8ipi$3kc_at_idefix.eunet.fi>, "Lassi.Salo" <Lassi.Salo_at_ivo.fi> writes:
> aaj_at_phantom.telecom.com.au (Tony Jambu) wrote:
> > It is documented in the manuals. If it is causing your hassles, why
> > not just use the REUSE STORAGE option to TRUNCATE?
>
> How come?
>
> I just read the O7 Server SQL Reference,
> and truncate-command chapter (4-396) says:
>
> "dropping and recreating requires you to recreate the table's
> indexes, <...> and respecify its STORAGE parameters,
> while truncating does not."

Maybe this will help you understand:

help truncate

    TRUNCATE command

PURPOSE:
    To remove all rows from a table or cluster.

SYNTAX: TRUNCATE {TABLE [schema.]table | CLUSTER [schema.]cluster}

    [ {DROP | REUSE} STORAGE] where:

TABLE
    specifies the schema and name of the table to be truncated. If you     omit schema, Oracle assumes the table is in your own schema. This     table cannot be part of a cluster.

    When you truncate a table, Oracle also automatically deletes all     data in the table's indexes.

DROP STORAGE
    deallocates the space from the deleted rows from the table or     cluster. This space can subsequently be used by other objects in     the tablespace.

REUSE STORAGE
    leaves the space from the deleted rows allocated to the table or     cluster. This space can be subsequently used only by new data in     the table or cluster resulting from inserts or updates.

    The DROP STORAGE or REUSE STORAGE option that you choose also     applies to the space freed by the data deleted from associated     indexes.

    If you omit both the REUSE STORAGE and DROP STORAGE options, Oracle     uses the DROP STORAGE option by default.

Hope that helps

ta
tony

-- 
 _____       ________ / ___ |Tony Jambu, Database Consultant
  /_  _        /_ __ /      |Wizard Consulting,Aust (ACN 065934778)
 /(_)/ )(_/ \_/(///(/_)/_(  |CIS: 100250.2003_at_compuserve.com FAX: +61-3-4163559
 \_______/                  |EMAIL:TJambu_at_wizard.com.au PHONE: +61-3-4122905
Received on Fri Jun 23 1995 - 00:00:00 CEST

Original text of this message