找出機器名
SELECT a.program,a.module, a.machine,a.sample_time , substr(b.sql_text, 1,100)
FROM DBA_HIST_ACTIVE_SESS_HISTORY a,V$sql b
where lower(b.sql_text) like '%mlbii.cr_dcs%'
and a.sql_id=b.sql_id and lower(a.program) like '%plsqldev.exe'
and a.SAMPLE_TIME between to_timestamp('2012-05-11 22:00:00','yyyy-mm-dd hh24:mi:ss') and to_timestamp('2012-05-12 02:00:00', 'yyyy-mm-dd hh24:mi:ss')
order by a.sample_time asc;
根據機器名到listener.log中找使用人的名字和IP地址
alter session set nls_date_format='dd-mm-yyyy hh24:mi:ss';
select sysdate from dual;
select 'grep -i '||s.terminal||' listener_app.log '||'| grep -i '||'"'||to_char(to_date(s.logon_time,'dd-mm-yyyy hh24:mi:ss'))||'"'||' >> session.txt'
from v$session s
where upper(s.program)='Toad.EXE'
or upper(s.program)='Toad.EXE';
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23757700/viewspace-723408/ ,如需转载,请注明出处,否则将追究法律责任。