Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Auto PARTITIONING....Is it possible?
oracle_man wrote:
>
> Do any of you nice folks have a handy script that I could use in a cron
> job to automatically split my "last" partition? Currenty I have to
> split every day, and usually do a few days in advance. We split on a
> DATE column BTW.
>
> thanks in advance.
>
> rich
Use user_tab_partitions, get the second highest partition no, (assuming the highest is just "maxvalues"). Use the second highest partition clause to find the datestamp in it using substr/instr. Conver to a date, add 1 for the next day (or whatever) and voila, you've got a new clause to split the last partition.
hth
connor
-- Connor McDonald Co-author: "Mastering Oracle PL/SQL - Practical Solutions" Co-author: "Oracle Insight - Tales of the OakTable" web: http://www.oracledba.co.uk web: http://www.oaktable.net email: connor_mcdonald_at_yahoo.com "GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day" ------------------------------------------------------------Received on Fri Apr 15 2005 - 22:14:06 CDT
![]() |
![]() |