在数据字典中哪里可以找到范围区间分区表空间?

发布于 2024-08-19 09:42:35 字数 308 浏览 8 评论 0原文

对于范围区间分区表,您可以指定多个表空间,例如:

CREATE TABLE range_part_interval_table(col1 NUMBER, col2 NUMBER)
PARTITION BY RANGE (col1)
INTERVAL (10) STORE IN (ts2, ts3, ts4)
(PARTITION VALUES LESS THAN (100) TABLESPACE ts1);

但我找不到区间表空间存储在数据字典中的位置(此处为ts2、ts3、ts4)。此信息在某处可用吗?

For a range interval partitioned table, you can specify multiple tablespaces like:

CREATE TABLE range_part_interval_table(col1 NUMBER, col2 NUMBER)
PARTITION BY RANGE (col1)
INTERVAL (10) STORE IN (ts2, ts3, ts4)
(PARTITION VALUES LESS THAN (100) TABLESPACE ts1);

But I can't find where the interval tablespaces are stored in the data dictionary (here, ts2, ts3, ts4). Is this information available somewhere?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

忘东忘西忘不掉你 2024-08-26 09:42:35

这应该会为您提供所需的信息:

SELECT table_owner, table_name, partition_name, tablespace_name 
FROM dba_tab_partitions 
WHERE table_name = <table_name>;

以下是表格说明:

%> desc dba_tab_partitions

Name                           Null                             Type                                                                                                                                                                                                                                                                                       
------------------------------ -------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
TABLE_OWNER                                                     VARCHAR2(30)                                                                                                                                                                                                                                                                               
TABLE_NAME                                                      VARCHAR2(30)                                                                                                                                                                                                                                                                               
COMPOSITE                                                       VARCHAR2(3)                                                                                                                                                                                                                                                                                
PARTITION_NAME                                                  VARCHAR2(30)                                                                                                                                                                                                                                                                               
SUBPARTITION_COUNT                                              NUMBER                                                                                                                                                                                                                                                                                     
HIGH_VALUE                                                      LONG()                                                                                                                                                                                                                                                                                     
HIGH_VALUE_LENGTH                                               NUMBER                                                                                                                                                                                                                                                                                     
PARTITION_POSITION                                              NUMBER                                                                                                                                                                                                                                                                                     
TABLESPACE_NAME                                                 VARCHAR2(30)                                                                                                                                                                                                                                                                               
PCT_FREE                                                        NUMBER                                                                                                                                                                                                                                                                                     
PCT_USED                                                        NUMBER                                                                                                                                                                                                                                                                                     
INI_TRANS                                                       NUMBER                                                                                                                                                                                                                                                                                     
MAX_TRANS                                                       NUMBER                                                                                                                                                                                                                                                                                     
INITIAL_EXTENT                                                  NUMBER                                                                                                                                                                                                                                                                                     
NEXT_EXTENT                                                     NUMBER                                                                                                                                                                                                                                                                                     
MIN_EXTENT                                                      NUMBER                                                                                                                                                                                                                                                                                     
MAX_EXTENT                                                      NUMBER                                                                                                                                                                                                                                                                                     
MAX_SIZE                                                        NUMBER                                                                                                                                                                                                                                                                                     
PCT_INCREASE                                                    NUMBER                                                                                                                                                                                                                                                                                     
FREELISTS                                                       NUMBER                                                                                                                                                                                                                                                                                     
FREELIST_GROUPS                                                 NUMBER                                                                                                                                                                                                                                                                                     
LOGGING                                                         VARCHAR2(7)                                                                                                                                                                                                                                                                                
COMPRESSION                                                     VARCHAR2(8)                                                                                                                                                                                                                                                                                
COMPRESS_FOR                                                    VARCHAR2(18)                                                                                                                                                                                                                                                                               
NUM_ROWS                                                        NUMBER                                                                                                                                                                                                                                                                                     
BLOCKS                                                          NUMBER                                                                                                                                                                                                                                                                                     
EMPTY_BLOCKS                                                    NUMBER                                                                                                                                                                                                                                                                                     
AVG_SPACE                                                       NUMBER                                                                                                                                                                                                                                                                                     
CHAIN_CNT                                                       NUMBER                                                                                                                                                                                                                                                                                     
AVG_ROW_LEN                                                     NUMBER                                                                                                                                                                                                                                                                                     
SAMPLE_SIZE                                                     NUMBER                                                                                                                                                                                                                                                                                     
LAST_ANALYZED                                                   DATE                                                                                                                                                                                                                                                                                       
BUFFER_POOL                                                     VARCHAR2(7)                                                                                                                                                                                                                                                                                
GLOBAL_STATS                                                    VARCHAR2(3)                                                                                                                                                                                                                                                                                
USER_STATS                                                      VARCHAR2(3)                                                                                                                                                                                                                                                                                

This should get you the info you need:

SELECT table_owner, table_name, partition_name, tablespace_name 
FROM dba_tab_partitions 
WHERE table_name = <table_name>;

The following is the table description:

%> desc dba_tab_partitions

Name                           Null                             Type                                                                                                                                                                                                                                                                                       
------------------------------ -------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 
TABLE_OWNER                                                     VARCHAR2(30)                                                                                                                                                                                                                                                                               
TABLE_NAME                                                      VARCHAR2(30)                                                                                                                                                                                                                                                                               
COMPOSITE                                                       VARCHAR2(3)                                                                                                                                                                                                                                                                                
PARTITION_NAME                                                  VARCHAR2(30)                                                                                                                                                                                                                                                                               
SUBPARTITION_COUNT                                              NUMBER                                                                                                                                                                                                                                                                                     
HIGH_VALUE                                                      LONG()                                                                                                                                                                                                                                                                                     
HIGH_VALUE_LENGTH                                               NUMBER                                                                                                                                                                                                                                                                                     
PARTITION_POSITION                                              NUMBER                                                                                                                                                                                                                                                                                     
TABLESPACE_NAME                                                 VARCHAR2(30)                                                                                                                                                                                                                                                                               
PCT_FREE                                                        NUMBER                                                                                                                                                                                                                                                                                     
PCT_USED                                                        NUMBER                                                                                                                                                                                                                                                                                     
INI_TRANS                                                       NUMBER                                                                                                                                                                                                                                                                                     
MAX_TRANS                                                       NUMBER                                                                                                                                                                                                                                                                                     
INITIAL_EXTENT                                                  NUMBER                                                                                                                                                                                                                                                                                     
NEXT_EXTENT                                                     NUMBER                                                                                                                                                                                                                                                                                     
MIN_EXTENT                                                      NUMBER                                                                                                                                                                                                                                                                                     
MAX_EXTENT                                                      NUMBER                                                                                                                                                                                                                                                                                     
MAX_SIZE                                                        NUMBER                                                                                                                                                                                                                                                                                     
PCT_INCREASE                                                    NUMBER                                                                                                                                                                                                                                                                                     
FREELISTS                                                       NUMBER                                                                                                                                                                                                                                                                                     
FREELIST_GROUPS                                                 NUMBER                                                                                                                                                                                                                                                                                     
LOGGING                                                         VARCHAR2(7)                                                                                                                                                                                                                                                                                
COMPRESSION                                                     VARCHAR2(8)                                                                                                                                                                                                                                                                                
COMPRESS_FOR                                                    VARCHAR2(18)                                                                                                                                                                                                                                                                               
NUM_ROWS                                                        NUMBER                                                                                                                                                                                                                                                                                     
BLOCKS                                                          NUMBER                                                                                                                                                                                                                                                                                     
EMPTY_BLOCKS                                                    NUMBER                                                                                                                                                                                                                                                                                     
AVG_SPACE                                                       NUMBER                                                                                                                                                                                                                                                                                     
CHAIN_CNT                                                       NUMBER                                                                                                                                                                                                                                                                                     
AVG_ROW_LEN                                                     NUMBER                                                                                                                                                                                                                                                                                     
SAMPLE_SIZE                                                     NUMBER                                                                                                                                                                                                                                                                                     
LAST_ANALYZED                                                   DATE                                                                                                                                                                                                                                                                                       
BUFFER_POOL                                                     VARCHAR2(7)                                                                                                                                                                                                                                                                                
GLOBAL_STATS                                                    VARCHAR2(3)                                                                                                                                                                                                                                                                                
USER_STATS                                                      VARCHAR2(3)                                                                                                                                                                                                                                                                                
听你说爱我 2024-08-26 09:42:35

除非您有一些数据,否则您的间隔分区并不存在......

SQL> CREATE TABLE range_part_interval_table(col1 NUMBER, col2 NUMBER)
  2  PARTITION BY RANGE (col1)
  3  INTERVAL (10) STORE IN (ts2, ts3, ts4)
  4  (PARTITION VALUES LESS THAN (100) TABLESPACE ts1);

Table created.

SQL> SELECT table_owner, table_name, partition_name, tablespace_name
  2  FROM dba_tab_partitions
  3  WHERE table_name = 'RANGE_PART_INTERVAL_TABLE'
  4  /

TABLE_OWNER TABLE_NAME                     PARTITION_NAME TABLESPACE_NAME
----------- ------------------------------ -------------- ---------------
APC         RANGE_PART_INTERVAL_TABLE      SYS_P55        TS1

SQL>

空表仅具有定义的分区。但是如果我们插入一些不同时间间隔的数据......

SQL> insert into range_part_interval_table values (90, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (110, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (310, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (120, 8888)
  2  /

1 row created.

SQL> SELECT table_owner, table_name, partition_name, tablespace_name
  2  FROM dba_tab_partitions
  3  WHERE table_name = 'RANGE_PART_INTERVAL_TABLE'
  4  /

TABLE_OWNER TABLE_NAME                     PARTITION_NAME TABLESPACE_NAME
----------- ------------------------------ -------------- ---------------
APC         RANGE_PART_INTERVAL_TABLE      SYS_P58        TS2
APC         RANGE_PART_INTERVAL_TABLE      SYS_P55        TS1
APC         RANGE_PART_INTERVAL_TABLE      SYS_P56        TS4
APC         RANGE_PART_INTERVAL_TABLE      SYS_P57        TS3

SQL>

Your interval partitions don't exist until you have some data in them....

SQL> CREATE TABLE range_part_interval_table(col1 NUMBER, col2 NUMBER)
  2  PARTITION BY RANGE (col1)
  3  INTERVAL (10) STORE IN (ts2, ts3, ts4)
  4  (PARTITION VALUES LESS THAN (100) TABLESPACE ts1);

Table created.

SQL> SELECT table_owner, table_name, partition_name, tablespace_name
  2  FROM dba_tab_partitions
  3  WHERE table_name = 'RANGE_PART_INTERVAL_TABLE'
  4  /

TABLE_OWNER TABLE_NAME                     PARTITION_NAME TABLESPACE_NAME
----------- ------------------------------ -------------- ---------------
APC         RANGE_PART_INTERVAL_TABLE      SYS_P55        TS1

SQL>

The empty table has only the defined partition. But if we insert some data for different intervals....

SQL> insert into range_part_interval_table values (90, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (110, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (310, 8888)
  2  /

1 row created.

SQL> insert into range_part_interval_table values (120, 8888)
  2  /

1 row created.

SQL> SELECT table_owner, table_name, partition_name, tablespace_name
  2  FROM dba_tab_partitions
  3  WHERE table_name = 'RANGE_PART_INTERVAL_TABLE'
  4  /

TABLE_OWNER TABLE_NAME                     PARTITION_NAME TABLESPACE_NAME
----------- ------------------------------ -------------- ---------------
APC         RANGE_PART_INTERVAL_TABLE      SYS_P58        TS2
APC         RANGE_PART_INTERVAL_TABLE      SYS_P55        TS1
APC         RANGE_PART_INTERVAL_TABLE      SYS_P56        TS4
APC         RANGE_PART_INTERVAL_TABLE      SYS_P57        TS3

SQL>
栀子花开つ 2024-08-26 09:42:35

检查 sys.insert_tsn_list$

check sys.insert_tsn_list$

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文