dba常用sql-3(轉)

Rounders發表於2007-08-06
dba常用sql-3[@more@]

//下面的指令碼可以用來計算FSFI值碎片:
select tablespace_name,sqrt(max(blocks)/sum(blocks))*
(100/sqrt(sqrt(count(blocks)))) FSFI
from dba_free_space
group by tablespace_name order by FSFI;


//重建表指令碼
create table zhang.favour_menu_bak as select * from zhang.favour_menu ;
truncate table zhang.favour_menu ;
insert into zhang.favour_menu select * from favour.favour_menu ;
commit;
CREATE INDEX "TX_TEST"."PK_DETAIL_ACC_ITEM_2"
ON "TX_TEST"."DETAIL_ACC_ITEM"("CYCLE_ID", "ACCOUNT_ID")
TABLESPACE "BA_INDEX_6";
//建索引指令碼
CREATE INDEX "IUTBS"."PK_DETAIL_ACC_2"
ON "IUTBS"."DETAIL_ACC_ITEM"("CYCLE_ID", "ACCOUNT_ID")
TABLESPACE "TS_ACCT_ITEM_IDX";

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9417382/viewspace-932241/,如需轉載,請註明出處,否則將追究法律責任。

相關文章