Question about Oracle and sqlplus
Martin McCormick
martin at dc.cis.okstate.edu
Fri Sep 25 02:10:34 UTC 2009
Derek Broughton writes:
> Steve Flynn wrote:
>
> > I thing you want something along the lines of
> >
> > cartoon_sounds =
> > (DESCRIPTION =
> > (ADDRESS_LIST =
> > (ADDRESS = (PROTOCOL = TCP)(HOST = dbhost.it.okstate.edu)(PORT =
> > 1521))
> > )
> > (CONNECT_DATA =
> > (SERVICE_NAME = the service name on the database you're
> > attemtping to connect to. Your DBA should be able to tell you this.)
> > )
> > )
> >
>
> Looks right _iff_ he has a TNS listener - and I don't think he does unless
> he's actually installed the full Oracle database (oracle-xe IS available
> from Oracle as a .deb). On my own system, I usually find it easier to
> connect to explicit connection strings: ie, practically anywhere that you
> can specify a SID or SERVICE_NAME, you can also specify the DESCRIPTION=()
> string given above.
First, thank you to both of you for responding. One of the
things I noticed when using strace to see what files were being
read after calling sqlplus was that there is often-times a file
called tnsnames.ora which sqlplus opens but which, in this case
is never accessed unless maybe sqlplus doesn't open it until
later.
I do not have anything more than the instantclient suite
of programs and libraries. When I try
sqlplus /NOLOG, I am in the sqlplus shell with the > prompt so I
don't think anything is broken except my understanding which is
ever so slowly dawning. My boss wishes it would dawn a little
faster, but he has been very patient which, in some ways is more
frustrating when you want to make things work and they just
aren't there yet.
Eventually, I will be running a script that looks like:
<?php
//open connection to database
$conn = oci_connect("cartoon_sounds", "SHSHSH_PASSWORD",
"DBHOST.OKSTATE.EDU");
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}
?>
I suspect that in sqlplus, the commands may look a bit
different that accomplish this test as we are not accessing it
via php.
Martin McCormick
More information about the ubuntu-users
mailing list