This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13033|Reply: 0

[Communication] ORALCE obtains the hostname and IP address

[Copy link]
Posted on 1/24/2015 1:05:15 PM | | |
In database application development and management, it is often necessary to obtain hostname and IP address information, which are related to environment variables and related data dictionaries

Method 1: Get it with a function SYS_CONTEXT

Use the attribute parameters SYS_CONTEXT the function to return the name and IP address of the current session host
• Terminal------------ usually refers to the name of the client
• Host---------------- the full name of the client
• ip_address--------- the IP address of the client
•server_host-------- the name of the server running the database instance
[mw_shl_code=sql,true] SELECT SYS_CONTEXT('USERENV','TERMINAL') AS 'Client Name' FROM DUAL
2
3SELECT SYS_CONTEXT('USERENV','HOST') AS 'Full Name of the Client' FROM DUAL
4
5SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') AS "Client's IP" FROM DUAL
6
7 - If there is no client connection, the result is displayed as empty
8SELECT SYS_CONTEXT('USERENV','server_host') FROM DUAL[/mw_shl_code]




Previous:SQL injection notes oracle
Next:Oracle
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com