alter table TBL_AIRCOMPANY storage(buffer_pool keep)--把表TBL_AIRCOMPANY设置成keep在pool池中
ALTER TABLE TBL_AIRCOMPANY cache --让TBL_AIRCOMPANY可以缓存
SELECT OBJECT_NAME, A.STATUS, COUNT(*)
FROM V$BH A, USER_OBJECTS B
WHERE A.OBJD = B.OBJECT_ID
--AND OBJECT_NAME IN ('TBL_AIRCOMPANY')
GROUP BY OBJECT_NAME, A.STATUS; --查看是否在缓存keep中
--各个buffer的空间信息
select p.name,sum(a.cnum_repl) "total buffers",sum(a.anum_repl) "free buffers" from x$kcbwds a, v$buffer_pool p
where a.set_id>=p.LO_SETID and
a.set_id<=p.HI_SETID
group by p.name;
--脚本用来定位哪些object在buffer cache中存在,占用的buffer cache的量是多少以及占用的是什么类型的buffer cache。
select decode(pd.bp_id,1,'KEEP',2,'RECYCLE',3,'DEFAULT',
4,'2K SUBCACHE',5,'4K SUBCACHE',6,'8K SUBCACHE',
7,'16K SUBCACHE',8,'32KSUBCACHE','UNKNOWN') subcache,
bh.object_name,bh.blocks
from x$kcbwds ds,x$kcbwbpd pd,(select set_ds,
o.name object_name,count(*) BLOCKS
from obj$ o, x$bh x where o.dataobj# = x.obj
and x.state !=0 and o.owner# !=0
group by set_ds,o.name) bh
where ds.set_id >= pd.bp_lo_sid
and ds.set_id <= pd.bp_hi_sid
and pd.bp_size != 0
and ds.addr=bh.set_ds
order by decode(pd.bp_id,1,'KEEP',2,'RECYCLE',3,'DEFAULT',
4,'2K SUBCACHE',5,'4K SUBCACHE',6,'8K SUBCACHE',
7,'16K SUBCACHE',8,'32KSUBCACHE','UNKNOWN'),bh.blocks;
select
(select value from V$SYSSTAT where name='physical write total bytes')/
(select value from V$SYSSTAT where name='physical read total bytes')*100||'%' 写读比例
from dual
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7191998/viewspace-763984/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7191998/viewspace-763984/