oracle分区怎么查看-Oracle
如何查看 Oracle 分区
查看分区名称和类型
要查看分区名称和类型,可以使用以下查询:
SELECT TABLE_NAME, PARTITION_NAME, PARTITION_TYPE FROM DBA_PARTITIONS WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制
查看分区范围
要查看分区范围,可以使用以下查询:
- 对于范围分区:
SELECT TABLE_NAME, PARTITION_NAME, HIGH_VALUE, NEXT_KEY_VALUE FROM DBA_PART_RANGE_COLUMNS WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制
- 对于列表分区:
SELECT TABLE_NAME, PARTITION_NAME, VALUES FROM DBA_PART_LIST_COLUMNS WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制
- 对于哈希分区:
SELECT TABLE_NAME, PARTITION_NAME, HIGH_VALUE FROM DBA_PART_HASH_COLUMNS WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制
查看分区存储
要查看分区存储信息,可以使用以下查询:
SELECT TABLE_NAME, PARTITION_NAME, FILE_ID, TABLESPACE_NAME FROM DBA_PART_TABLESPACES WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制
查看分区统计
要查看分区统计信息,可以使用以下查询:
SELECT TABLE_NAME, PARTITION_NAME, NUM_ROWS, BLOCKS, AVG_ROW_LEN FROM DBA_PART_STATS WHERE TABLE_OWNER = '<schema name>';</schema>
登录后复制