LOGOFF TRIGGER for getting Ip address info,etc

Hi Friends
I am thankful to you that you give such a useful information about my query.
Now I am using the following logon trigger in order to get the required information:
CREATE OR REPLACE TRIGGER trg_session_info
AFTER LOGON ON DATABASE
DECLARE
session_ids VARCHAR2(30);
work_stations VARCHAR2(30);
host_names VARCHAR2(30);
database_servers VARCHAR2(30);
db_domains VARCHAR2(30);
auth_types VARCHAR2(30);
ip_addrs VARCHAR2(30);
network_protocols VARCHAR2(30);
BEGIN
SELECT sys_context ('USERENV', 'SESSIONID') INTO session_ids
FROM dual;
SELECT SYS_CONTEXT('USERENV','OS_USER') INTO work_stations
FROM dual;
SELECT SYS_CONTEXT('USERENV','HOST') INTO host_names
FROM dual;
SELECT SYS_CONTEXT('USERENV','DB_NAME') INTO database_servers
FROM dual;
SELECT SYS_CONTEXT('USERENV','DB_DOMAIN') INTO db_domains
FROM dual;
SELECT sys_context ('USERENV', 'AUTHENTICATION_TYPE')INTO auth_types
FROM dual;
SELECT sys_context ('USERENV', 'IP_ADDRESS') INTO ip_addrs
FROM dual;
SELECT SYS_CONTEXT('USERENV','NETWORK_PROTOCOL') INTO network_protocols
FROM dual;
INSERT INTO session_info(session_id,client_name,logon_date,
work_station,host_name,database_server,db_domain,auth_type,ip_address,network_protocol)
VALUES (session_ids,user,sysdate,work_stations ,host_names ,database_servers,db_domains,
auth_types,ip_addrs, network_protocols);
commit;
END;
I also use the LOGOFF trigger in order to get rid of the session information when they logoff.
But it is not useful if the session terminated abnormally,because the session information can’t delete from the session_info table.
Is there another approach in order to delete the session information from the table session_info, when they termniated abnormally?
Following is the LOGOFF TRIGGER which I am using now:
CREATE OR REPLACE TRIGGER logoff_session
BEFORE LOGOFF ON DATABASE
DECLARE
session_idss VARCHAR2(30);
BEGIN
SELECT sys_context ('USERENV', 'SESSIONID') INTO session_idss
FROM dual;
DELETE from session_info where session_id=session_idss;
commit;
commit;
END;
Could you please give your comment on the above problem that how to delete the session information from the table when it terminated abnormally.
In addition,I like to inform you that I am using Oraexcel for getting the information available on it.
I am using the following query in order to populate an excel sheet:
select SESSION_ID,CLIENT_NAME,to_char(logon_date, 'DD/MM/YY HH24:MI:SS')LOGON_TIME,
WORK_STATION,HOST_NAME,DATABASE_SERVER,DB_DOMAIN, AUTH_TYPE,IP_ADDRESS,NETWORK_PROTOCOL
from session_info;
So my table “session_info” populates the required information into an Excel sheet,whenevere clients logon to database.
But now I want that this information ,which is available on Oraexcel sheet,would be showing a Graphic-visualization of the Network from an Oracle perspective.
The graphical visualization will show the Database server and the connected clients and below the clients show the active sessions.
Could someone please give me idea how should I do that?
THANKS
WITH BEST REGARDS
BILAL

You really should consider using Auditing instead of the trigger based solution.
Its much less work to implement and much more reliable
With your new requirements, it's just
set AUDIT_TRAIL = TRUE in the init.ora
restart the database and switch Auditing on:
SQL>AUDIT SESSION;
Fore some more information see
Auditing Connections and Disconnections
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96521/audit.htm#9471

Similar Messages

  • API for getting diagnotic server info

    Is there an API for getting diagnostic information about the server (memory usage, etc.). We'd like to write a program to monitor the server.

    I am trying to do something similar my call to Session.getSession generates
    the following exception:
    com.iplanet.portalserver.session.SessionException: Can't find resource for
    base name iwtNaming, locale en_US
    Can you help?
    Thanks?
    "Marshall Levin" <[email protected]> wrote in message
    news:9ljs3s$[email protected]..
    Hi,
    I have a JSP running on the same web server as the portal server but not
    running within the portal desktop (it is a stand-alone JSP).
    I have successfully gotten the user's Profile object via the Sessionobject
    and I can get the Hashmap of attributes.
    What I'm trying to get now is the user's domain and role -- is there anyway
    I can get this? I don't see these in the list of attributes. Is there an
    API to find this out? Any suggestions on how I can obtain this info
    programmatically?
    Thanks

  • Function module for getting Vendor Address details

    Hi,
    Im new to this group,and new to ABAP
    plz hep me out by solving ABAP Query...
    i want to generate a report for getting Vendor Details
    like Vendor address,Ph num and Email
    input fields are Company code,country key and Account Group.
    im Using Smart Forms for this..
    but im not getting the Exact Function module to get All Required Details..
    regards
    Smitha

    thanks for ur quick reply...
    SELECT SINGLE LIFNR
      FROM LFB1
      INTO V_LIFNR
      WHERE BUKRS EQ V_BUKRS.
      CALL FUNCTION 'VENDOR_READ'
        EXPORTING
          i_bukrs         = V_BUKRS
          i_lifnr         = V_LIFNR
        EXCEPTIONS
         NOT_FOUND       = 1
         OTHERS          = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    this is the code i have written...
    but my problem is there no table in the Function module....
    for Example...
    CALL FUNCTION 'QPAX_PLMKB_READ_FROM_PLKO'
        EXPORTING
          i_plnty            = 'Q'
          i_plnnr            = V_PLNNR
          I_PLNAL            = V_PLNAL
          i_sttag            = V_DATUV
       TABLES
        T_PLMKB_TAB        = IT_TAB
    i want the function modules with tables and proper input...

  • Restful sample with Java for getting WebI report info in 4.1

    Hi All
    Can anyone give me a sample code in JAVA for getting WebI  report information using Restful services in 4.1 SP1 Version
    Thanks In Advance

    Hi All
    Im unable to execute the below URLs and getting error
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/properties
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/datapaths
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/dataset
    /documents/{documentId}/reports/{reportId}/elements/{elementId}/axes/
    /documents/{documentId}/reports/{reportId}/pages
    /documents/{documentId}/reports/{reportId}/inputcontrols
    /documents/{documentId}/reports/{reportId}/
    Errors:
    Not found. (RWS 00056)
    Not acceptable, (RWS 00058)
    Any Suggestion Please.

  • Help me for get URL address in XSL

    I need my working URL address for XSL.
    I got URL address in Javascript code by document.URL. But i can't use javascript value in XSL code:
    <xsl:variable>???????</xsl:variable> -->?
    what i need to do?
    Help me! plz
    Thank U

    Hi sid700 : No problem just click tools in the in Internet Explorer go down the list and click on toolbars list opens un check mark Microsoft Live Search Toolbar. This will dissable bing search. Another way to make things easer for you is just add your email to your favorites when you have your e-mail web-page open is when you want to save it to favorites. This way you are safer on line to search with Bing then using other search engines. You can able disable any tool bars by following same directions. Havefun.

  • Method /Event for getting all the info passsed on sales order creation/edit

    Hi Experts,
    I am editing sales order screen on UI, and I need all the inputs that I m passing on the screen.
    Can nybody suggest any method or event in which I might catch all the info on clicking the 'SAVE' button.

    Hi Asif Khan,
    Please check this link
    BAPI_SALESORDER_CREATEFROMDAT2 - Sales Order Create
    http://sap-img.com/abap/bapi-salesorder-createfromdat2.htm
    Best regards,
    raam

  • How to Get IP address from 6i?

    I would like to know command or syntax for get IP ADDRESS of computer?
    SELECT SYS_CONTEXT('USERENV','IP_ADDRESS')
    FROM DUAL;
    It can't work in syntax of FORM6i.
    null

    Jason,
    is there any way to make that example
    work with release 6.0, preverribly
    with IE5 (native VM)?
    The WHEN-CUSTOM-ITEM-EVENT Trigger
    doesn't seem to fire.
    Thanks
    Anton Weindl
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jason Pepper ([email protected]):
    If you are using web deployed forms then you need to use a javabean to obtain the IP of the local machine - you can get one that does it here..
    http://technet.oracle.com/sample_code/products/forms/listing.htm#pjcexamp
    If you are running client server then there is a utility in d2kwutil.pll that allows you to read the registry and do things like get the IP address. d2kwutil is shipped with your copy of Forms - just have a look for it - the code is self documenting, but there is also a manual you can read too.
    Jason Pepper
    Principal Product Manager
    Enterprise Internet Tools
    Oracle Corp<HR></BLOCKQUOTE>
    null

  • Please help: Get IP address of a remote device (wifi kit) from DHCP router

    Hi ppl,
    I am about to get the IP address for the wifi kit which is connected to the same router with my PC.
    I need to control my wifi kit through TCP client communication, but DHCP tends to assign new IP address to my wifi kit when connected to router.
    Hence, i wish to write a java function to trace the IP address before starts the communication.
    I am thinking to get the wifi kit's IP address based on the Hostname (name of the wifi shield):
    As below:
    InetAddress thatIp = InetAddress.getByName("Wiznet");
    System.out.println("IP E:"+thatIp.getHostAddress());
    But i don't think this is secure..
    I attempt to research for getting IP address with MAC..
    But have ambiguity on the result i found.
    It stating i have to get the ARP table from router but it is not a good approach.
    I have no luck for next finding on how retrieving the table with Java.
    Hereby hope to have your advise how can i get the ip address of my wifi kit in a more dynamic and secure method..
    is it using Hostname or MAC address or else...
    many thanks.

    hi... wish to have your advise again.
    I tried to retrieve the arp table in java and attempt to extract the IP address based on MAC address for particular devise.
    But i stuck with the substring... my code is as below:
    Process result = Runtime.getRuntime().exec("arp -a");
         BufferedReader output = new BufferedReader
                   (new InputStreamReader(result.getInputStream()));
         String line = output.readLine();
         while(line != null){
              if ( line.startsWith("default") == true ){
                   System.out.println("is default");
                   break;
         line = output.readLine();
         String ipAdd = line.substring(0, 18);
         String MACAdd = line.substring(24, 42);
         System.out.println(line.length() + " " + line + " " + ipAdd + " " + MACAdd );
    i m trying to sub the IP and MAC accordingly.. but i got error saying
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 42
         at java.lang.String.substring(Unknown Source)
         at ExecTest.main(ExecTest.java:22)
    i dun understand this! as since the length of LINE is 56 , why STRING INDEX OUT OF RANGE happen?!
    please advise!!!

  • I create my apple id from my boyfriend macbook and its says that I have to review my itunes information , when I get to the credit card number info etc. Its keep asking me for that I dont have any credit card and I dont want to put any , what should I do?

    I create my apple id from my boyfriend macbook and its says that I have to review my itunes information , when I get to the credit card number info etc. Its keep asking me for that I dont have any credit card and I dont want to put any , what should I do?

    You cannot use that ID without a credit card. You did not create your account correctly. There is very specific way in which you must create your account if you do not want to use a credit card. If you don't have a credit card, you will have to start all over again.
    1. You will have to sign out of that ID before you can create a new one. Settings>iTunes & App Store>Apple ID>Sign out.
    2. You cannot use the email address that you used for the first ID that you created. You will need to use another email address now
    3. You have to download a free app in order to start the new Apple ID process.
    Read this before proceeding.
    http://support.apple.com/kb/HT2534

  • In FB60, Vendor address info getting displays in 2 languages for 2 users

    Hi All,
    Can anyone please provide solution for this issue....
    In XK03, the vendor address showed in English and japan  (Address in Japan language was maintained in internat. versions tab in the same screen) language.
    At the time of booking invoice (Fb60 or MIRO), one user getting vendor address in English and with the same parameters (i'e, vendor no. & invoice date etc..same) another user was tried in his log in, he got the vendor address in Japan language.
    I was checked in ADRC Table and Vendor master data also, i haven't find any mistake in this areas.
    It may happend because of user parameters. I was checked both users parameters.
    Now user wants to see the vendor address (FB60) in their local language (Japan) .

    Hi Prasad,
    In su3 / su01 of the user; there is Tab  maintained as "company" at the botton of the page under the Address Tab...
    If that is maintained as "Company address - please maintain / /" and the Logon Language under defaults is "EN" then the user
    gets the Vendor displayed in English............
    AND if the field Company is maintained as "*** Users Country (Japan)" and the Logon Language under defaults is "EN" then the user gets the Vendor displayed in japanese.
    You need to change the company by clicking on "Assign Other Company address" above Company Tab...

  • When setting up me new iphone - it is asking me for an iCloud password for an email address that doesnt belong to me - it is asking this info in order to retreive previously purchased items on itunes, etc. Help?

    When setting up me new iphone - it is asking me for an iCloud password for an email address that doesnt belong to me - it is asking this info in order to retreive previously purchased items on itunes, etc. Help?

    These are a couple different issues
    The purchase issue means they came from a different Apple ID
          You will need that Apple ID and password for those purchases
    The iCloud account can be an Find My iPhone issue.
           That could be the same Apple ID as the purchased or yet another one.
                  Once again you will need that Apple ID and password.

  • Getting IP address of machine in when-new-for-instance trigger

    Hi,
    I want to get IP address of the machine which is going to use fmx file. sys_context does not work. Please help me to solve this problem.
    Thanks

    Hi,
    Did you get any error while using that in WNFI trigger? Add this to your when-new-form-instance trigger and see if you are getting the message with the IP address,
    declare
    v_ip varchar2(20);
    begin
    v_ip :=SYS_CONTEXT('USERENV','IP_ADDRESS');
    message('IP Address : ' ||v_ip);
    message(' ');
    end;If you get any error, post the error.
    -Arun

  • HT4623 I'm continually getting a pop-up message on my iPhone that asks me to enter my Apple ID password for an email address that I no longer use.  How do I get rid of it?

    I'm continually getting a pop-up message on my iPhone asking me to enter my Apple ID password for a email address I no longer use.  How do I make it stop?

    If you are signed into your current iCloud ID you shouldn't be prompted for the old ID unless there is another service still signed into it.  Check the ID in iMessage (Settings>Messages>Send & Receive), FaceTime (Settings>FaceTime), Game Center (Settings>Game Center), the iTunes store (Settings>iTunes & App Store), etc. to make sure you aren't still signed in with the old ID.  If you are, tap the ID, sign out, then sign back in with the new ID.

  • Failed to get IP address for Local Host (2) , OPMNCTL: opmn start failed

    HI,
    Hi, I have installed on Oracle 10g on Redhat Enterprise Linux V.2.1 . I was able to start OEM without any issues. Recently I had changed the static IP address and I couldn't able to start OPMNCTL and getting the following error while starting opmnctl start. error message is as follows.
    Failed to get IP address for local host(2).....
    Failed to get IP address for local host(2).....
    Failed to get IP address for local host(2).....
    my current configuration in /etc/hosts file is as follows.
    127.0.0.1 localhost.localdomain servername
    After going through some of threads available in Oracle, I have added the static IP address in the /etc/hosts but still I am getting the same error.
    my new hosts file is as follows.
    127.0.0.1 localhost.localdomain servername
    10.21.253.102 localhost.localdomain servername
    I don't know why this is looking for localhost (2). I did not set up any local host (2) and I could not see anything in my network confiuration also.
    could you please help me in this issue? I appreciate your help in this regard.
    Thanks
    venkat

    Hi, i think that the application server part is looking for a /etc/hosts entry
    in this format:
    127.0.0.1 localhost
    As i noticed, this is used for internal communication.
    Try this entry as is, without a domain...

  • Failed to get proc address for GetLogicalProcessor...

    hi everyone whenever i try to open the skype after instalation it show me this error"Failed to get proc address for GetLogicalProcessorInformation (KERNEL32.dll."please help me to solve this problem.i will be very thankfull to you for this favour.thank you.

    Hi, i think that the application server part is looking for a /etc/hosts entry
    in this format:
    127.0.0.1 localhost
    As i noticed, this is used for internal communication.
    Try this entry as is, without a domain...

Maybe you are looking for

  • Adobe Acrobat 6.0 Excel problem

    Just installed Adobe Acrobat 6.0 Standard - works okay from Word but when creating a pdf in Excel it creates a big black block over the data.  Does anyone know how to fix this problem?

  • Required to buy Tiger or later?!

    Am I the only one that thinks this is totally wrong and crooked? An Apple device not being compatible with my Apple OS?! I mean, it's not like I'm running OS 7 or anything. Panther is not an OLD operating system. One upgrade up on the iPod and sudden

  • Data comparision in 2 infocubes in 2 different systems

    Hello all, We have 2 3.0B BW systems. In both systems, there is a infocube called IC1. Now my requirement is, i have to compare the number of records, in both the cubes in 2 different BW systems. In the first BW system, we are compression/collapse th

  • Podcast Files Messed Up

    Like the rest of you, iTunes 7 screwed things up. When it scanned my files it moved all my podcasts around. Now when I download a podcast it just dumps them all into one big directory. It won't let me go back to having one directory for each podcast.

  • Loading Date fields from flat file to Oracle tables

    Hi, I have a flat file with a few date columns. I have given the format for the date field while creating the data store for the flat file. The format I used is 'YYYY-MM-DD'. But I get an error when I execute it after associating the module with LKM