martedì 20 ottobre 2009

Table Partitioning, step by spep

1. log in as system

2. create tablespaces for partitioned tables:
-- data tablespace
create tablespace data_2020 datafile 'Z:\ORACLE\ORADATA\CDEP\DATA_2020.DBF'
size 25M reuse default storage (next 160k pctincrease 0);

-- indexes tablespace
create tablespace index_2020 datafile 'Z:\ORACLE\ORADATA\CDEP\INDEX_2020.DBF'
size 25M reuse default storage (next 160k pctincrease 0);


3. submit the alter tabe command for each table to be partitioned:
ALTER TABLE TABLE1 ADD PARTITION DEP_2020
VALUES LESS THAN (2021)
storage (initial 480k) TABLESPACE data_2020;

ALTER INDEX TABLE1_PK REBUILD PARTITION DEP_2020
storage (initial 400k) TABLESPACE index_2020;

Nessun commento:

Posta un commento