Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PHP, ODBC and ORACLE
"Prostetnic Vogon Jeltz" <taskovskig_at_gmx.net> a écrit dans le message de
news:418cc1f4_at_news.mt.net.mk...
>
> I can not conect to remote Oracle DB using EasySoft's ODBC for Oracle package.
> I just keep ending with:
>
> $ islq ORACLE -v
> [unixODBC][Easysoft][Oracle]ORA-12154: TNS:could not resolve service name
>
> [ISQL]ERROR: Could not SQLConnect
>
> Same thing happens when I connect using PHP4 script which is I want to do
> at the end :)
> I can without any problem connect and retrieve data from the same database
> via Perl's DBD::Oracle module using the same host, sid combination as it
> is in /etc/odbc.ini file.
>
> Here are the relevant files:
> =========================================
> /etc/odbcinst.ini
> ---------------------
> [ORACLE]
> Description = Easysoft ODBC Oracle Driver
> Driver = /usr/local/easysoft/oracle/libesoracle.so
> Setup = /usr/local/easysoft/oracle/libesoraclesetup.so
> FileUsage = 1
>
> -----------------------
> /etc/odbc.ini
> -----------------------
> [ORACLE]
> Driver = ORACLE
> Database = omdb
> Host = xxx.xxx.xxx.xxx
> ServerType = Oracle 8
> SID = yyy
> Port = 1521
> User = user
> Password = pass
> METADATA_ID = 0
> ENABLE_USER_CATALOG = 1
> ENABLE_SYNONYMS = 1
>
> ----------------------------------------------------------
> /home/oracle/8.1.7/network/admin/tnsnames.ora
> ----------------------------------------------------------
> omdb =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.3.36)(PORT = 1521))
> )
> (CONNECT_DATA =
> (SID = omdb)
> )
> )
>
> I am using Debian GNU/Linux (unstable), Oracle 8.1.7 client/server (The server
> is on Solaris machine). In case anypne can not provide an answer, please
> write some hints on connecting to the database server using PHP from the
> Debian machine via ODBC.
>
> Thanks in advance
TNS-12154 TNS:could not resolve service name Cause: The service name specified is not defined correctly in the TNSNAMES.ORA file. Action: Make the following checks and correct the error: Verify that a TNSNAMES.ORA file exists and is in the proper place and accessible. See the operating system specific manual for details on the required name and location. Check to see that the service name exists in one of the TNSNAMES.ORA files and add it if necessary. Make sure there are no syntax errors anywhere in the file. Particularly look for unmatched parentheses or stray characters. Any error in a TNSNAMES.ORA file makes it unusable. See the Oracle9i Net Services Administrator's Guide. If possible, regenerate the configuration files using the Oracle Network Manager.
-- Regards Michel CadotReceived on Sat Nov 06 2004 - 09:28:39 CST
![]() |
![]() |