Home » RDBMS Server » Server Administration » need to create pk index in seprate tablespace
need to create pk index in seprate tablespace [message #64212] Mon, 03 January 2005 21:58 Go to next message
puneet
Messages: 76
Registered: August 2002
Member
Is it possible to define separate tablespace for PK Indexs ...? normally PK index gets created automatically along with the PK constraint ....but if i want to store PKs Indexes in a separate tablespace .... then how do I mention that ....?
Re: need to create pk index in seprate tablespace [message #64214 is a reply to message #64212] Mon, 03 January 2005 23:55 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
First create the index, then create the primary key 'using index <<z>index_name>':
ONTW>create table tst(id int);

Table created.

ONTW>create index tst_i on tst(id);

Index created.

ONTW>alter table tst add constraint tst_pk primary key (id) using index tst_i;

Table altered.


hth
Re: need to create pk index in seprate tablespace [message #64215 is a reply to message #64214] Mon, 03 January 2005 23:59 Go to previous message
puneet
Messages: 76
Registered: August 2002
Member
hi,

Got the answer

CREATE TABLE puneet_sal
( salary NUMBER CONSTRAINT pk_sal
PRIMARY KEY
USING INDEX TABLESPACE users_a,
losal NUMBER,
hisal NUMBER ) TABLESPACE human_resource;

See in this puneet_sal is created in human resource table and pl_index in user_a table space Oracle creates to enforce this constraint is created in the USERS_A tablespace.

Can u tell me

CREATE TABLE emp_tmp
NOLOGGING
PARALLEL (DEGREE 3)
AS SELECT * FROM emp WHERE deptno = 10;

What is nologging and parallel (degree 3)

Cheers
Puneet Sachar
Previous Topic: creation of database during runtime
Next Topic: forms server very urgent
Goto Forum:
  


Current Time: Thu Jan 09 22:22:32 CST 2025