create index 的时候不能选择tablespace??

[复制链接]
查看11 | 回复4 | 2007-9-26 18:42:10 | 显示全部楼层 |阅读模式
除了在create table 的时候选择 INDEX IN 以外,单个create index语句难道不能选择表空间吗?
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
The fact on system z is, when you CREATE INDEX, you choose the table name by ON keyword. And DB2 defines index space automatically, ie. index is NOT related to tablespace at all and residing in its own physical file.
For DB2 LUW, you must have a tablespace predefined for both the table and any indexes you might add to the table. Therefore all indexes for the table use the same indexspace. When using SMS managed tablespaces, the indexspace has to be the same as the tablespace.
[ 本帖最后由 Pythagoras 于 2009-1-22 09:41 编辑 ]
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
原帖由 Pythagoras 于 2009-1-22 09:38 发表
The fact on system z is, when you CREATE INDEX, you choose the table name by ON keyword. And DB2 defines index space automatically, ie. index is NOT related to tablespace at all and residing in its own physical file.
For DB2 LUW, you must have a tablespace predefined for both the table and any indexes you might add to the table. Therefore all indexes for the table use the same indexspace. When using SMS managed tablespaces, the indexspace has to be the same as the tablespace.


我指的是UDB
其实在主机DB2里面可以采用stogroup的方式来对索引和数据进行区分
但是在开放系统关系数据库中往往是可以指定index的存储表空间的,但是我发觉在DB2中,除了在create table的时候可以指定其索引所占用的表空间之外,好像在create index的时候就没办法再指定存储表空间了
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
在create index的时候就没办法再指定存储表空间了
That's true. Index will be put in the tablespace which is defined when the table was created.
syntax:
CREATE TABLE tbname IN tsname1 INDEX IN tsname2
--Specifying which table space will contain a table's index can only be done when the table is created.
CREATE INDEX ixname ON tbname
--No alter index is possible.
[ 本帖最后由 Pythagoras 于 2009-1-22 10:09 编辑 ]
回复

使用道具 举报

千问 | 2007-9-26 18:42:10 | 显示全部楼层
如果您的表是rang partition,是可以在create index的时候指定表空间的。 不过,这不是你想要的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行