Set up perl DBI develop environment

rel="File-List" href="file:///C:%5CDOCUME%7E1%5Cli.yan%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">

Install Oracle client 10.2 in Solaris 10 on SPARC platform

 

1.   Get Oracle client 10.2 from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/solsoft.html, e.g.: instantclient-basic-solaris6432- 10.2.0 .3-20070101.zip

2.   Unzip at windows platform

3.   Upload the directory to Unix server

4.   Copy the directory to the single path(e.g.:/usr/ instantclient_10_2)

5.   Set the library loading path in the environment to the directory (e.g.:/usr/ instantclient_10_2), usually the LD_LIBRARY_PATH is the appropriate environment variable. (Append the path to .login file)

6.    Copy the sdk files of Oracle to /usr/ instantclient_10_2/sdk

 

*The .login example file:

 

#/bin/csh

#

# C-shell .login file for operator template account. This login

# file is the hook that starts the keyboard-based operator interface

# menu as opposed to standard Image.

#

# Revisions:

#  9 Mar 95: R. Lindberg - [5.7] start menuprogram.svr4 instead of menuprogram

#                                is using SVR4

# 23 Aug 91: G. Brizicky - [4.1] Remove specific reference to Image 4.0

# 9-Apr-90: created

#

#------------------------------------------------------------------

#

# Get System Configuration file

#

#tconfig > confsim.txt

#

# Source the Image .login file

#

        set path=($path $HOME /usr/sbin /usr/local/bin /image/custom /image/bin.rls /usr/instantclient_10_2)

#

################################################################

################## library for perl ############################

################################################################

setenv LD_LIBRARY_PATH "/usr/local/lib:/usr/openwin/lib"

#setenv LD_LIBRARY_PATH "$IMAGEBIN/lib:/usr/local/lib:/usr/openwin/lib"

################################################################

        if ("`tty`" == "/dev/console") then

#        netscape &

        endif

 

#if ($?LD_LIBRARY_PATH == 0) then

#  setenv LD_LIBRARY_PATH /usr/openwin/lib else

#  setenv LD_LIBRARY_PATH /usr/openwin/lib:${LD_LIBRARY_PATH}

#endif

setenv LD_LIBRARY_PATH "/usr/local/lib:/usr/openwin/lib:/image/bin.rls/lib:/usr/instantclient_10_2"

setenv ORACLE_HOME /usr/instantclient_10_2

setenv TNS_ADMIN /usr/instantclient_10_2

setenv SQLPATH /usr/instantclient_10_2

 

*The .cshrc example file:

 

setenv LD_LIBRARY_PATH "/usr/local/lib:/usr/openwin/lib:/image/bin.rls/lib:/usr/instantclient_10_2"

setenv ORACLE_HOME /usr/instantclient_10_2

setenv TNS_ADMIN /usr/instantclient_10_2

setenv SQLPATH /usr/instantclient_10_2

setenv PATH "/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/image/custom:/image/bin.rls:/usr/instantclient_10_2"

 

Install Perl DBI and DBD(Need root account)

1.      Install DBI

(1). Get the package from www.cpan.org (e.g.: DBI-1.602.tar)

(2). Uncompress DBI-1.602.tar to DBI-1.602

(3). Use these commands:

     - # csh

     - # cd DBI-1.602

     - # perl Makefile.PL

     - # /usr/ccs/bin/make

     - # /usr/ccs/bin/make test

     - # /usr/ccs/bin/make install

*If cause error when run /usr/ccs/bin/make command as:

  cc: unrecognized option `-KPIC'

  cc: language ildoff not recognized

*We should do like this:

   - # csh (goto csh mode)

   - # setenv cc gcc(If has installed gcc)

   - open Makefile, and find the following line:

              CCCDLFLAGS = -KPIC

- change this to:

CCCDLFLAGS =

- then, find the line:

OPTIMIZE = -xO3 -xspace -xildoff

- change this to:

OPTIMIZE =

- then, find the line:

CCFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO

- change this to:

CCFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO

        - then try /usr/ccs/bin/make, /usr/ccs/bin/make test, /usr/ccs/bin/make install again

 

2.      Install DBD

(1). Get the package from www.cpan.org (e.g.: DBD-Oracle-1.19.tar)

(2). Uncompress DBD-Oracle-1.19.tar to DBD-Oracle-1.19

(3). Use these commands:

- # csh

- # cd DBD-Oracle-1.19

- # setenv LD_LIBRARY_PATH /usr/instantclient_10_2

- # perl Makefile.PL

- # /usr/ccs/bin/make

- # /usr/ccs/bin/make test

- # /usr/ccs/bin/make install

         * If error occurs when run “perl Makefile.PL”, edit Makefile.PL:

                  #   my @h_dirs = find_headers(); (Comment)

if ($client_version_full =~ /^ 8.0.6 / && $os eq 'hpux') {

  $linkwith_msg = "-lextp -l$lib.";

  $opts{LIBS} = [ "-L$OH/$libdir -lextp -l$lib $syslibs" ];

#   push @h_dirs, "$OH/network/public"; (Comment)

}

else {

  $linkwith_msg = "-l$lib.";

  $opts{LIBS} = [ "-L$OH/$libdir -l$lib $syslibs" ];

}

#   my $inc = join " ", map { "-I$_" } @h_dirs; (Comment)

my $inc = "-I/usr/instantclient_10_2/sdk/include";(Append, the oracle sdk “*.h” files directory)

……

……

#my @h_dirs = find_headers();(Comment)

#my $inc = join " ", map { "-I$_" } @h_dirs; (Comment)

my $inc = "-I/usr/instantclient_10_2/sdk/include";(Append, the oracle sdk “*.h” files directory)

         * If error occurs when run “/usr/ccs/bin/make”:

  cc: unrecognized option `-KPIC'

  cc: language ildoff not recognized

 

            do like install DBI.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值