Re: FW: Oracle connectivity question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You'll need to verify that you have the tnsnames.ora file in 
$ORACLE_HOME/network/admin setup correctly.

Example: /opt/oracle/product/9.2.0/network/admin/tnsnames.ora

Some versions want 'SID' instead of 'SERVICE_NAME' in the 'CONNECT_DATA'

Example: 
DB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = db1)
    )
  )

Ensure the listener is running on the database server with:
  tnsping <address>

Example (good):
$ tnsping 10.1.9.2

TNS Ping Utility for Linux: Version 9.2.0.1.0 - Production on 18-DEC-2002 
16:42:34

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/opt/oracle/product/9.2.0/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact 
(DESCRIPTION=(CONNECT_DATA=(SID=*)(SERVICE_NAME=10.1.9.2))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.9.2)(PORT=1521)))
OK (130 msec)

Example (bad):
$ tnsping 10.1.9.1

TNS Ping Utility for Linux: Version 9.2.0.1.0 - Production on 18-DEC-2002 
16:43:14

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/opt/oracle/product/9.2.0/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact 
(DESCRIPTION=(CONNECT_DATA=(SID=*)(SERVICE_NAME=10.1.9.1))(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.9.1)(PORT=1521)))
TNS-12541: TNS:no listener

John 'zariok' Draughn
Jabber: zariok@jabber.org


Scott V Nipp wrote:

> More information on the problem...  I tried including the SID in the
> OCILogon function and think that I may have gotten a bit further, but
> still
> not a successful logon.  Here is the error I am now receiving with the
> SID:
> 
> Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> in /www/DW/oratest.php on line 11
> Unable to logon to database.
> Thanks agian.
> 
>>  -----Original Message-----
>> From:        NIPP, SCOTT V (SBCSI)
>> Sent:        Wednesday, December 18, 2002 10:30 AM
>> To:  'php-db@lists.php.net'
>> Subject:     Oracle connectivity question...
>> 
>> OK.  I think I now have Oracle support built into PHP/Apache.  The
>> biggest hiccup for HP-UX seems to be that once you add Oracle support to
>> PHP, you CANNOT built PHP as a DSO, PHP MUST be compiled into Apache.
>> Once again, I think this is the case, I am still not completely sure at
>> this point.
>> 
>> I am now receiving an error on trying to connect to the Oracle
>> database that I do not understand, but leads me to believe that the PHP
>> Oracle support is functioning.  Here is the code I am attempting:
>> 
>> <?php
>> $connection = OCILogon("userid", "password") or die ("Unable to logon to
>> database.");
>> # phpinfo();
>> ?>
>> 
>> Here is the error I am receiving:
>> 
>> Warning: OCISessionBegin: ORA-01034: ORACLE not available in
>> /www/DW/oratest.php on line 10
>> Unable to logon to database.
>> The code I am attempting is simply to verify successful connectivity
>> to the database.  I know that this doesn't really do anything, but I am
>> trying this simply to test for a successful connection.  Please let me
>> know if you have any ideas or suggestions.  Thanks again.
>> 
>> Scott Nipp
>> Phone:  (214) 858-1289
>> E-mail:  sn4265@sbc.com
>> Web:  http:\\ldsa.sbcld.sbc.com
>> 
>>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux