ORA-12154 error when trying to connect with PHP [message #254208] |
Thu, 26 July 2007 03:01 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
aspectweaver
Messages: 3 Registered: July 2007
|
Junior Member |
|
|
Hi,
I am using Oracle 8i (8.1.7.3), PHP(5.1.1), Apache(2.0.59), Win 2000 Server. Apache and PHP is installed correctly and I can see the phpinfo() page and oci8 is loaded as well.
My problem is that I can't connect to the db. When I try to connect to the db with ocilogon(), I get the ORA-12154 TNS:could not resolve service name error.
I can login to the db using SQL*Plus and SQLDeveloper using the same SID, username and pswd as I used in my php page.
My TNSNAMES.ORA, SQLNET.ORA files are below. There are 2 different TNSNAMES.ORA files in 2 different locations on the server. One is in F:\Oracle\Ora81\Network\Admin and the other one is in C:\Orant\Network\Admin. There is only one copy of SQLNET.ORA which is located in C:\Orant\Network\Admin.
TNSNAMES.ORA #1
Example1.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = Production1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = SID1)
)
)
Example2.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = spx.world)
(PROTOCOL = SPX)
(Service = Server_lsnr)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
Example3.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = nmp.world)
(PROTOCOL = NMP)
(Server = FinanceServer1)
(Pipe = ORAPIPE)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
Tcp-loopback.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 127.0.0.1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
Beq-Local.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = beq.world)
(PROTOCOL = BEQ)
(PROGRAM = oracle73)
(ARGV0 = oracle73ORCL)
(ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
prod244.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 200.2.3.244)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 200.2.3.244)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = prod)
)
)
prod241.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 200.2.3.241)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 200.2.3.241)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = prod)
)
)
prod.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = tnpark1)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = tnpark1)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = prod)
)
)
TNSNAMES #2
PROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = TNPARK1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PROD)
)
)
SQLNET.ORA
TRACE_LEVEL_CLIENT = OFF
NAMES.DIRECTORY_PATH = (TNSNAMES)
names.default_domain = world
name.default_zone = world
names.default_domain=world
Any help would be greatly appreciated. Thanks!
[Updated on: Thu, 26 July 2007 03:44] Report message to a moderator
|
|
|
|
|