oracle實用sql(14)--查詢分割槽表的分割槽列和子分割槽列
SELECT *
FROM (SELECT B.OWNER,
B.TABLE_NAME,
B.PARTITIONING_TYPE,
' ' SUBPARTITIONING_TYPE,
A.COLUMN_NAME,
A.COLUMN_POSITION
FROM DBA_PART_KEY_COLUMNS A, DBA_PART_TABLES B
WHERE A.OWNER = B.OWNER
AND A.NAME = B.TABLE_NAME
UNION ALL
SELECT B.OWNER,
B.TABLE_NAME,
'' PARTITIONING_TYPE,
B.PARTITIONING_TYPE SUBPARTITIONING_TYPE,
A.COLUMN_NAME,
A.COLUMN_POSITION
FROM (SELECT U.NAME OWNER,
O.NAME,
DECODE(BITAND(C.PROPERTY, 1), 1, A.NAME, C.NAME) COLUMN_NAME,
PC.POS# COLUMN_POSITION
FROM SUBPARTCOL$ PC, OBJ$ O, COL$ C, USER$ U, ATTRCOL$ A
WHERE PC.OBJ# = O.OBJ#
AND PC.OBJ# = C.OBJ#
AND C.INTCOL# = PC.INTCOL#
AND U.USER# = O.OWNER#
AND C.OBJ# = A.OBJ#(+)
AND C.INTCOL# = A.INTCOL#(+)
AND O.NAMESPACE = 1
AND O.REMOTEOWNER IS NULL
AND O.LINKNAME IS NULL
AND O.SUBNAME IS NULL) A,
DBA_PART_TABLES B
WHERE A.OWNER = B.OWNER
AND A.NAME = B.TABLE_NAME)
WHERE OWNER LIKE '%SCOTT%'
AND TABLE_NAME NOT LIKE 'BIN$%'
ORDER BY OWNER,
TABLE_NAME,
PARTITIONING_TYPE,
COLUMN_POSITION,
SUBPARTITIONING_TYPE,
COLUMN_POSITION
FROM (SELECT B.OWNER,
B.TABLE_NAME,
B.PARTITIONING_TYPE,
' ' SUBPARTITIONING_TYPE,
A.COLUMN_NAME,
A.COLUMN_POSITION
FROM DBA_PART_KEY_COLUMNS A, DBA_PART_TABLES B
WHERE A.OWNER = B.OWNER
AND A.NAME = B.TABLE_NAME
UNION ALL
SELECT B.OWNER,
B.TABLE_NAME,
'' PARTITIONING_TYPE,
B.PARTITIONING_TYPE SUBPARTITIONING_TYPE,
A.COLUMN_NAME,
A.COLUMN_POSITION
FROM (SELECT U.NAME OWNER,
O.NAME,
DECODE(BITAND(C.PROPERTY, 1), 1, A.NAME, C.NAME) COLUMN_NAME,
PC.POS# COLUMN_POSITION
FROM SUBPARTCOL$ PC, OBJ$ O, COL$ C, USER$ U, ATTRCOL$ A
WHERE PC.OBJ# = O.OBJ#
AND PC.OBJ# = C.OBJ#
AND C.INTCOL# = PC.INTCOL#
AND U.USER# = O.OWNER#
AND C.OBJ# = A.OBJ#(+)
AND C.INTCOL# = A.INTCOL#(+)
AND O.NAMESPACE = 1
AND O.REMOTEOWNER IS NULL
AND O.LINKNAME IS NULL
AND O.SUBNAME IS NULL) A,
DBA_PART_TABLES B
WHERE A.OWNER = B.OWNER
AND A.NAME = B.TABLE_NAME)
WHERE OWNER LIKE '%SCOTT%'
AND TABLE_NAME NOT LIKE 'BIN$%'
ORDER BY OWNER,
TABLE_NAME,
PARTITIONING_TYPE,
COLUMN_POSITION,
SUBPARTITIONING_TYPE,
COLUMN_POSITION
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-2136595/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle分割槽表和分割槽表exchangeOracle
- Oracle分割槽表基礎運維-07增加分割槽(3列表分割槽)Oracle運維
- oracle分割槽表和非分割槽表exchangeOracle
- Oracle分割槽表基礎運維-04列表分割槽Oracle運維
- [oracle] expdp 匯出分割槽表的分割槽Oracle
- oracle 分割槽表move和包含分割槽表的lob moveOracle
- Oracle12c:建立主分割槽、子分割槽,實現自動分割槽插入效果Oracle
- HGDB的分割槽表實現SQL Server的分割槽檢視SQLServer
- Oracle分割槽表基礎運維-07增加分割槽(2 HASH分割槽)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(1範圍分割槽)Oracle運維
- 移動分割槽表和分割槽索引的表空間索引
- PostgreSQL/LightDB 分割槽表之分割槽裁剪SQL
- Oracle SQL調優之分割槽表OracleSQL
- Oracle分割槽表基礎運維-09刪除分割槽Oracle運維
- Oracle分割槽表基礎運維-05組合分割槽Oracle運維
- Oracle分割槽表基礎運維-02範圍分割槽Oracle運維
- Oracle分割槽表基礎運維-03HASH分割槽Oracle運維
- SQL Server大分割槽表沒有空分割槽的情況下如何擴充套件分割槽的方法SQLServer套件
- PG的非分割槽表線上轉分割槽表
- 非分割槽錶轉換成分割槽表
- SQL SERVER之分割槽表SQLServer
- Oracle分割槽表基礎運維-06分割槽表索引Oracle運維索引
- ORACLE分割槽表梳理系列Oracle
- Oracle查詢Interval partition分割槽表內資料Oracle
- 分割槽表-實戰
- oracle 線上重新定義,普通表改變分割槽表,分割槽表可以更改型別、分割槽欄位等Oracle型別
- Oracle分割槽表基礎運維-01分割槽表分類Oracle運維
- Linux分割槽方案、分割槽建議Linux
- 【MYSQL】 分割槽表MySql
- Oracle 12.2之後ALTER TABLE .. MODIFY轉換非分割槽表為分割槽表Oracle
- 【Linux】MBR磁碟分割槽表只能有四個分割槽?Linux
- Mysql表分割槽實現MySql
- Mysql表分割槽實操MySql
- 對oracle分割槽表的理解整理Oracle
- oracle將表配置為分割槽表Oracle
- oracle 普通表-分割槽表改造流程Oracle
- ORACLE刪除-表分割槽和資料Oracle
- Linux 分割槽擴容(根分割槽擴容,SWAP 分割槽擴容,掛載新分割槽為目錄)Linux
- 分割槽表之自動增加分割槽(11G)