½ñÌìÓÐÅóÓÑÔÚMSNÉÏÎÊÎÒÈçºÎ»ñµÃÒѾÁ¬½ÓÓû§µÄµØÖ·¡£
ÎÒÃÇÖªµÀ£¬Í¨¹ýSYS_CONTEXTº¯Êý¿ÉÒÔ»ñµÃÕⲿ·ÖÐÅÏ¢£¬µ±Ç°Óû§µÄipµÈÐÅÏ¢¿ÉÒÔͨ¹ýÈçÏÂÃüÁîÇáÒ×»ñÈ¡£º
SQL> select sys_context('userenv','host') from dual;
SYS_CONTEXT('USERENV','HOST')
--------------------------------------------------------------------------------
WORKGROUPGQGAI
SQL> select sys_context('userenv','ip_address') from dual;
SYS_CONTEXT('USERENV','IP_ADDR
--------------------------------------------------------------------------------
172.16.34.20
¿ÉÊÇÈç¹ûÎÒÃÇÏ£Íû»ñÈ¡ÆäËüsessionµÄµØÖ·ÐÅÏ¢µÈ£¬Í¨¹ýSYS_CONTEXTº¯Êý¾ÍÖ»ÄÜͨ¹ýLOGON´¥·¢Æ÷À´Íê³É¡£
¶øÈç¹ûûÓд¥·¢Æ÷¼Ç¼£¬ÔòÎÒÃÇ¿ÉÒÔͨ¹ýUTL_INADDR PackageÀ´ÊµÏÖ¡£
ÎÒÃÇ¿´Ò»ÏÂUTL_INADDR°ü»ñÈ¡ipµÈÐÅÏ¢µÄʵÏÖÔÀí¡£
ÎÒÃÇÔÚÊý¾Ý¿âÖнøÐÐÈçϲéѯ£º
[oracle@jumper oracle]$ sqlplus "/ as sysdba"
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Oct 25 11:24:22 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
SQL> !
[oracle@jumper oracle]$ ps -ef|grep sql
oracle 14700 14663 1 11:24 pts/0 00:00:00 sqlplus
oracle 14732 14702 0 11:24 pts/0 00:00:00 grep sql
[oracle@jumper oracle]$ ps -ef|grep LO
oracle 14701 14700 0 11:24 ? 00:00:00 oracleeygle (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 14734 14702 0 11:24 pts/0 00:00:00 grep LO
[oracle@jumper oracle]$ exit
exit
SQL> SELECT UTL_INADDR.get_host_address('www.anysql.net') from dual;
UTL_INADDR.GET_HOST_ADDRESS('WWW.ANYSQL.NET')
---------------------------------------------------------------------
208.113.151.109