简体   繁体   中英

Oracle 11 instant client connect to remote Oracle 8i server: ORA-12514 error

I encountered a problem that I have spent hours fixing that. Here is the problem:

I am trying to connect to a remote Oracle 8i server using Oracle 11 instant client : here is my connection string in PHP:

$conn = oci_connect('db_user', 'db_pass', "db_ip/db_service");

db_ip is the ip of the server, such as "12.34.56.78".
db_service is the service of server, such as "test".

The error shown is

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I could use the same client to connect to another Oracle 10g server. The php code is same, only change the db_user or db_pass or db_ip. db_service is not provided.

I don't use tnsnames.ora for either oracle 10g server or oracle 8i server. I just use the simple IP of server. Does this matter?

Server using: Windows Server 2008 R2
PHP: php 5.2.17
Oracle Instant Client: 11_2

Any ideas will be appreciated.

Updated Php can also work now. My php folder is under Programfiles (x86), the parenthesis is not allowed. So I moved the whole folder to C:\\php, and configure the IIS to change php version. Reference:http://stackoverflow.com/questions/9215983/php-cant-connect-but-sqlplus-can

Updated Thanks so much for Justin's help. It works!!! I just changed the sid to scblive instead of SCBLIVE. Their database name is scblive. I am still using 10.2.0.1, using sqlplus, I can connect to both oracle 10g and oracle 8i. Thanks soooo much!!

This is the tns names that works for oracle 8i:

scblive = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = [oracle 8i ip])(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = scblive) ) )

Another problem found, in php code, it shows the same error for either oracle 10g or oracle 8i.

ORA-12154: TNS:could not resolve the connect identifier specified

I just used following connection string:

$conn = oci_connect('user_name', 'pass', 'scblive');

for oracle 10g, if I used same connection string as before, the error still shows:

$conn = oci_connect('user_name', 'pass', [oracle 10g ip]);

Any ideas?

Earilier Update : Thanks for @Justin's help. have tried 10.2.0.5, 10.2.0.4 or 10.1.0.0, none of them could work. I saw the the matrix. it seems instant client 8.1.7 or instant client 9.0.1 could work for both oracle 10g and oracle 8i. Does anyone have a link for those files? Oracle could only provide 10.1.0.5 and later.

This is expected behavior. The 11.2 client is not certified to connect with any version of Oracle 8i. You would need to have at least an Oracle 9.2.0.4 database. If you want to connect with and 8.1.7 database, you would need an Oracle 10.2 or earlier client. The initial versions of the 10.2 client were not compatible with a Windows Server 2008 R2 system but it should be possible to install the 10.2.0.5 client patchset. If you want to connect to an Oracle database that is earlier than 8.1.7, you would need an earlier version of the Oracle client which would probably require installing an earlier version of Windows.

If you have Metalink access, Metalink 207303.1 is the Client/ Server Interoperability Matrix .

If you really have the 10.2.0.5 full client installed, your TNS alias needs to use a SID. Service names didn't exist back in 8.1.7. You probably want to copy a TNS alias from a machine that is able to connect to the 8.1.7 database. My guess is that you want

SCBLIVE = 
  (DESCRIPTION = 
    (ADDRESS = (PROTOCOL = TCP)(HOST = [ORACLE 8i IP])(PORT = 1521)) 
    (CONNECT_DATA = (SERVER = DEDICATED)(SID = SCBLIVE)) 
  )

If that doesn't work, at a command line, type tnsping scblive and copy and paste the results.

I copy my previous Oracle 9/8 client's ora.... folder and all relevant dll to a specific folder and put these two folders into path variable. At a time, I succeed to connecting with Oracle 8.1.7 using oci in php.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM