Thinking Out Loud

July 6, 2011

Renaming Interval Partitions

Filed under: 11g,oracle — mdinh @ 3:56 am

I wrote a stored procedure to RENAME USER system generated name for interval partition tables and LOCAL indexes.

One pertinent information on >>Interval Partitioning

  • Can only partition on one key column and must be NUMBER or DATE type

>>NUMTOYMINTERVAL must resolve to the following values: ‘YEAR’,’MONTH’
>>NUMTODSINTERVAL must resolve to the following values: ‘DAY’,’HOUR’,’MINUTE’,’SECOND’

Download stored procedure and test case >>interval_part.sql

System generated partitions.

Renamed partitions.

UPDATED: Add parameter p_table to package.

Update ONE table: exec mdinh_pkg.ren_interval_part(‘day’);

Update ALL tables: exec mdinh_pkg.ren_interval_part;

Advertisements

3 Comments »

  1. Hello,

    It could be better if this procedure accepts some arguments (for example the table name…).

    Regards

    Gokhan

    Comment by Gokhan Atil — July 6, 2011 @ 6:18 am | Reply

  2. This is a very useful procedure, thanks for sharing.

    Comment by Mor — July 13, 2011 @ 12:39 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: