Help with query to find buffer pool usage

Help with query to find buffer pool usage

Post by Richard Piaseck » Sun, 21 Apr 2002 17:21:07



Greetings.

I am currently using the following query to find the
objects that are cached in the block buffer pool.

select a.status, b.object_name, count(*) total
from v$bh a, dba_objects b
where a.objd = b.object_id(+)
group by a.status, b.object_name;

It works fine. But, I'd really like to include the pool
in the output (keep, recycle, default). However, there
doesn't seem to be a field in v$bh (or even x$bh) that
corresponds to the pool.

Does anyone know how to get this information? I assume
I need to join with another table. Which one is it?

--- Rich

 
 
 

Help with query to find buffer pool usage

Post by Anton Buij » Mon, 22 Apr 2002 06:44:13


Mayby you could add a join with DBA_SEGMENTS. Oracle stores the buffer pool
you have choosen for the segment there.
Had a quick look on the - very good - site http://www.ixora.com.au but could
not find a script so quickly there.
You will find scripts there that give you insight in the X$-views, that may
lead you to a more performing solution.



Quote:

> Greetings.

> I am currently using the following query to find the
> objects that are cached in the block buffer pool.

> select a.status, b.object_name, count(*) total
> from v$bh a, dba_objects b
> where a.objd = b.object_id(+)
> group by a.status, b.object_name;

> It works fine. But, I'd really like to include the pool
> in the output (keep, recycle, default). However, there
> doesn't seem to be a field in v$bh (or even x$bh) that
> corresponds to the pool.

> Does anyone know how to get this information? I assume
> I need to join with another table. Which one is it?

> --- Rich


 
 
 

Help with query to find buffer pool usage

Post by Joe Sat » Mon, 22 Apr 2002 07:39:44


do this

select kcbwbpd.bp_name, o.name, count(*) BLOCKS
from sys.x$kcbwds kcbwds, sys.x$kcbwbpd kcbwbpd , sys.x$bh bh, sys.obj$ o
where kcbwds.set_id >= kcbwbpd.bp_lo_sid
and kcbwds.set_id <= kcbwbpd.bp_hi_sid
and kcbwbpd.bp_size != 0
and bh.indx between start_buf# and end_buf#
and o.dataobj# = bh.obj
and bh.state !=0
and o.owner# !=0
and bp_name = 'KEEP'
group by kcbwbpd.bp_name, o.name

thanks

Quote:

> Greetings.

> I am currently using the following query to find the
> objects that are cached in the block buffer pool.

> select a.status, b.object_name, count(*) total
> from v$bh a, dba_objects b
> where a.objd = b.object_id(+)
> group by a.status, b.object_name;

> It works fine. But, I'd really like to include the pool
> in the output (keep, recycle, default). However, there
> doesn't seem to be a field in v$bh (or even x$bh) that
> corresponds to the pool.

> Does anyone know how to get this information? I assume
> I need to join with another table. Which one is it?

> --- Rich

 
 
 

Help with query to find buffer pool usage

Post by Suni » Tue, 23 Apr 2002 15:43:44


I know this is out of context but can some one please explain the difference
between the X$ and V$ views

Thanks,
Sunil.


> Mayby you could add a join with DBA_SEGMENTS. Oracle stores the buffer
pool
> you have choosen for the segment there.
> Had a quick look on the - very good - site http://www.ixora.com.au but
could
> not find a script so quickly there.
> You will find scripts there that give you insight in the X$-views, that
may
> lead you to a more performing solution.



> > Greetings.

> > I am currently using the following query to find the
> > objects that are cached in the block buffer pool.

> > select a.status, b.object_name, count(*) total
> > from v$bh a, dba_objects b
> > where a.objd = b.object_id(+)
> > group by a.status, b.object_name;

> > It works fine. But, I'd really like to include the pool
> > in the output (keep, recycle, default). However, there
> > doesn't seem to be a field in v$bh (or even x$bh) that
> > corresponds to the pool.

> > Does anyone know how to get this information? I assume
> > I need to join with another table. Which one is it?

> > --- Rich

 
 
 

Help with query to find buffer pool usage

Post by Nuno Sout » Tue, 23 Apr 2002 22:33:26



Quote:> I know this is out of context but can some one please explain the difference
> between the X$ and V$ views

X$ refers almost 1:1 to the in-memory structures and arrays in Oracle.  
V$ views are actually made up as normal views, with SQL that uses the X$
"tables" to make them slightly more understandable.
Fascinating stuff to look at if you have the time.

There is a V$ view that actually contains the SQL used to build all the
other V$ views from the X$ data.  Can't remember its name but it's
obvious if you do

select view_name from dba_views
where owner = 'SYS' and view_name like 'V_$%';

connected as user SYS.  It's one of the many views (and many other
mechanisms) used by folks like Steve Adams and Jonathan to figure out how
things work inside Oracle.  

HTH
--
Cheers
Nuno Souto

 
 
 

1. ORA-25125 preventing import BUFFER POOL not allowed HELP

db: 8.0.5.1.0
os: HP 11.0

I copied db datafilkes from HP 10:20 (8.0.5.1.0) and recreated the control
files; everything seems to be working fine except this!
Rerunning the cat scripts makes no difference.
If I export a table, I cannot import it .

Does anyone know how I might be able to uimport the data from an export
dump file? Pre-createing the tables/indexes makes no difference.
How can I export without the BUFFER_POOL option? Or must it be changed
from the default (DEFAULT)??

I need to get at some data in my exports, so any assistance will be much
appreciated.

(show=y and indexfile= both generate SQL with the BUFFER_POOL option, and
the SQL cannot be run.)

Trevor

2. tutorials on databases

3. Help pls re. extending buffer pool

4. BPCS/ Informix 7.1

5. does optimizer prefer big 2KB buffer pool instead of small size large i/o buffer pool ?

6. Printing to an Apple LaserWriter 630 from FoxPro 2.0

7. buffer cache and memory pool

8. SQL Server Agent Error - password verification

9. buffer pool

10. cache vs keep buffer pool

11. x$bh - which buffer pool is a block from

12. DB block buffers and Shared Pool Size on Oracle 7.3 Windows NT 4.0

13. Buffer Pool KEEP -- NOT keeping !!