In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.