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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Split partition in table (Oracle 10g)

deniskaJul 24 2019 — edited Jul 26 2019

Oracle 10g

We have one table with huge amount of data

create table part_tab

(

  pt_id            NUMBER,

  pt_name          VARCHAR2(30),

  pt_date          DATE default SYSDATE,

  pt_lob           CLOB,

  pt_status        VARCHAR2(2)

)

partition by range (pt_date)

(

  partition PRT1 values less than (TO_DATE('2012-01-01', 'YYYY-MM-DD')),

  ...

  partition PRT2 values less than (TO_DATE('2014-09-01', 'YYYY-MM-DD')),

  partition PRT_MAX values less than (MAXVALUE)

  )

The table has

- Primary Key on pt_id column with unique index (1 Different table has FK constraint that refers to this PK)

- Composite index on pt_date and pt_name columns

The Task is to split partition(PRT_MAX) to a different tablespace

New partition(s) won't have data at the monet of creation

What is the best strategy for that?

Can I use following?

alter table part_tab split partition PRT_MAX at(TO_DATE('2019-08-01', 'YYYY-MM-DD')) into

(PARTITION PRT3 tablespace old_tablespace, PARTITION PRT_MAX tablespace new_tablespace);

or I have to add clob column in this script for clobs to be created in different tablespace later?

alter table part_tab split partition PRT_MAX at(TO_DATE('2019-08-01', 'YYYY-MM-DD')) into

(PARTITION PRT3 tablespace old_tablespace  LOB (pt_lob) store as (TABLESPACE old_tablespace), PARTITION PRT_MAX tablespace new_tablespace   LOB (pt_lob) store as (TABLESPACE new_tablespace));

Questions

1 Considering that new partition(s) in new_tablespace wont have data(during creation/splitting) can I use only one of these scripts without dropping/creating indexes/PK/FK?

I created demo table (with a couple of rows) and checked. All indexes(2) were valid.

If there is better way, please tell me about it. Should I think more about clobs?

Comments

Solomon Yakobson

DBCA must be run either as administrator or as user with administrative privileges.
SY.

1 - 1

Post Details

Added on Jul 24 2019
4 comments
776 views