Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need Partition script to delete and add partitions.

oracedbaSep 24 2012 — edited Oct 10 2012
Hi All,

(TO ADD PARTITIONS):
ALTER TABLE Sxxxx.pppp ADD PARTITION pppp_20120731 VALUES LESS THAN (TIMESTAMP '2012-08-01 00:00:00');

(TO DROP PARTITIONS):

alter table Sxxxx.pppp drop partition pppp_20120801;

This is the syntax that i am using to ADD,DROP Partitions.The problem is that i have to run this partition statement once in 10 days and i have to delete the previous partitions (last 10 days ago).

i have 4 different schema's and 4 different tables in each schema, so i have to run lot of statements manually.Can you any one tell me how to write a shell script and run in the cron tab.Please help and guide me or write a script for me, i have little time to put this script in the production.

is there any better way to create PARTITIONS?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 7 2012
Added on Sep 24 2012
9 comments
4,307 views