Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to partition primary key in create table script?

Re: How to partition primary key in create table script?

From: Howard J. Rogers <howardjr_at_www.com>
Date: Thu, 19 Jul 2001 14:46:48 +1000
Message-ID: <3b5665fa@usenet.per.paradox.net.au>

Given that an in-line 'create index' command during constraint definition is a new feature of Oracle 9i, I suspect that what you wish to happen simply can't be done in earlier versions.

You'll have to (I suspect) create the table without a constraint, create your own manually-partitioned index on ID, and then alter the table to add a primary key constraint 'USING INDEX nameofindexcreatedearlier'.

In 9i, for what it's worth, the syntax runs

create table blah
col1 number(2) constraint pk_blah_id primary key using index (create index pk_blah_idx etc etc etc), col2 char(3));

And about time too, I suspect.

Regards
HJR "Ed Wong" <ewong_at_mail.com> wrote in message news:a5ae1554.0107181040.4ce9f29e_at_posting.google.com...
> After I partition my table, I found that both lob column and data is
> partitioned, but not primary key. I am wondering how to partition
> primary key in my create table script? Below is my script. Thanks.
>
> CREATE TABLE test
> (
> id NUMBER(10),
> name VARCHAR2(10)
> output CLOB,
> CONSTRAINT pk_test PRIMARY KEY (id)
> PCTFREE 10 STORAGE (...)
> )
> STORAGE (...)
> LOB (output) STORE AS lob_test_output
> (
> STORAGE (...) CHUNK 32K PCTVERSION 20 NOCACHE ENABLE STORAGE IN ROW
> )
> PARTITION BY HASH(id)
> (PARTITION test_p1 TABLESPACE ts_test_p1,
> PARTITION test_p2 TABLESPACE ts_test_p2,
> PARTITION test_p3 TABLESPACE ts_test_p3,
> PARTITION test_p4 TABLESPACE ts_test_p4
> );
Received on Wed Jul 18 2001 - 23:46:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US