Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: db file sequential read, where does it read to?
"joel garry" <joel-garry_at_home.com> wrote in message
news:1162417597.219001.165100_at_e64g2000cwd.googlegroups.com...
>
> You can look at what segments are in the buffer with v$bh.
> http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/memory.htm#33797
>
>
That's a bad piece of SQL - it's inefficient and gives the wrong results. I've seen several "experts" present without attribution - I didn't realised they'd just copied it from the manuals
SELECT o.object_name, COUNT(1) number_of_blocks
FROM DBA_OBJECTS o, V$BH bh
WHERE o.object_id = bh.objd
AND o.owner != 'SYS'
GROUP BY o.object_name
ORDER BY count(1);
I've stuck a couple of comments about it on my blog at:
http://jonathanlewis.wordpress.com/2006/11/02/but-its-in-the-manual/
PS Sorry about the spurious empty messages that preceded this one. New laptop - the keys are in the wrong places ;)
-- Regards Jonathan Lewis http://jonathanlewis.wordpress.com Author: Cost Based Oracle: Fundamentals http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html The Co-operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.htmlReceived on Thu Nov 02 2006 - 03:39:36 CST