SQL Language (MOSC)

MOSC Banner

Table Partition

edited Nov 18, 2021 3:50AM in SQL Language (MOSC) 4 commentsAnswered

Oracle Database 19c

To avoid data go to the MAXVALUE partition if we forgot to create new parttition at year end, we want to create a table with the parition up to year 2046 at the begining like

=================================================================

create table test_partition(

pt_date timestamp not null,

c_1 int,

c_2 int,

....

)

partition by range (pt_date)(

  partition test_partition_pt0001_2012 values less than (to_timestamp('2013-01-01 00:00:00.000','YYYY-MM-DD HH24:MI:SS.FF3')),

  partition test_partition_pt2013_2015 values less than (to_timestamp('2016-01-01 00:00:00.000','YYYY-MM-DD HH24:MI:SS.FF3')),

  partition test_partition_pt2016_2017 values less than (to_timestamp('2018-01-01 00:00:00.000','YYYY-MM-DD HH24:MI:SS.FF3')),

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center