truncate partition?

  • Hi,

    is there a counterpart for the following statement in oracle?

    alter table tab1 truncate partition p1

    My task is to build a large stage table to collect data (only store data without any referential integrity). From time to time I'll have to purge the oldest data. I have to find a fast scalable way.

    cheers,

    Tobias

  • Grasshopper,

    I've the same requirement, and am not very familiar with stage tables. Can u provide some pointers?

    Thanks,

    Scorpio

  • Hi,

    partitioning and staging not necissarily goes hand in hand.

    Please explain your requirements in more detail.

    Staging is a way of loading data from sources and transform it.

    The key of partitioning is a gain of performance if you have massdata.

    By the way the answer to my question was that in sql server you first have to switch out the partition to another table, then you can truncate that table.

    Tobias

  • You need to use the SWITCH option.

    Something like ALTER TABLE myTable SWITCH PARTITION to ...

    There's a really good whitepaper available here

    [font="Verdana"]Markus Bohse[/font]

  • http://www.sqlservercentral.com/scripts/Truncate/69506/

    Have a look at this script

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply