SELECT SYS_CONTEXT('USERENV','IP_ADDRESS'),USERNAME,PROGRAM,MODULE
FROM V$SESSION WHERE AUDSID=USERENV('sessionid') ;
Oracle10g 的结果是正确的 :
SYS_CONTEXT('USERENV','IP_ADDRESS'),USERNAME,PROGRAM,MODULE
10.161.32.120,SYS,toad.exe,TOAD 9.7.0.51
Oracle 9.2.0.8 的结果是显示很多链接的程序,且显示后台进程
SYS_CONTEXT('USERENV','IP_ADDRESS'),USERNAME,PROGRAM,MODULE
10.161.32.120,,oracle@imbfatp (PMON),
10.161.32.120,,oracle@imbfatp (DBW0),
10.161.32.120,,oracle@imbfatp (LGWR),
10.161.32.120,,oracle@imbfatp (CKPT),
10.161.32.120,,oracle@imbfatp (SMON),
10.161.32.120,,oracle@imbfatp (RECO),
10.161.32.120,,oracle@imbfatp (CJQ0),
10.161.32.120,,oracle@imbfatp (ARC0),
10.161.32.120,,oracle@imbfatp (ARC1),
10.161.32.120,SYS,sqlplus@imbfatp (TNS V1-V3),sqlplus@imbfatp (TNS V1-V3)
10.161.32.120,SYS,toad.exe,TOAD 9.7.0.51
10.161.32.120,SYS,Toad.exe,Toad.exe
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-711675/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/35489/viewspace-711675/