Re: Can't login remote oracle server? HELP!
| From: | thies at digicol dot de | Date: | Fri, 28 Jul 2000 14:48:39 +0000 |
| Subject: | Re: Can't login remote oracle server? HELP! | ||
| References: | 1 | Groups: | php.dev php.general |
| Request: | Send a blank email to php-dev+get-26721@lists.php.net to get a copy of this message | ||
On Fri, Jul 28, 2000 at 04:44:47PM +0200, MEGRET Arnaud wrote:
>
> Hi,
>
> Sorry to answer so late to this message. But I have a very similar problem.
> I have noticed that the third parameter of OCIlogon is not the entry in
> tnsnames.ora but the name of the host where the server is.
> In your case , you should try
> ociplogon("scott","tiger","db.host.com");
> you can also try the IP address of your oracle server.
>
> I don't know how it is possible to refer to the tnsname.ora file.
> Documentation seems totally wrong!!
> Is there someone who know if new version of the OCI interface is coming or
> if there is somewhere we can find a real documentation about this
> version?????????
the 3th parameter is the db-name as defined in tnsnames.ora.
so if you can say:
sqlplus user/pw@db
you can also say:
$c = ocilogon("user","pw","db");
that's it.
tc
>
> Thanks
>
> Arnaud
>
>
> > -----Message d'origine-----
> > De: Rasmus Lerdorf [SMTP:rasmus@php.net]
> > Date: mercredi 12 juillet 2000 08:25
> > À: lhf
> > Cc: php-general@lists.php.net; php-dev@lists.php.net
> > Objet: Re: [PHP] Can't login remote oracle server? HELP!
> >
> > Try ocilogon("scott","tiger","net")
> >
> > On Wed, 12 Jul 2000, lhf wrote:
> >
> > > The last message is too slow,send,again
> > >
> > > Who sucefully link to the remote oracle server using php?
> > > I can't run it!
> > > Please help me!
> > > Thanks in advance
> > >
> > >
> > > --------------------------------------------------------------
> > > php 4.0.1pl2
> > > oracle 8i
> > > web server: NES 3.6
> > > os :Solaris 2.6
> > >
> > > Oracle is resident at another server,its sid is 'webdb' and
> > > service name is 'net.db.host.com'
> > >
> > > I set up oracle 8i client on the web server,and configure the
> > > netec which test ok.
> > >
> > > When I use tnsping and sqlplus,all works well,
> > > for example:
> > > tnsping net
> > > tnsping db
> > > tnsping db.host.com
> > > sqlpus scott/tiger@net
> > >
> > > But when I use php4 with oci8 support,all don't work!
> > >
> > > This is the example code and error message:
> > > source code:
> > > ----------------------------------------------------
> > > <?
> > > putenv("ORACLE_SID=webdb");
> > > putenv("ORACLE_HOME=/data/oracle/app/8.1.5");
> > > putenv("NLS_LANG=american.america.US7ASCII");
> > >
> > > $conn = OCIpLogon("scott/tiger@net.db.host.com","");
> > > if(!$conn)$conn=OCIpLogon("scott/tiger@webdb","");
> > > if(!$conn)$conn=OCIpLogon("scott/tiger@net","");
> > >
> > > if(!$conn)$conn=OCIpLogon("scott@net.db.host.com","tiger");
> > > if(!$conn)$conn=OCIpLogon("scott@webdb","tiger");
> > > if(!$conn)$conn=OCIpLogon("scott@net","tiger");
> > >
> > >
> > > if(!$conn)$conn=OCIpLogon("scott","tiger","net.db.host.com");
> > > if(!$conn)$conn=OCIpLogon("scott","tiger","webdb");
> > > if(!$conn)$conn=OCIpLogon("scott","tiger","net");
> > >
> > > if($conn)
> > > echo "sucessful!";
> > > else
> > > echo "<font color=red>Connect to database failed!";
> > >
> > > ?>
> > > ---------------------------------------------------------------
> > > The error message :
> > > ----------------------------------------------------------------
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 6
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 7
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 8
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 10
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 11
> > >
> > > Warning: _oci_open_server: ORA-12545: Connect failed because target host
> > or
> > > object does not exist in /data/php/z.php on line 12
> > >
> > > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> > in
> > > /data/php/z.php on line 14
> > >
> > > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> > in
> > > /data/php/z.php on line 15
> > >
> > > Warning: _oci_open_server: ORA-12154: TNS:could not resolve service name
> > in
> > > /data/php/z.php on line 16
> > >
> > > Connect to database failed!
> > > ---------------------------------------------------------------------
> > >
> > > This is the tnsnames.ora file on web server
> > > ---------------------------------------------------------------------
> > > # TNSNAMES.ORA Configuration
> > > File:/data/oracle/app/8.1.5/network/admin/tnsnames.ora
> > > # Generated by Oracle Net8 Assistant
> > >
> > > NET =
> > > (DESCRIPTION =
> > > (ADDRESS_LIST =
> > > (ADDRESS = (PROTOCOL = TCP)(HOST = db.host.com)(PORT = 1521))
> > > )
> > > (CONNECT_DATA =
> > > (SERVICE_NAME = net.db.host.com)
> > > )
> > > )
> > >
> > > --------------------------------------------------------------------
> > >
> > > This is the listener.ora on the oracle server
> > > --------------------------------------------------------------------
> > > # LISTENER.ORA Configuration File:/oracle/app/8.1.5/network/admin/liste
> > > # Generated by Oracle Net8 Assistant
> > >
> > > LISTENER =
> > > (DESCRIPTION_LIST =
> > > (DESCRIPTION =
> > > (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
> > > (PROTOCOL_STACK =
> > > (PRESENTATION = TTC)
> > > (SESSION = NS)
> > > )
> > > )
> > > (DESCRIPTION =
> > > (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.13)(PORT = 2481))
> > > (PROTOCOL_STACK =
> > > (PRESENTATION = GIOP)
> > > (SESSION = RAW)
> > > )
> > > )
> > > (DESCRIPTION =
> > > (ADDRESS = (PROTOCOL = TCP)(HOST = db.host.com)(PORT = 1521))
> > > (PROTOCOL_STACK =
> > > (PRESENTATION = TTC)
> > > (SESSION = NS)
> > > )
> > > )
> > > )
> > >
> > > SID_LIST_LISTENER =
> > > (SID_LIST =
> > > (SID_DESC =
> > > (SID_NAME = PLSExtProc)
> > > (ORACLE_HOME = /oracle/app/8.1.5)
> > > (PROGRAM = extproc)
> > > )
> > > (SID_DESC =
> > > (GLOBAL_DBNAME = net.db.host.com)
> > > (ORACLE_HOME = /oracle/app/8.1.5)
> > > (SID_NAME = webdb)
> > > )
> > > )
> > > ----------------------------------------------------------
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany