Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, fahim.

Asked: August 01, 2016 - 11:40 am UTC

Last updated: August 02, 2016 - 10:05 am UTC

Version: orcle 12c with form 6i

Viewed 10K+ times! This question is

You Asked

sir i change host name with ip address in user computer
i got server ip address by oracle command
select SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) ipaddr from dual;
result
127.0.0.1

i change this ip address with host

orcl =
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = pdborcl) ))

PDBORCL =
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = pdborcl) ) )

Rep60_MFAMDA-PC,Rep60_MFAMDA-PC.world=(ADDRESS=(PROTOCOL=tcp)(HOST=MFAMDA-PC)(PORT=1949))

then error change
now user computer give me error ora-12224 tns no listener
ora-12224 tns no listener
sir see new error

in server both 12c and form 6i run fine
but problme in user computer
when i run compiled form in user computer that give me error
ora-12224 tns no listener
regard

and Chris said...

The IP_ADDRESS USERENV context returns the IP of your machine! You need to find the IP or name of the server the database is on.

You can find the IP using utl_inaddr:

select utl_inaddr.get_host_address from dual;

Or the host name in various ways:
select host_name from v$instance;

select utl_inaddr.get_host_name from dual;

select SYS_CONTEXT('USERENV', 'SERVER_HOST') host from dual;


https://oracle-base.com/articles/misc/identifying-host-names-and-addresses

But if you've updated your TNSNAMES you can't connect! Hopefully you saved a copy before changing it you can revert to. If not, you'll have to speak to someone else in your organization to find the correct values.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Multitenant

Need more information on Multitenant? Check out the Multitenant docs for the Oracle Database