首页 > 代码库 > Oracle当前用户SQL

Oracle当前用户SQL

select sesion.sid,
sesion.serial#,
sesion.username,
sesion.sql_id,
sesion.sql_child_number,
optimizer_mode,
hash_value,
address,
sql_text
from v$sqlarea sqlarea, v$session sesion
where sesion.sql_hash_value = http://www.mamicode.com/sqlarea.hash_value
and sesion.sql_address = sqlarea.address
and sesion.username is not null;

 

打印sql html

set linesize 1000
set trimspool on
set term off verify off feedback off pagesize 999
set markup html on entmap on spool on
set echo off
spool /tmp/html1.html replace
select * from table;
spool off
set markup html off
set echo on

 

-------------------

AVAST:C63088777H1200A0413-AZHFEZ79

Oracle当前用户SQL