Want to post your scripts here in this blog ? Email it to snojha@gmail.com. You will be rewarded for your scripts if selected by our experts.

Wednesday, July 11, 2007

access.sql

-- -----------------------------------------------------------------------------------
-- File Name : access.sql
-- Author : Sachchida Ojha
-- Description : Lists all objects being accessed in the schema.
-- Call Syntax : @access (schema-name)
-- Requirements : Access to the v$views.
-- Last Modified: 04/28/2005
-- -----------------------------------------------------------------------------------
SET SERVEROUTPUT ON
SET PAGESIZE 1000
SET LINESIZE 255
SET VERIFY OFF

SELECT Substr(a.object,1,30) object,
a.type,
a.sid,
b.username,
b.osuser,
b.program
FROM v$access a,
v$session b
WHERE a.sid = b.sid
AND a.owner = Upper('&1');

PROMPT
SET PAGESIZE 18

No comments: