Need Partition script to delete and add partitions.
oracedbaSep 24 2012 — edited Oct 10 2012Hi 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?