How to create triggers that track client IP addresses in Oracle

Source: Internet
Author: User
Tags client

If you want the session_info in v$logmnr_contents to record client IP, in Session_info we don't see IP directly,

But we still have a way, because the contents of this session_info is actually a log from the V$session view of the extract, we can

Create a trigger to track the client IP address in the production database:

Create or Replace Trigger On_logon_trigger

After logon on database

Begin

Dbms_application_info.set_client_info (Sys_context (' Userenv ', ' ip_address '));

End

/

Now we can see the newly logged-on client IP address in the Client_info column of the V$session view. So now we can see the IP of the client in Session_info.

Select Sid,serial#,username, Program,client_info from V$session

This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.