Build DBD-Oracle on strawberry Perl 5

Source: Internet
Author: User

Copy From perl.org wiki page because I can't view that page from company computer.

Install DBD: Oracle on strawberry perlfeedback
Contents

 [Hide]

  • 1 DBD: Oracle prerequisites
  • 2 Installation instructions
  • 3 Special note on DBD: Oracle 1.28
  • 4 Earlier notes
  • 5 Older information on using DBD: Oracle and Oracle Instant Client
[Edit] DBD: Oracle prerequisites

You will need the Oracle Instant Client. Download the appropriate version, 32-or 64-bit, to match your strawberry Perl. You will need three packages:

    • Instant Client package-Basic (or basic lite)
    • Instant Client package-SQL * Plus
    • Instant Client package-SDK

Unzip all three into the same location on your hard drive. you will end up with all of the files inside a folder named "instantclient_xxx" (XXX is the major & minor version number ). make sure the full path to the instantclient directory does not have any spaces.

Add the instantclient directory to your path environment variable. once you do this, to verify, run the command 'sqlplus 'from a DOS prompt; if you are asked for a username, then you have modified the PATH environment variable correctly.

Warning:If you do not have the instantclient directory in your path, then DBD: Oracle might build, but every time you try to use DBD :: oracle you will get the error "the program can't start because OCI. DLL is missing from your computer ". the error appears as a pop-up window, which must be dismissed before your program can continue. your only solution is to make sure you have the path configured properly, so Test carefully!

[Edit] Installation instructions

DBD: Oracle can be installed using the CPAN client through a DOS prompt. before starting the CPAN client, set your ORACLE_HOME environment variable to be the full path to the instantclient directory (see the section above ).

If you want the installer to test the module against a live Oracle database, then configure the oracle_sid, two_task, or oracle_userid environment variables as appropriate. see the README files in the DBD: Oracle build directory for more information. if the installer does not have a live database against which to test, then most tests will be skipped or aborted, but no tests shoshould fail.

Begin by starting CPAN and running the commands:

    • Get DBD: Oracle, And
    • I DBD: Oracle

If the CPAN version of DBD: Oracle is 1.29 or later, then just runInstall DBD: OracleTo build, test, and install the module. You will see warnings about unused variables, differing signedness in passed arguments, and similar warnings, which are normal (and annoying ).TestFailuresShocould not be ignored.

If the CPAN version is 1.28, then see the special instructions below:

[Edit] Special note on DBD: Oracle 1.28

DBD: Oracle version 1.28 has a critical bug which prevents it from being built in windows. if you see the error "undefined reference to 'oscierverrelease'" at build time, then you are affected by this bug. here is the workaround:

In CPAN, run the commands:

    • Get DBD: OracleAnd
    • Look DBD: Oracle

You will be dumped into a DOS prompt in a clean DBD: Oracle build directory. look for the file named "OCI. def "; edit the file by adding" ociserverrelease "to the empty line at the end of the file.

RunPerl makefile. pl,Dmake,Dmake Test, AndDmake install. Once the module is installed,ExitAnd you shoshould be returned to the CPAN prompt.

[Edit] Earlier notes
    • Makefile. PL does not include DBI directory. even if you follow carefully the instruction on readme.win32.txt and readme.wingcc.txt (bundled with the module) it is not possible to build DBD: Oracle. my quick and dirty solution was to edit manually the makefile created by makefile. pl, adding the path to DBI module to the INC variable.
[Edit] Older information on using DBD: Oracle and Oracle Instant Client
Download and install the Oracle Instant Client
  • Http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html

The manual sucks. Just get everything unpacked into c: \ Program Files \ oracle \ Instant Client 1.11

With Oracle Instant Client, be sure to use a recent DBD: Oracle (1.22 will have a lot of fixes for Instant Client ). you might need to add double quotes around the locations where the space in 'C:/program files 'wocould cause havoc, like in Inc = and ld_run_path =.

Set up the tns_admin stuff
 
> Cd "\ Program Files \ oracle"> MD admin> Cd Admin
 
C: \ Program Files \ oracle \ ADMIN> type sqlnet. oranames. directory_path = (tnsnames, onames, hostname)
C: \ Program Files \ oracle \ ADMIN> type tnsnames. oraodbco = (description = (address_list = (address = (Protocol = TCP) (Port = 1521) (host = orahost) (CONNECT_DATA = (SERVICE_NAME = share )))

Check on 'orahost' what services are available with the command LSNRCTL services '. Use the available service where abve sample uses 'shares'

Set the Env variables in "My computer"
ORACLE_HOME = c: \ Program Files \ oracle \ InstantClient-11.1TNS_ADMIN = c: \ Program Files \ oracle \ adminpath = c: \ windows \ system32; C: \ WINDOWS; C: \ windows \ system32 \ WBEM; C: \ strawberry \ c \ bin; C: \ strawberry \ Perl \ bin; C: \ Program Files \ oracle \ InstantClient-11.1
Start testing

Not all of the below might be absolutely needed, but try these:

 
Set oracle_sid = testsidset dbi_user = usernameset dbi_pass = passwordset oracle_userid = % dbi_user %/% dbi_pass % set dbi_dsn = DBI: oracle: host = orahost; SID = % oracle_sid %; port = 1521 set oracle_dsn = % dbi_dsn %

With the most recent update in DBD: Oracle, the rest shoshould be reasonably smooth.

 
Set oracle_dsn = DBI: oracle: odbco

Is an other option that shoshould work. Where odbco is the entry in tnsnames. ora

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.