分类: Oracle
2014-03-18 11:26:08
SELECT U.USER_NAME,
APP.APPLICATION_SHORT_NAME,
FAT.APPLICATION_NAME,
FR.RESPONSIBILITY_KEY,
FRT.RESPONSIBILITY_NAME,
FFF.FUNCTION_NAME,
FFT.USER_FUNCTION_NAME,
ICX.FUNCTION_TYPE,
ICX.FIRST_CONNECT,
ICX.LAST_CONNECT
FROM ICX_SESSIONS ICX,
FND_USER U,
FND_APPLICATION APP,
FND_APPLICATION_TL FAT,
FND_RESPONSIBILITY FR,
FND_RESPONSIBILITY_TL FRT,
FND_FORM_FUNCTIONS FFF,
FND_FORM_FUNCTIONS_TL FFT
WHERE 1 = 1
AND U.USER_ID = ICX.USER_ID
AND ICX.RESPONSIBILITY_APPLICATION_ID = APP.APPLICATION_ID
AND FAT.APPLICATION_ID = ICX.RESPONSIBILITY_APPLICATION_ID
AND FAT.LANGUAGE = 'ZHS'
AND FR.APPLICATION_ID = ICX.RESPONSIBILITY_APPLICATION_ID
AND FR.RESPONSIBILITY_ID = ICX.RESPONSIBILITY_ID
AND FRT.LANGUAGE = 'ZHS'
AND FRT.APPLICATION_ID = ICX.RESPONSIBILITY_APPLICATION_ID
AND FRT.RESPONSIBILITY_ID = ICX.RESPONSIBILITY_ID
AND FFF.FUNCTION_ID = ICX.FUNCTION_ID
AND FFT.FUNCTION_ID = ICX.FUNCTION_ID
AND ICX.DISABLED_FLAG != 'Y'
AND ICX.PSEUDO_FLAG = 'N'
AND (ICX.LAST_CONNECT +
DECODE(FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT'),
NULL,
ICX.LIMIT_TIME,
0,
ICX.LIMIT_TIME,
FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT') / 60) / 24) >
SYSDATE
AND ICX.COUNTER < ICX.LIMIT_CONNECTS;
-------------------------------------
-------------------
SELECT
FSAV.USER_NAME,
FU.DESCRIPTION,
FSAV.RESPONSIBILITY_NAME,
FSAV.USER_FORM_NAME,
FSAV.LOGIN_NAME,
FSAV.TIME,
FSAV.PID,
FSAV.TERMINAL_ID,
FSAV.USER_ID,
FSAV.RESP_APPL_ID,
FSAV.RESPONSIBILITY_ID,
FSAV.FORM_ID,
FSAV.FORM_APPL_ID
FROM FND_SIGNON_AUDIT_VIEW FSAV,
FND_USER FU
where FSAV.LOGIN_NAME='applprod'
AND FSAV.USER_ID = FU.USER_ID
order by to_number(substr(FSAV.TIME,1,instr(FSAV.TIME,':')-1))*60 + to_number(substr(FSAV.TIME,instr(FSAV.TIME,':')+1))