bytebiscuit
bytebiscuit

Reputation: 3496

drop range partition in oracle between two dates

in Teradata you can do something like:

 DROP RANGE BETWEEN DATE FROM_DATE AND DATE TO_DATE, EACH INTERVAL '1' DAY;

Is there an equivalent way of doing this in Oracle? dropping a r

Upvotes: 1

Views: 1151

Answers (1)

Lalit Kumar B
Lalit Kumar B

Reputation: 49062

DROP RANGE BETWEEN DATE FROM_DATE AND DATE TO_DATE, EACH INTERVAL '1' DAY;

In Oracle, you could use PARTITION FOR clause.

For example,

alter table table_name drop partition for (TO_DATE('some date','date format'))

I think one important thing needs to be kept in mind, you cannot drop the last partition, i.e. the first partition. It would throw an error:

ORA-14758: Last partition in the range section cannot be dropped

Since you have not mentioned your exact Oracle version, I am sharing this 11gR2 documentation about Dropping partitions.

Upvotes: 2

Related Questions