[Oracle]查看数据是否被移入 DataBuffer 的方法
查看数据是否被移入 DataBuffer 的方法:
例如:表名为 tabxxx, 用户为U2:
SQL> grant dba to u2 identified by u2;
SQL> conn u2/u2
SQL>
SQL> create table tabxxx as select * from dba_objects;
SQL> select count(*) from tabxxx;
COUNT(*)
----------
69263
SQL>
SQL> select o.owner,o.object_name,o.object_type,s.buffer_pool,count(*) buffers
from dba_objects o,v$bh b,dba_segments s
where b.objd=o.data_object_id
and o.owner = 'U2'
and o.object_name like '%XXX%'
and o.object_name=s.segment_name
and o.object_type=s.segment_type
group by o.owner,o.object_name,o.object_type,o.status,s.buffer_pool
order by buffers;
OWNER
------------------------------------------------------------------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------------------
OBJECT_TYPE BUFFER_POOL BUFFERS
--------------------------------------------------------- --------------------- ----------
U2
TABXXX
TABLE DEFAULT 1045
SQL>