rem $DBA/dbosqli.sql rem rem Creates required view and synonym for $TOOLS/dbo_sql.sql rem rem MUST be executed by SYS rem rem (This view is used, rather than using v$sqlarea, since the sql_text column rem of v$sqlarea is only 1000 bytes long, and many sql statements are much rem longer than that) rem create or replace view DBO_SQL_TEXT (USERNAME, SID, PIECE, OSUSER, SQL_TEXT) as select username, sid, piece, osuser, name from v$session s, x$kglna x where s.sql_address = x.kglhdadr and s.sql_hash_value = x.kglnahsh and username <> ' '; create public synonym DBO_SQL_TEXT for DBO_SQL_TEXT; grant select on DBO_SQL_TEXT to PUBLIC; exit