Isn't it specified in your tnsnames.ora?  I'm not familiar with a way to
specify a port to sqlplus.  I thought it just pulled it from tnsnames.ora.
If you can connect using sqlplus as:
$ sqlplus scott/tiger@test
then I think
$dbh = DBI->connect('dbi:Oracle:test','scott','tiger');
should work.  The oracle client libs should handle the port lookup and
connection.

note: i haven't tried this.

Dave

On Dec 18, Christian Merz scribed:

> Hi folks,
> my 'perldoc DBD::Oracle' says in 'CONNECTING TO ORACLE':
>      If a port number is not specified then the descriptor will
>      try both 1526 and 1521 in that order (e.g., new then old).
>      You can check which port(s) are in use by typing
>      "$ORACLE_HOME/bin/lsnrctl stat" on the server.
> but I don't know how to specify a port number. But I would like to do so
> as we are using different ports.
>
> I tried both:
> $host = 'my_host.my_domain 1521';
> $host = 'my_host.my_domain:1521';
> $dbh = DBI->connect( "dbi:Oracle:host=$host;sid=$sid", $user, $passwd )
>         || die "cannot connect to oracle\n   $DBI::errstr\n";
> I only get: ORA-12545: (DBD ERROR: OCIServerAttach)
> (without the port specification the connection works fine.)
>
> Any suggestions?
> Is the only solution TWO_TASK via SQL*Net V2?
> ---------------------------------------------------------
> Landeshauptstadt M�nchen
> Direktorium - AFID 3.3 - Oracle DBA
> C.A. Merz
>

Reply via email to