/* ************************************************ */
/*                                                  */
/* Script: Display open cursor information          */
/*                                                  */
/* name:    @c:\oracle\sql\v$latch.sql             */
/* date:    24-AUG-95                               */
/* creator: Rick Kupcunas                           */
/*                                                  */
/* ************************************************ */

set pagesize 65;
set linesize 120;

select substr(name, 1,30) 								"NAME",
	to_char(gets, '9,999,999')							"GETS",
	to_char(misses, '9,999,999')						"MISSES",
      to_char(round((gets-misses)/decode(gets,0,1,gets), 3),'99.999') 	"HIT RATIO",
      to_char(sleeps, '9,999,999')						"SLEEPS",
      to_char(round(sleeps/decode(misses,0,1,misses), 3), '99.999') 		"SLEEP/MISS",
	to_char(immediate_gets, '9,999,999')					"IMM GETS",
	to_char(immediate_misses, '9,999,999')					"IMM MISS",
	to_char(spin_gets, '9,999,999')						"SPINS"
  from v$latch
order by 1 asc, 2 asc, 3 asc;

commit;

