--查看索引的表空间id SELECT TBSPACEID FROM SYSCAT.INDEXES WHERE INDNAME='A_TEST_INX' --根据上面查到的id查表空间 select * from sysibm.systablespaces where tbspaceid='3'
查看索引所在表空间sql:
--查看索引的表空间id
SELECT
TBSPACEID
FROM
SYSCAT.INDEXES
WHERE
INDNAME='A_TEST_INX'
=============================================================================
如下是创建表的index in 子句的说明:
INDEX IN tablespace-nameIdentifies the table space in which any indexes on a nonpartitioned table or nonpartitioned indexes on a partitioned table are to be created. The specified table space must exist; it must be a DMS table space if the table has data in DMS table spaces, or an SMS table space if the partitioned table has data in SMS table spaces; it must be a table space on which the authorization ID of the statement holds the USE privilege; and it must be in the same database partition group as tablespace-name (SQLSTATE 42838).
Specifying which table space will contain indexes can be done when a table is created or, in the case of partitioned tables, it can be done by specifying the IN clause of the CREATE INDEX statement for a nonpartitioned index. Checking for the USE privilege on the table space is done at table creation time, not when an index is created later.
- The table space by the IN clause of the CREATE INDEX statement
- The table-level table space specified for the INDEX IN clause of the CREATE TABLE statement
- If neither of the preceding are specified, the index is stored in the table space of the first attached or visible data partition(如果前面两个都未指定,则索引存储在第一个附加的或可见的数据分区的表空间中)