Utl_inaddr.get_host_name

Hi,
The following query can run on 9i successfully, but it gave error on 8i that wrong number of argument call.
How should we run the following query on 8.1.7?
Or what its replacement?
select utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')) from dual;
Regards
Bill

select utl_inaddr.get_host_name() from dual;
The 8i version of utl_inaddr.get_host_name takes no parameters.

Similar Messages

  • 12c Cloud Control installtion issue (on Windows 7-64 bit)

    Hello,
    I am trying to install 12c Cloud Control on my personal computer Windows 7 (64-bit) OS for practice purpose. The database setup has been fine and the creation of pluggable database has been successful post which we need to install the cloud control setup. There is an issue at "Step 6 of 9" where we are required to provide the database Configuration Details. The details are: Database Host Name, Port, SID, SYS password. After providing these details it shows the following error:
    "There was a problem connecting to the database on the host and port specified. Check to make sure the host is up or that the database listener is running on that host."
    My understanding is:
    Database Host Name: it is the fully qualified name of my computer, which in my case is "SRIDHAR-PC".
    I ran the following script and it confirmed the same: [quote]DBMS_OUTPUT.PUT_LINE()UTL_INADDR.GET_HOST_NAME[/quote]
    Port: the default port "1521" that I have provided and which I have not configured anywhere during installation. So it is the default one.
    SID: The SID of the pluggable database being asked and. In this case it is "PLUGDB"
    SYS password: The password of the sys account.
    How do I resolve this error?

    I am sorry for having asked this question outside the forum that I am supposed to for the issue. Progressing further on the issue, yes I have tried connecting them using the credentials and it succeeds connecting the database. On digging further I found that I have been installing the 12c Cloud Control setup on 12c database with pluggable-container database architecture, unfortunately which the 12c Cloud Control EM does not support to be installed on. To install the 12c EM Cloud Control we need to install it on either of the two databases:
    1) A pre-12c instance, i.e. 11g database (OR)
    2) 12c database installed as a regular installation (as we install the 11g DB) which is not installed as a container-pluggable database combination (This option needs to be selected at the time of database installation).
    Oracle can support monitoring the databases which contain the container-pluggable database structure along with the single instance and RAC architecture, but to install the EM Cloud Control setup, it cannot be installed on DB's which consists container-pluggable structure.

  • How to get Database name/IP address of the database server from forms10g

    Hi everybody,
    How do I get the database instance name and IP address of the database server?
    I am using Foms 10g and the database server is Oracle 10g.
    Sukanta

    Dear...........
    Plz use this code
    select SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) ipaddr from dual;
    SELECT utl_inaddr.get_host_address IP ,UTL_INADDR.get_host_name NAME FROM dual;
    select SYS_CONTEXT('USERENV', 'HOST') HELLO from dual;
    select SYS_CONTEXT('USERENV', 'TERMINAL') HELLO from dual;
    select SYS_CONTEXT('USERENV', 'OS_USER') HELLO from dual;
    SELECT SYS_CONTEXT ('USERENV', 'SESSION_USER') FROM DUAL;
    SELECT SYS_CONTEXT ('USERENV', 'DB_UNIQUE_NAME') FROM DUAL;
    thx.

  • I would like to ask how to retrieve Sever/Host IP address.

    Hello,
    I would like to ask how to retrieve Sever/Host IP address.
    sys_context('USERENV', 'IP_ADDRESS') returns client's IP address only, but what I want to acquire is Host/Server IP address
    Thank you

    This is why it is generally useful to mention the version of Oracle you are using, particularly if you are using a version 4 releases old...
    That said, you can probably still use the UTL_INADDR package
    SQL> select utl_inaddr.get_host_name( null ) from dual;
    UTL_INADDR.GET_HOST_NAME(NULL)
    DDBCJC01
    SQL> select utl_inaddr.get_host_address( null ) from dual;
    UTL_INADDR.GET_HOST_ADDRESS(NULL)
    192.168.1.107Justin
    Edited by: Justin Cave on Sep 29, 2008 10:54 PM

  • How to get database server IP address?

    I have Php backend website, where i have a text area to run sql queries against underlying Oracle 10g/solaris database.
    I have ca 10 such Backend web sites, and 10 underlying Oracle databases for each website. Each Backend website lives different computer than Backend Php webserver.
    I have problems to understand what is the database IP of the Backend website.
    Can i query it?
    My example wrong queries:
    I know that underlying database in this example is with IP "192.168.2.165", but i canät manage to query that out, see:
    This is not the database IP:
    select UTL_INADDR.GET_HOST_ADDRESS from dual--127.0.0.1
    This is some mysterical computer name that i cant ping:
    select UTL_INADDR.GET_HOST_NAME from dual;--tar_071_z
    This is wrong IP:
    select UTL_INADDR.GET_HOST_ADDRESS('tar_071_z') from dual;--127.0.0.1
    Wrong:
    select UTL_INADDR.GET_HOST_ADDRESS( UTL_INADDR.GET_HOST_NAME ) from dual;--127.0.0.1
    I don't know what IP is that:
    select sys_context('USERENV','IP_ADDRESS') from dual;--192.168.2.160
    My php-website i run queries in this example:
    C:\Users\charlesr>ping myphpbackend.com
    Pinging admin.live.casino.playtech.com [192.168.2.160] with 32 bytes of data:
    Reply from 192.168.2.160: bytes=32 time=17ms TTL=252
    Reply from 192.168.2.160: bytes=32 time=9ms TTL=252
    Reply from 192.168.2.160: bytes=32 time=6ms TTL=252
    Reply from 192.168.2.160: bytes=32 time=7ms TTL=252
    Ping statistics for 192.168.2.160:
        Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 6ms, Maximum = 17ms, Average = 9ms
    C:\Users\charlesr>
    C:\Users\charlesr>ping tar_071_z
    Ping request could not find host tar_071_z. Please check the name and try again.
    If i type Into my Windows 7 File Explorer address "\\tar_071_z" then it says it doesn't find the computer.
    C:\Users\charlesr>ipconfig
    Windows IP Configuration
    Ethernet adapter Local Area Connection:
       Connection-specific DNS Suffix  . : videobet.corp
       Link-local IPv6 Address . . . . . : fe80::702d:f154:fb5e:5c20%11
       IPv4 Address. . . . . . . . . . . : 192.168.15.105
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.15.1
    Tunnel adapter isatap.videobet.corp:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . : videobet.corp
    Tunnel adapter Teredo Tunneling Pseudo-Interface:
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
    C:\Users\charlesr>Edited by: CharlesRoos on 1.06.2011 10:59

    user8950100 wrote:
    try this:
    select sys_context('USERENV','IP_ADDRESS') from dual;That would give you the client ip address, not the server.
    on a side note: working with IP address's is not advisable in large complex systems, should always try to use the hostname that way if IP address is changed does not impact the application conectivity....Why would you need the IP address of the database server anyway?
    Each database should have a unique name, use that instead.
    sql> select ora_database_name from dual;
    ORA_DATABASE_NAME
    xxxx.xx.xxx.xxx.xx(database name mangled to protect the innocent)

  • Merge statement not working over db link

    I have a merge statement that works fine when it's run against a local table, but when I try to run it against a table over a database link, I get the following error.
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-02063: preceding line from REPOS
    ORA-06512: at "DBADMIN.PING_DB", line 6
    ORA-06512: at line 1
    Here is the code:
    create or replace procedure ping_db
    as
    begin
    merge into availability@repos A
    using (select trunc(sysdate) from dual)
    on (trunc(A.day) = trunc(sysdate))
    when matched then update set A.uptime = A.uptime + 1
    when not matched then insert (hostname,dbname,day,uptime) values
    (utl_inaddr.get_host_name,sys.database_name,trunc(sysdate),1);
    commit;
    end;
    /Code compiles fine, but gets the error when it's executed. Any help would be appreciated.

    9.2.0.x is the version (9.2.0.4,.5 and .6)

  • Display users IP Address

    How can I display the IP address of the user in APEX?
    Is there any way to avoid displaying just the Proxy's IP address?
    Btw - I searched the forum and found this select statement:
    select utl_inaddr.get_host_name(OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR')) hostname from dual;
    but this one is giving me a ORA-06502: PL/SQL: numeric or value error Error - what is the reason for that?
    Thank you!

    Hello,
    Does select utl_inaddr.get_host_address() hostname from dual; return the value you want?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • ACL denied using Pkb but works using anonymous block with same user

    I have a recent 11g installation with a developer that is getting a access denied message when using a package but is able to run the same code manually in sqlplus and it works.
    eg. I have granted access to connect and resolve to the user BLAH.
    from sqlplus, BLAH can do
    select trim(substr(utl_inaddr.get_host_name,1,30)) from dual;
    TRIM(SUBSTR(UTL_INADDR.GET_HOST_NAME,1,30))
    serverhostname
    and get the hostname successfully, but this same line in a pkb fails when called like so
    exec func_name.something()
    BEGIN func_name.something(); END;
    ERROR at line 1:
    ORA-24247: network access denied by access control list (ACL)
    ORA-06512: at "SYS.UTL_INADDR", line 4
    ORA-06512: at "SYS.UTL_INADDR", line 35
    ORA-06512: at line 1
    ORA-06512: at "BLAH.FUNC_NAME", line 83
    ORA-06512: at line 1
    but if you were to do this same bit of code in sqlplus as follows:
    set serveroutput on
    declare
    mhost varchar(30);
    begin
    select trim(substr(utl_inaddr.get_host_name,1,30)) into mhost
    from dual;
    dbms_output.put_line(mhost);
    end;
    it works.
    I do not understand this at all. This is the same user account that owns the pkb and is running it in sqlplus. The user has been granted the connect and resolve priv through being granted a role that has this permission.
    Can anyone help me out here?

    Thanks, the oracle logic behind this doesn't make sense to me - if the user can do this action, then surely the user should be able to run the package...
    Anyway, I will try to grant directly to the user that needs the privs, but then how do I grant this privilege to multiple users, it's some awkward bit of pl/sql just to grant it to one user.
    Here is what I did:
    dbms_network_acl_admin.create_acl(acl => 'filename.xml',
    description => 'Network permissions for BLAH_USER to connect/resolve any host',
    principal => 'BLAH_USER', is_grant => TRUE, privilege => 'connect');
    dbms_network_acl_admin.add_privilege(acl => 'filename.xml', principal => 'BLAH_USER', is_grant => TRUE, privilege => 'resolve');
    dbms_network_acl_admin.assign_acl(acl => 'filename.xml', host => '*');
    grant execute on dbms_network_acl_admin to BLAH_USER;
    but this only works for 1 user and I cannot recreate this as the acl now already exists. Would I have to change filename.xml every time and do all these steps for every user?
    This is why I granted to a role and then granted that role to the BLAH_USER originally.
    Any ideas on how to make this scalable to many users or to add users to this ACL?

  • Get Terminal ID / IP

    Hi ALl
    Please let me know how to get Client Pc Name & IP address via Oracle froms.
    Thanking you
    Regards
    Lakmal

    These queries will work but if i remember accurately it will return u the servers id so check it out.
    select utl_inaddr.get_host_address from dual;
    select utl_inaddr.get_host_name from dual;
    select sys_context( 'userenv', 'ip_address' ) x from dual ;
    select sys_context( 'userenv', 'host' ) x
    from dual
    To the get to the client side u can use WinAPI also in the forms also.

  • Nslookup within an app

    i have a table that contains ip addresses from an ids system. it would make life easier if I could resolve these addresses in a report. has anyone done something like this w/ 1.6 (10g)?
    if not, any suggestions of where i might start researching would be appreciated.
    thanks!

    Leonard,
    You might be able to use UTL_INADDR.get_host_name (a built-in package)to do it but it may need to have a DNS cache locally to get a decent response time. If you have a lot of addresses to resolve then it could take a while if you don't have very fast response from your DNS or hosts file.
    Greg

  • Webutil_clientinfo.get_host_name

    I am using Dev 11.
    I need to open outlook from an JSF form and in turn open an item in outlook whose id (Hex DEC) is stored in a table. This we have achieved in oracle forms using webutil. To achieve it in JSF page we would require the following things, which we don't know in JSF.
    a) Get the host name of the client machine (webutil_clientinfo.get_host_name ; --> webutil command in oracle forms).
    b) Run a command prompt from the backing bean (webutil_host.nonblocking(DOS_CMD) --> webutil command in oracle forms)
    thanks
    regards
    Sanjay

    Sanjay,
    Point (b) - you are going to be "out of luck" - you aren't going to be able to open an executable on the client (where the browser is) from a backing bean (which is running on the server).
    For point (a) - you can get the client hostname by this:
    FacesContext.getCurrentInstance().getExternalContext().getRequest().getRemoteHost()John

  • Strange problem using webutil "WEBUTIL_CLIENTINFO.GET_HOST_NAME"

    in a form in with a use (and work fine) some function of webutil (like client_get_file_name etc) i have try to use this function :
    :B0.HOST_NAME := WEBUTIL_CLIENTINFO.GET_HOST_NAME;
    where b0.host_name is a char filed of 256.
    when i try to execute this forms dons not work this lasty function and appear this error :
    wuc-015 your form must contain the following BEAN : getclient info ???
    i don't understan why ??
    in the same form all other function of webutil works fine, only this ??
    a solution ???

    I've got it
    quotation from the Webutil install guide:
    the Form has instantiated the WebUtil PJCs. This means that you cannot call WebUtil
    functions before the Forms UI is rendered. This would include triggers such as PREFORM,
    WHEN-NEW-FORM-INSTANCE and WHEN-NEW-BLOCK-INSTANCE for
    the first block in the Form.
    Likewise you cannot call functions after the UI has been destroyed for instance in POSTFORM.
    If you do need to use WebUtil at Forms startup, it is recommended that you create a timer
    with a short duration (say 1ms) in your When-New-Form-Instance trigger, then make the
    WebUtil call in a When-Timer-Expired trigger.
    Francois

  • Alternative for UTL_INADDR.GET_HOST_ADDRESS

    Hi,
    Please help me on this below. Right now we are using below query to find the MAC address
    SELECT UTL_INADDR.GET_HOST_ADDRESS
    FROM dualIs there any other option to find MAC address instead of UTL_INADDR.GET_HOST_ADDRESS.

    ganex27lin wrote:
    Hi,
    Please help me on this below. Right now we are using below query to find the MAC address
    SELECT UTL_INADDR.GET_HOST_ADDRESS
    FROM dual
    This returns a dotted IP address. Not a MAC address.
    Is there any other option to find MAC address instead of UTL_INADDR.GET_HOST_ADDRESS.No. And there is no reason for dealing with MAC addresses in user code - unless it is passed as data (e.g. reading a tcpdump file).
    MACs are for use lower down the ISO model. Using it for security purposes at the application layer and user-land code, is not sensible.
    What requirement are you trying to address by using MAC addresses in PL/SQ code?

  • Why I am getting ORA-29257 while running a get ipaddress query?

    Friends,
    The query:
    select machine,utl_inaddr.get_host_address(machine) from v$session where username is not null
    Result:
    Error at line 1:
    ORA-29257
    host bmc01\beating
    How can i resolve this error?
    Thanks & Regards
    Sathyguy

    The machine name is unknown to the Database server. To see if this is the problem try adding that machine in hosts file.

  • Details of users who have logged into the application

    I have installed oracle 10g Forms and services and oracle database 10g in the server.The users will run the application from the client machine. I want to know how many users are accessing the application and their ip address .
    Please let me know.
    Thanks.

    Hi
    Try this Code.
    SELECT MACHINE, OSUSER, TERMINAL, UTL_INADDR.GET_HOST_ADDRESS(TERMINAL) IP_ADDRESS FROM V$SESSION WHERE STATUS = 'ACTIVE'If you want to get the details of all users including Disconnected users, then use the following query
    SELECT MACHINE, OSUSER, TERMINAL, UTL_INADDR.GET_HOST_ADDRESS(TERMINAL) IP_ADDRESS FROM V$SESSION WHERE NVL(TERMINAL, ' ') <> 'UNKNOWN'Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.
    Edited by: Manu. on Aug 4, 2009 10:09 AM

Maybe you are looking for

  • UUT Result log in SQL database?

    Hello All I am facing a requirement where i want to log results of sequence execution[only the complete seq result and NOT step results] to SQL database BUT as and when the UUT_ID varies the entry should be made into a new column with the same name a

  • Customizing wrong SharePoint translation

    Hi, We are using SharePoint 2013 with a Dutch language pack installed. When multiple users "Like" a post in a social newsfeed, SharePoint translates "Henk and 2 others like this" to the dutch translation of "Henk and 2 others look like this", it's a

  • Multiple currencies per entity in data form

    Is it possible to disable users changing currency code in data forms with "Allow multiple currencies per entity" option? I want users can see currency code for cell in data form, but can't change it.

  • Can The Apple Authorized Service Providers repair iPhone an ipad hardware directly?

    It's not clear if AASP can directly operate on iPhone and ipad hardware or they simply change broken devices with refurbished ones (like Retail stores). Thank you

  • IWeb and cloud options

    Hi, I'm a longtime iWeb user. But I'm frustrated at the lack of progress with this product. Apple seems reluctant to do much (or I haven't heard of new updates for a long time) so I'm seeking an alternative that is cloud-based. Would you mind throwin