最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

重慶思莊oracle技術(shù)分享-dba_free_space視圖訪問變慢、消耗變高解決

2023-03-16 11:03 作者:D-Cycle  | 我要投稿

在11g數(shù)據(jù)庫版本,隨著數(shù)據(jù)庫的使用,垃圾數(shù)據(jù)的積累,訪問dba_free_space視圖的消耗會越來越高,訪問耗時越來越長

建議采取以下措施,優(yōu)化dba_free_space視圖的訪問效率

1、重建dba_free_space視圖

create or replace view DBA_FREE_SPACE
? ? (TABLESPACE_NAME, FILE_ID, BLOCK_ID,
? ???BYTES, BLOCKS, RELATIVE_FNO)
as
select ts.name, fi.file#, f.block#,
? ?? ? f.length * ts.blocksize, f.length, f.file#
from sys.ts$ ts, sys.fet$ f, sys.file$ fi
where ts.ts# = f.ts#
??and f.ts# = fi.ts#
??and f.file# = fi.relfile#
??and ts.bitmapped = 0
union all
select /*+ ordered use_nl(f) use_nl(fi) */
? ?? ? ts.name, fi.file#, f.ktfbfebno,
? ?? ? f.ktfbfeblks * ts.blocksize, f.ktfbfeblks, f.ktfbfefno
from sys.ts$ ts, sys.x$ktfbfe f, sys.file$ fi
where ts.ts# = f.ktfbfetsn
??and f.ktfbfetsn = fi.ts#
??and f.ktfbfefno = fi.relfile#
??and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0
union all
select /*+ ordered use_nl(u) use_nl(fi) */
? ?? ? ts.name, fi.file#, u.ktfbuebno,
? ?? ? u.ktfbueblks * ts.blocksize, u.ktfbueblks, u.ktfbuefno
from sys.recyclebin$ rb, sys.ts$ ts, sys.x$ktfbue u, sys.file$ fi
where ts.ts# = rb.ts#
??and rb.ts# = fi.ts#
??and u.ktfbuefno = fi.relfile#
??and u.ktfbuesegtsn = rb.ts#
??and u.ktfbuesegfno = rb.file#
??and u.ktfbuesegbno = rb.block#
??and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0
union all
select ts.name, fi.file#, u.block#,
? ?? ? u.length * ts.blocksize, u.length, u.file#
from sys.ts$ ts, sys.uet$ u, sys.file$ fi, sys.recyclebin$ rb
where ts.ts# = u.ts#
??and u.ts# = fi.ts#
??and u.segfile# = fi.relfile#
??and u.ts# = rb.ts#
??and u.segfile# = rb.file#
??and u.segblock# = rb.block#
??and ts.bitmapped = 0
/


2、清空數(shù)據(jù)庫回收站

sqlplus / as sysdba
purge dba_recyclebin;

說明:在11.2.0.4上測試有效

重慶思莊oracle技術(shù)分享-dba_free_space視圖訪問變慢、消耗變高解決的評論 (共 條)

分享到微博請遵守國家法律
湛江市| 焉耆| 涞源县| 新河县| 德钦县| 武隆县| 绥芬河市| 长丰县| 达孜县| 松滋市| 遂昌县| 原阳县| 缙云县| 扎赉特旗| 宝应县| 武强县| 浦江县| 蕉岭县| 平顶山市| 上饶县| 乐陵市| 鄢陵县| 交城县| 赤城县| 紫云| 尉氏县| 惠水县| 九寨沟县| 紫金县| 甘南县| 沁源县| 民权县| 营山县| 崇文区| 桐梓县| 手机| 雷州市| 阿合奇县| 新泰市| 屏山县| 泗洪县|