Online Contents

SQL Scripts‎ > ‎A-I‎ > ‎

bh.sql

set echo off
--------------------------------------------------------------------------------
-- @name: bh
-- @author: dion cho
-- @note: show block header
-- @usage: @bh f# b#
--------------------------------------------------------------------------------

col object_name format a20
col state format a10

select
  b.dbarfil,
  b.dbablk,
  b.class,
  decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec',6,'irec',7,'write',8,'pi', 9,'memory',10,'mwrite',11,'donated') as state,
  cr_scn_bas,
  cr_scn_wrp,
  cr_uba_fil,
  cr_uba_blk,
  cr_uba_seq,
  (select object_name from dba_objects where object_id = b.obj) as object_name
from sys.xm$bh b
where
  dbarfil = &1 and
  dbablk = &2
;


Comments