In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to use the client_info field in the v$session view to track the client IP address, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.
You cannot get the client IP directly from v$session by default, and you need to execute the dbms_application_info.set_client_info stored procedure to record the IP address of the login data terminal in the client_info field.
You can use the following methods to create triggers to accomplish the function of automatically recording IP addresses:
Create or replace trigger login_on_record_ip
After logon on database
Begin
Dbms_application_info.set_client_info (sys_context ('userenv',' ip_address'))
End
/
Experiment:
1. Use the terminal to remotely log in to the database as the SCOTT user and query the client_info field in the v$session view.
SQL > select sid,serial#,username,terminal,client_info from v$session where username='SCOTT'
SID SERIAL# USERNAME TERMINAL CLIENT_INFO
54 62937 SCOTT SAM_DBA
two。 Execute create trigger
SQL > create or replace trigger login_on_record_ip
2 after logon on database
3 begin
4 dbms_application_info.set_client_info (sys_context ('userenv',' ip_address'))
5 end
6 /
Trigger created.
3. Disconnect the SCOTT user, use the terminal again to remotely log in to the database as the SCOTT user, and query the client_info field in the v$session view.
SQL > select sid,serial#,username,terminal,client_info from v$session where username='SCOTT'
SID SERIAL# USERNAME TERMINAL CLIENT_INFO
54 62945 SCOTT SAM_DBA 192.168.10.2
At this point, you can look at the CLIENT_INFO column in the V$SESSION view to see the client IP address of the new login.
Thank you for reading this article carefully. I hope the article "how to use the client_info field in the v$session view to track the client IP address" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.