Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: DBI connect to Oracle

by Ea (Chaplain)
on Feb 20, 2015 at 15:25 UTC ( [id://1117336]=note: print w/replies, xml ) Need Help??


in reply to DBI connect to Oracle

In my Linux setup, the two things I need are the $ENV{ORACLE_HOME} = '/path/to/oracle'; and the following database handle
my $dbh = DBI->connect("dbi:Oracle:$database_name", $username, $passwo +rd);
with the SID information placed in the network/admin/tnsnames.ora file

Sometimes I can think of 6 impossible LDAP attributes before breakfast.

Replies are listed 'Best First'.
Re^2: DBI connect to Oracle
by Anonymous Monk on Feb 20, 2015 at 16:15 UTC
    Ok, but I have the Oracle installed in other server. And I´m doing all the configuration on the server that I have MySQL installed.
      Ok, that's one thing that you'll need - Oracle libraries on the Mysql machine to make DBD::Oracle work (unless the Windows installation comes with its own Oracle libraries). How did you install DBD::Oracle and what did the test results say?

      Sorry - I don't have the experience with Windows and Oracle, so I'm guessing.

      Another possibility would be to put the script on the Oracle machine and write to the Mysql machine, if it's easier to get DBD::mysql running on that machine.

      Sometimes I can think of 6 impossible LDAP attributes before breakfast.

        Thanks a lot for the help. Now I solved the first problem that was the message that said that "no execution mode was defined".

        To solve this, i just put in the first line of my script: #!/usr/bin/perl unixy

        And than i saved it as a ".PL" archive.

        Keeping trying to connect my database, now I have the following Script:

        #!/usr/bin/perl unixy use DBI my $dbh = DBI->connect('dbi:ODBC:host=172.16.90.220;sid=WEBDB;port=152 +1', 'CEP', 'a423pa');

        But when i run the script, i got the following error:

        DBI connect('host=172.16.90.220;sid=WEBDB;port=1521','CEP',...) failed: [Microsoft][ODBC Driver Manager] Nome da fonte de dados não encontrado e nenhum driver padrão especificado (SQL-IM002) at C:\Documents and Settings\administrator\Meus documentos\connectionOracle.PL line 3"" is not exported by the DBI module

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1117336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found