rem ********************************************************************
rem * Author            : Rick Kupcunas
rem * Original          : 28-AUG-95
rem * Description       : Shared pool, calculation; version 7.x+
rem *
/* Shared pool size = (Maximium Session memory * Number of users)	
		 + (Total shared SQL Area Usage)
		 + (Total shared PLSQL Area Usage)
		 --------
		    xxxx
		 *  1.3 free space (at a minimium)
		 --------
		 --SIZE--    */
rem ********************************************************************

spool shared_p.rslt;

set pagesize 100;
set linesize 80;
set long 45;

/* ****************** */
/* Max session memory */
/* ****************** */

select  distinct sid, s.username
  from  v$process p,
	v$session s;

select avg(value), count(*), min(value), max(value)
  from v$sesstat s,
	v$statname n
  where s.statistic# = n.statistic# and
  	n.name = 'session uga memory max';

/* *************************** */
/* Total shared SQL Area Usage */
/* *************************** */

select sum(sharable_mem) from v$sqlarea;

/* ***************************** */
/* Total shared PLSQL Area Usage */
/* ***************************** */

select sum(sharable_mem) from v$db_object_cache;

spool off;

