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?