Identifying ORACLE DB Host Name and its IP Address including client IP address (from which client is connected):
SYS_CONTEXT function returns the current session information:
There are various ways to find db name to which connection is made are as follows:
select sys_context('userenv','db_name') from dual;
select ora_database_name from dual;
select global_name from global_name;
select sys_context('USERENV','IP_ADDRESS' ) FROM DUAL;
-- returns the IP address of client machine from which connection is established
few more..
select USERENV('LANGUAGE') ,
USERENV('ISDBA') from dual;
..etc..
We can find local and remote hosts information using UTL_INADDR package in oracle 10g.
more info just type desc UTL_INADDR
SELECT UTL_INADDR.get_host_address from dual;
-- returns the IP address of database physical system
there is lot more info we can find with UTL_INADDR and SYS_CONTEXT.
... cheers...
15 years 3 months + of experience in database administration, performance engineering and software cost optimization. Expert in architecture of large scale product, service features in product developments and several POCs executions. Specialty in Database administration, Database Performance, SQL, PLSQL, Shell, Simple solutions for Designing Performance engineering solutions, actively working on Software Cost Optimization in CLOUD. Always ready for new challenges with simple solutions
Tuesday, June 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment