user_tab_cols比user_tab_columns多几列
HIDDEN_COLUMN VARCHAR2(3)
VIRTUAL_COLUMN VARCHAR2(3)
SEGMENT_COLUMN_ID NUMBER
INTERNAL_COLUMN_ID NOT NULL NUMBER
QUALIFIED_COL_NAME VARCHAR2(4000)
而且存储内容多了隐藏字段。这些字段是oracle自动添加的,并且设置hidden_column和
virtual_column都是yes
create or replace view user_tab_columns as
select TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER,
DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, COLUMN_ID,
DEFAULT_LENGTH, DATA_DEFAULT, NUM_DISTINCT, LOW_VALUE, HIGH_VALUE,
DENSITY, NUM_NULLS, NUM_BUCKETS, LAST_ANALYZED, SAMPLE_SIZE,
CHARACTER_SET_NAME, CHAR_COL_DECL_LENGTH,
GLOBAL_STATS, USER_STATS, AVG_COL_LEN, CHAR_LENGTH, CHAR_USED,
V80_FMT_IMAGE, DATA_UPGRADED, HISTOGRAM
from USER_TAB_COLS
通过脚本可以看出来,user_tab_column是从user_tab_cols得来的,在使用时应尽量使用user_tab_columns,
以避免获取到oracle自行添加的隐藏字段
--顺便记一下索引创建的语法
CREATE INDEX IDX_SYS_T_TEST ON t(object_id);
ALTER INDEX IDX_SYS_T_TEST REBUILD;
DROP INDEX IDX_SYS_T_TEST;