標籤:--query許可權即可查看系統有哪些失效的PKG。(我們系統的PKG一般是OPER使用者建立的)select * from all_objects a where a.owner = ‘GNBSOPER‘ and a.status = ‘INVALID‘;--查看系統資料表的約束select * from all_contraints;Type CodeType DescriptionActs On LevelCCheck on a tableColumnORead Only on a
標籤:1.根據ROWID來分select * from t_xiaoxi where rowid in(select rid from (select rownum rn,rid from(select rowid rid,cid fromt_xiaoxi order by cid desc) where rownum<10000) where rn>9980) order by cid desc;執行時間0.03秒2.按分析函數來分select * from
標籤:假設TABLE名為t,PRIMARY KEY為id,則:1-5000000SELECT t.* FROM t , (SELECT id, ROW_NUMBER() OVER( ORDER BY id ) AS num FROM t) as t1WHERE t.id = t1.id AND t1.num <5000000150000001 - 100000000SELECT t.* FROM t , (SELECT id, ROW_NUMBER() OVER(
標籤:金蝶BOS裡系統資料表 t_bas_message 表用於存放系統訊息.實際操作中,用戶端預設15分鐘查詢一次是否有新訊息 使用者基本不會去刪除已讀的訊息,這就導致這張表大得驚人,系統運行一年多以來,大約有 450萬條資料.再加上這張表上存在索引,對資料庫而言,一旦操作失誤導致表中索引失效,資料庫會因為全表掃描太多徹底卡死. 之後考濾刪除一個月以前的資料執行SQL語句如下 DELETE FROM t_bas_message t WHERE
標籤:A potential customer asked my about porting her application from Oracle Database to MySQL.I always try to start with the "why" (a dear friend bought me this book, recommended: http://www.amazon.com/Start-Why-Leaders-Inspire-Everyone/dp/1591846447)