If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > specify index tablespace?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-17-04, 08:45
nkelly nkelly is offline
Registered User
 
Join Date: May 2004
Posts: 8
Question specify index tablespace?

Hello all,

could anyone tell me if there is a way to specify the tablespace
in which an index is created?

I tried this already:

CREATE UNIQUE INDEX IX_USR_ACCOUNT_1 ON USR_ACCOUNT ( NAME, DOMAIN ) IN USERSPACE8
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0104N An unexpected token "IN" was found following ")". Expected tokens
may include: "". SQLSTATE=42601


Thanks,
Noel.
Reply With Quote
  #2 (permalink)  
Old 05-17-04, 08:57
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Noel,
The only way to specify a different tablespace for indexes is when the table is created. Look at the CREATE TABLE ... INDEX IN Command in the SQL Reference.

Andy
Reply With Quote
  #3 (permalink)  
Old 05-17-04, 09:22
nkelly nkelly is offline
Registered User
 
Join Date: May 2004
Posts: 8
Thanks for the reply Andy.

It seems to be a strange way of doing things coming from an Oracle perspective.

From what I can tell the indexes seem to default to the same tablespace
as the table.

Regards,
Noel.
Reply With Quote
  #4 (permalink)  
Old 05-17-04, 09:25
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Noel,
That is correct. The tablespace for the indexes will be the same as the table unless specified in the CREATE TABLE command.

Andy
Reply With Quote
  #5 (permalink)  
Old 05-17-04, 10:35
sathyaram_s sathyaram_s is online now
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Quote:
That is correct. The tablespace for the indexes will be the same as the table unless specified in the CREATE TABLE command.
... and you can specify an index tablespace only if the table and index tablespaces are both dms

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #6 (permalink)  
Old 05-17-04, 10:44
nkelly nkelly is offline
Registered User
 
Join Date: May 2004
Posts: 8
Thumbs up

Thanks Sathyaram.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On