oracle索引:
問題一:1.我的期望(目的是):期望僅新創建的index_user索引生效,原索引僅作備份(還原方便),不起作用!
2.問題描述:已有索引名稱為index_user,,如果我僅將該索引名稱改為index_user_bak,(索引內容本身不變),再新建索引index_user(和原index_user創建陳述句完全一樣),請問:1.對于對應的表,實際生效的是哪個索引:index_user_bak和index_user?還是僅index_user?還是其它(如:報錯)?
問題二:如果重建索引(因為有大批量的資料洗掉操作),執行完下面的命令:
ALTER INDEX index_user REBUILD;(ALTER INDEX index_user REBUILD COMPUTE STATISTICS; )
如果要索引馬上生效,還需要做其它操作嗎?(如: 更新統計資訊: execute dbms_stats.gather_table_stats。。。)
分雖然不多,但誠意滿滿的,謝謝親了!
uj5u.com熱心網友回復:
第一個問題,你跑一下就知道結果了。第二個問題, 要是收集統計資訊的;
uj5u.com熱心網友回復:
@wmxcn2000:老大:問題1:是具體何種情況啊? (我需要的是僅新創建的index_user索引生效哦,這么可以么?還是必須先將原索引檔案洗掉,再創建相同的索引檔案呢?)
問題2:只通過上面命名重建索引不會立刻生效么?(如果不手動更新統計資訊,是否oracle有自己的job在某個時間段執行后,也會生效呢?)
uj5u.com熱心網友回復:
-- 問題一
SQL>
SQL> create table test(id int, name varchar2(10)) ;
Table created
SQL> create index ix_test on test(id) ;
Index created
SQL> alter index ix_test rename to ix_text_1 ;
Index altered
SQL> create index ix_test on test(id) ;
create index ix_test on test(id)
ORA-01408: 此列串列已索引
SQL> drop table test purge ;
Table dropped
SQL>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/116407.html
標籤:基礎和管理
上一篇:oracle 安裝問題
