檢視DB buffer 中的物件
******************************************************************
-- Contents of Data Buffers
******************************************************************
set pages 999
set lines 92
ttitle 'Contents of Data Buffers'
drop table t1;
create table t1 as
select
o.owner owner,
o.object_name object_name,
o.subobject_name subobject_name,
o.object_type object_type,
count(distinct file# || block#) num_blocks
from
dba_objects o,
v$bh bh
where
o.data_object_id = bh.objd
and
o.owner not in ('SYS','SYSTEM')
and
bh.status != 'free'
group by
o.owner,
o.object_name,
o.subobject_name,
o.object_type
order by
count(distinct file# || block#) desc
;
column c0 heading "Owner" format a12
column c1 heading "Object|Name" format a30
column c2 heading "Object|Type" format a8
column c3 heading "Number of|Blocks in|Buffer|Cache" format 99,999,999
column c4 heading "ercentage|of object|blocks in|Buffer" format 999
column c5 heading "Buffer|Pool" format a7
column c6 heading "Block|Size" format 99,999
select
t1.owner c0,
object_name c1,
case when object_type = 'TABLE PARTITION' then 'TAB PART'
when object_type = 'INDEX PARTITION' then 'IDX PART'
else object_type end c2,
sum(num_blocks) c3,
(sum(num_blocks)/greatest(sum(blocks), .001))*100 c4,
buffer_pool c5,
sum(bytes)/sum(blocks) c6
from
t1,
dba_segments s
where
s.segment_name = t1.object_name
and
s.owner = t1.owner
and
s.segment_type = t1.object_type
and
nvl(s.partition_name,'-') = nvl(t1.subobject_name,'-')
group by
t1.owner,
object_name,
object_type,
buffer_pool
having
sum(num_blocks) > 10
order by
sum(num_blocks) desc
;[@more@]
-- Contents of Data Buffers
******************************************************************
set pages 999
set lines 92
ttitle 'Contents of Data Buffers'
drop table t1;
create table t1 as
select
o.owner owner,
o.object_name object_name,
o.subobject_name subobject_name,
o.object_type object_type,
count(distinct file# || block#) num_blocks
from
dba_objects o,
v$bh bh
where
o.data_object_id = bh.objd
and
o.owner not in ('SYS','SYSTEM')
and
bh.status != 'free'
group by
o.owner,
o.object_name,
o.subobject_name,
o.object_type
order by
count(distinct file# || block#) desc
;
column c0 heading "Owner" format a12
column c1 heading "Object|Name" format a30
column c2 heading "Object|Type" format a8
column c3 heading "Number of|Blocks in|Buffer|Cache" format 99,999,999
column c4 heading "ercentage|of object|blocks in|Buffer" format 999
column c5 heading "Buffer|Pool" format a7
column c6 heading "Block|Size" format 99,999
select
t1.owner c0,
object_name c1,
case when object_type = 'TABLE PARTITION' then 'TAB PART'
when object_type = 'INDEX PARTITION' then 'IDX PART'
else object_type end c2,
sum(num_blocks) c3,
(sum(num_blocks)/greatest(sum(blocks), .001))*100 c4,
buffer_pool c5,
sum(bytes)/sum(blocks) c6
from
t1,
dba_segments s
where
s.segment_name = t1.object_name
and
s.owner = t1.owner
and
s.segment_type = t1.object_type
and
nvl(s.partition_name,'-') = nvl(t1.subobject_name,'-')
group by
t1.owner,
object_name,
object_type,
buffer_pool
having
sum(num_blocks) > 10
order by
sum(num_blocks) desc
;[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/225056/viewspace-1022770/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 檢視資料庫中的物件資料庫物件
- 檢視ORACLE中鎖定物件Oracle物件
- 如何檢視失效的物件物件
- PG物件檢視物件
- DB2檢視鎖等待的SQLDB2SQL
- db2檢視錶大小DB2
- DB2檢視索引的使用情況DB2索引
- DB2 snapshot 管理檢視DB2
- DB2 鎖表情況檢視DB2
- 檢視DB2表結構DB2
- 如何檢視buffer cache的髒資料是否寫回磁碟
- 11 UML中的邏輯檢視、程序檢視、實現檢視、部署檢視
- gdb 檢視 jsoncpp物件JSON物件
- oracle db link的檢視建立與刪除Oracle
- 詳解Buffer Header--DUMP buffer結合X$BH檢視各欄位Header
- db2常用動態效能檢視DB2
- db2檢視執行計劃DB2
- 2 Day DBA-管理方案物件-關於方案物件管理許可權-管理檢視-練習:檢視檢視物件
- oracle檢視建立物件的DDL語句Oracle物件
- buffer cache實驗2-詳解Buffer Header--DUMP buffer結合X$BH檢視各欄位Header
- navicat premium 12檢視物件資訊REM物件
- DataView物件buffer屬性View物件
- DB2上的hidded buffer pool的作用DB2
- DB2常用系統檢視小結DB2
- (8)mysql 中的檢視MySql
- 11、Oracle中的檢視Oracle
- 檢視處理Oracle中被鎖物件的SQLOracle物件SQL
- v$bgprocess --解釋oracle db 後臺程式作用的檢視Oracle
- ASP.NET Core 5.0 MVC中的檢視分類——佈局檢視、啟動檢視、具體檢視、分部檢視ASP.NETMVC
- 設定shell 定期 (crontab job) 執行 DB 中的物件物件
- 檢視屬性+物件動畫元件ViewPropertyObjectAnimator物件動畫元件ViewObject
- 使用資料字典檢視管理物件物件
- Oracle檢視物件佔用空間Oracle物件
- ORACLE中的物化檢視建立Oracle
- Oracle系統檢視中address欄位長度與db位數的關係Oracle
- 全面學習MySQL中的檢視(2) 指定檢視建立者MySql
- 2 Day DBA-管理方案物件-關於方案物件管理許可權-管理檢視-關於檢視物件
- 物件有多少個資料塊緩衝在Data buffer中物件