통합일보를 모니터링하기
말씀드린 현행 통합일보를 모니터링하기 위한 Shell/SQL입니다.
Shell을 cron에 등록하면 두개의 log file이 생성됩니다.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#/bin/sh
export ORACLE_SID=VIS export ORACLE_HOME=/ebiz/db02/dhvis/visora/8.0.6 sqlplus apps/apps @timetable_monitoring.sql
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- DEFINE bg = ‘&' DEFINE fifo = ‘spool-append.temp.fifo’ DEFINE file = ‘timetable_user_count.lst’ DEFINE file_name = ”
— create the fifo synchronous to avoid problems !rm -f &fifo ; umask 077 ; mkfifo &fifo
— start an appending copy asynchronous !(trap “rm -f &fifo” 0; cat &fifo >> &file) &bg
set line 130 spool &fifo
select to_char(sysdate,’yyyy-mm-dd hh24:mi’) “측정시간”, count(*) “Session수” from v$session where username = ‘INSAUSR1’ and program = ‘INSASYS.EXE’;
UNDEFINE fifo UNDEFINE bg UNDEFINE file
spool off
set heading off set echo off set lin 500 spool temp_sql_file.sql select ‘spool ‘||to_char(sysdate,’yyyymmddhh24mi’)||’.lst’ from dual;
select ‘set lin 400’ from dual;
select ‘select SID, EVENT,P1TEXT,P2TEXT,P3TEXT,WAIT_TIME,SECONDS_IN_WAIT,STATE from v$session_wait where sid in (select sid from v$session where username = ”INSAUSR1” and program = ”INSASYS.EXE”);’ from dual;
select ‘select SID,EVENT,TOTAL_WAITS,TOTAL_TIMEOUTS,TIME_WAITED,AVERAGE_WAIT,MAX_WAIT,TIME_WAITED_MICRO from v$session_event where sid in (select sid from v$session where username = ”INSAUSR1” and program = ”INSASYS.EXE”);’ from dual;
select ‘spool off’ from dual;
select ‘exit’ from dual;
spool off @temp_sql_file / exit
Comments