http://qs321.pair.com?node_id=11139073


in reply to Unable to connect to Oracle 19c

note that your $dsn is not used in your DBI->connect() which hardcodes the dsn.

Check if DBD::Oracle is installed under a path included in @INC. In Linux I use App::whichpm to locate modules from the command prompt, like: whichpm DBD::Oracle . In order to see Perl's @INC I do this from command prompt: perl -e "print \"@INC\"" (I guess that works in windows with lame quoting rules). Simply check if the starting path of the first command matches an entry in the output of the second.

Finally, as you said and other Monks said and the program diagnosed: Perhaps the capitalisation of DBD 'oracle' isn't right. And also the documentation of DBD::Oracle has this example (and that should have been your first call actually!):

use DBI; $dbh = DBI->connect("dbi:Oracle:$dbname", $user, $passwd);

Also note that more than one reasons for failure may apply.

bw, bliako

Replies are listed 'Best First'.
Re^2: Unable to connect to Oracle 19c
by NERDVANA (Deacon) on Nov 25, 2021 at 07:40 UTC
    You can get the App::whichpm behavior from perldoc as well, with -l

    See also, perldoc -m for jumping straight into the code of a module.

Re^2: Unable to connect to Oracle 19c
by SpaceCowboy (Acolyte) on Nov 24, 2021 at 17:02 UTC
    Thank you @bliako, turns out that it needed my SID. Which was never the case with MySQL when I tested with it.

    It is working now. Sorry for posting somewhat trivial question...