REM Script:       show_sql.sql
REM Title:        shows the currently running sql-statements
REM Compatible:   Oracle 7.x
REM Usage:        run as system(DBA)
REM                
REM Parameters:   0
REM History:
REM                23-Sep-1998 JKrueger Created
REM Modificatins : 22-Sept-99 JKrueger : execution counter




set pagesize 80 
set linesize 132 
set feedback off 
set verify off 
set echo off 
column address noprint 
column username format a12 
break on address skip 1 
select 
a.address , a.sql_text, c.executions, osuser, username 
from v$sqltext a, v$session s , v$sqlarea c
where s.SQL_ADDRESS = a.ADDRESS and 
a.ADDRESS = c.address  and 
s.status = 'ACTIVE' and s.type !='BACKGROUND' 
order by a.ADDRESS, a.piece ; 
