oracle blob_clob列的表如何指定sement_name及index name
參考:
http://space.itpub.net/267265/viewspace-760948
---建立lob列的表
SQL> create table t_lob(a int,b clob,c blob);
Table created
---檢視lob列表資訊
SQL> select * from user_lobs;--主要看segment_name,index_name列,即lob型別會獨立歸屬於lob segment和產生一個對應的index
TABLE_NAME COLUMN_NAME SEGMENT_NAME TABLESPACE_NAME INDEX_NAME CHUNK PCTVERSION RETENTION FREEPOOLS CACHE LOGGING ENCRYPT COMPRESSION DEDUPLICATION IN_ROW FORMAT PARTITIONED SECUREFILE SEGMENT_CREATED
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---------- ------- ------- ----------- --------------- ------ --------------- ----------- ---------- ---------------
T_LOB B SYS_LOB0000073737C00002$$ TBS_NEWLY SYS_IL0000073737C00002$$ 8192 900 NO YES NONE NONE NONE YES ENDIAN NEUTRAL NO NO NO
T_LOB C SYS_LOB0000073737C00003$$ TBS_NEWLY SYS_IL0000073737C00003$$ 8192 900 NO YES NONE NONE NONE YES NOT APPLICABLE NO NO NO
--由下可知segment_name構成為:sys_lob00000+object_id+0000+column_id+$$
SQL> select * from user_objects where object_name='T_LOB';
OBJECT_NAME SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE CREATED LAST_DDL_TIME TIMESTAMP STATUS TEMPORARY GENERATED SECONDARY NAMESPACE EDITION_NAME
-------------------------------------------------------------------------------- ------------------------------ ---------- -------------- ------------------- ----------- ------------- ------------------- ------- --------- --------- --------- ---------- ------------------------------
T_LOB 73737 73737 TABLE 2013-05-17 2013-05-17 18 2013-05-17:18:20:16 VALID N N N 1
---lob列對應的索引不能直接rename
SQL> alter index SYS_IL0000073737C00002$$ rename to index_t_lob_b;
alter index SYS_IL0000073737C00002$$ rename to index_t_lob_b
ORA-22864: cannot ALTER or DROP LOB indexes
SQL>
SQL>
SQL>
SQL> drop table t_lob purge;
Table dropped
--如下可以指定lob列產生指定名稱的index_name,便於管理,知道此lob index對應哪個表,但是segment_name還是沒有變過來
SQL> create table t_lob(a int,b blob) lob(b) store as (index idx_t_lob);
Table created
SQL> select * from user_lobs;
TABLE_NAME COLUMN_NAME SEGMENT_NAME TABLESPACE_NAME INDEX_NAME CHUNK PCTVERSION RETENTION FREEPOOLS CACHE LOGGING ENCRYPT COMPRESSION DEDUPLICATION IN_ROW FORMAT PARTITIONED SECUREFILE SEGMENT_CREATED
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---------- ------- ------- ----------- --------------- ------ --------------- ----------- ---------- ---------------
T_LOB B SYS_LOB0000073742C00002$$ TBS_NEWLY IDX_T_LOB 8192 900 NO YES NONE NONE NONE YES NOT APPLICABLE NO NO NO
---指定lob列的segment_name及index_name
SQL> create table t_lob(a int,b blob) lob(b) store as idx_t_lob ( index idx_t_lob);
Table created
SQL> select * from user_lobs;
TABLE_NAME COLUMN_NAME SEGMENT_NAME TABLESPACE_NAME INDEX_NAME CHUNK PCTVERSION RETENTION FREEPOOLS CACHE LOGGING ENCRYPT COMPRESSION DEDUPLICATION IN_ROW FORMAT PARTITIONED SECUREFILE SEGMENT_CREATED
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- ---------- ---------- ------- ------- ----------- --------------- ------ --------------- ----------- ---------- ---------------
T_LOB B
問題:未在11g官方手冊create table查到index選項
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-761395/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何更改table及index的表空間Index
- 在Oracle中列出指定資料表的全部索引列Oracle索引
- javascript的boolean及陣列的indexJavaScriptBoolean陣列Index
- index_oracle索引梳理系列及分割槽表梳理IndexOracle索引
- oracle資料庫獲取指定表的列的相關資訊Oracle資料庫
- oracle中如何指定表欄位自增Oracle
- oracle INDEX BY Pl/sql陣列OracleIndexSQL陣列
- CSS 匹配指定name元素CSS
- 簇表及簇表管理(Index clustered tables)Index
- Oracle中的虛擬列索引-nosegment indexOracle索引Index
- 能否在Oracle資料庫表中指定列順序OKOracle資料庫
- Oracle表table與索引index的分析及索引重建及統計資訊匯入匯出Oracle索引Index
- js如何複製指定的陣列JS陣列
- Elasticsearch 6 建立索引報錯 invalid_index_name_exception Invalid index name [testDemo], must be lowercaseElasticsearch索引IndexException
- 檢視哪些表的哪些列含有指定字串(如‘andy’存在哪些表的哪些列中)字串
- js如何移除陣列中指定索引的項JS陣列索引
- js如何判斷陣列是否含有指定的元素JS陣列
- 如何在Oracle表中選擇主鍵列BWOracle
- MysqL中的Show Index From Table_Name命令說明MySqlIndex
- 【Oracle】global index & local index的區別OracleIndex
- js如何獲取指定陣列元素在陣列中的索引值JS陣列索引
- 給show parameter 命令的name列設定列寬
- DB_NAME&TANCE_NAME&DB_UNIQUE_NAME&ORACLE_SID&GLOBAL_NAME&DB_DOMAIN&SERVICE_NAMEOracleAI
- js 固定表頭及固定列的jsJS
- oracle修改表增加列刪除列修改列Oracle
- Oracle表的建立及設計Oracle
- oracle中眾多的nameOracle
- javascript陣列如何刪除所有的指定值陣列項JavaScript陣列
- and_equal最多可以指定5個index!Index
- [轉]ORACLE中的DB_NAME,SERVICE_NAME,INSTANCE_NAME,ORACLE_SID,GLOBAL_DBNAMEOracle
- oracle11g alter table set unused column指定表某列不可用之系列一Oracle
- 如何讓crs_stat命令結果中的name列完全顯示
- 查詢使用表空間的TABLE,INDEX,INDEX SUBPARTITIONIndex
- ORACLE中index的rebuildOracleIndexRebuild
- Could not find first log file name in binary log index fileIndex
- 常用ORACLE表及作用。Oracle
- ORACLE中的DB_NAME,SERVICE_NAME,INSTANCE_NAME,ORACLE_SID,GLOBAL_DBNAME介紹Oracle
- oracle分割槽partition及分割槽索引partition index(一)Oracle索引Index