Perl and PDBA on NT/Win2k Servers

crashclappergapSoftware and s/w Development

Dec 13, 2013 (3 years and 3 months ago)

82 views

Perl and PDBA on NT/Win2k Servers



Install Perl


As of 5/6
/2003, use Perl 5.6.1. The modules needed for 5.8 are not all currently available.

In particular,
there are currently no publicly available versions of DBD
-
Oracle compiled to work with ActiveStat
e Perl
5.8


Even with 5.6.1, it is a fair bit of trouble to install some of them.


Perl 5.6.1 build 626:


http://downloads.activestate.com/ActiveP
erl/Windows/5.6/ActivePerl
-
5.6.1.635
-
MSWin32
-
x86.msi


Just download the msi file and execute it.

Modules


Several modules are required for PDBA. Various PDBA scripts may require other modules, but this is the
required list for the PDBA module itself, as
well as the chkalert_NT.pl script.


After installing these few, you should have no trouble installing others that may be needed.




TimeDate



Crypt::RC4



Mail::Sendmail



Win32::Daemon



DBI



DBD::Oracle

Installing the modules


Standard Installs


Until the xmlproj.
com site is back up, the DBI and DBD::Oracle modules must be loaded from ActiveState
via PPM. These are compiled with old Oracle libs, but that’s all that’s available at the moment.


The DBI, TimeDate and Crypt::RC4 modules all install easily from ppm.


When installing DB
D
-
Oracle, install the DBD
-
Oracle8 module, as it uses newer libs.

I will show you how
to do that a little later. For now, just install those previously listed as being easily installed.


Set the HTTP_PROXY environment variable if needed
.


eg.


DOS> set http_proxy=http://
myproxy.mydomain
.com:8080

DOS> ppm

PPM> install DBI



DBD
-
Oracle


DBD
-
Oracle, Mail::Sendmail and Win32::Daemon both require a little more work.


Download DBD
-
Oracle8.zip from
http://ppm.activestate.com/PPMPackages/zips/6xx
-
builds
-
only/DBD
-
Oracle8.zip


Extract the DBD
-
Oracle8.ppd and
MSWin32
-
x86
-
multi
-
thread
/DBD
-
Oracle8.tar.gz files to C:
\
temp
\
perl.


Now modify the DBD
-
Oracle8.ppd f
ile to point to the new location for DBD
-
Oracle.tar.gz.


Change the section that appears as:


<IMPLEMENTATION>


<DEPENDENCY NAME="DBI" VERSION="0,0,0,0" />


<OS NAME="MSWin32" />


<ARCHITECTURE NAME="MSWin32
-
x86
-
multi
-
thread" />


<CODEBASE HREF="MS
Win32
-
x86
-
multi
-
thread/DBD
-
Oracle8.tar.gz" />

</IMPLEMENTATION>


so that it looks like this:


<IMPLEMENTATION>


<DEPENDENCY NAME="DBI" VERSION="0,0,0,0" />


<OS NAME="MSWin32" />


<ARCHITECTURE NAME="MSWin32
-
x86
-
multi
-
thread" />


<CODEBASE HREF="fi
le://c:/temp/perl/MSWin32
-
x86
-
multi
-
thread/DBD
-
Oracle8.tar.gz" />

</IMPLEMENTATION>


This requires two installs. DBD
-
Oracle will be installed first, and then DBD
-
Oracle8 will be installed over
the top to get some of the newer features.


Now from PPM, insta
ll DBD::Oracle like this:


PPM>
install DBD
-
Oracle

Install package 'DBD
-
Oracle?' (y/N): y

Installing package 'DBD
-
Oracle'...

Downloading http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32
-
x86
-
multi
-
thread/DBD
-
Oracle.tar.gz ...

Installing C:
\
Perl
\
site
\
l
ib
\
auto
\
DBD
\
Oracle
\
Oracle.bs

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracle.dll

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracle.exp

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracle.lib

Installing C:
\
Perl
\
html
\
site
\
lib
\
Oraperl.html

Installing C:
\
Pe
rl
\
html
\
site
\
lib
\
DBD
\
Oracle.html

Installing C:
\
Perl
\
site
\
lib
\
oraperl.ph

Installing C:
\
Perl
\
site
\
lib
\
Oraperl.pm

Installing C:
\
Perl
\
site
\
lib
\
DBD
\
Oracle.pm

Installing C:
\
Perl
\
bin
\
ora_explain

Installing C:
\
Perl
\
bin
\
ora_explain.bat


PPM>
install
--
location c:/t
emp/perl DBD
-
Oracle8

Install package 'DBD
-
Oracle8?' (y/N): y

Installing package 'DBD
-
Oracle8'...

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracle.dll

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracle.exp

Installing C:
\
Perl
\
site
\
lib
\
auto
\
DBD
\
Oracle
\
Oracl
e.lib

Installing C:
\
Perl
\
site
\
lib
\
oraperl.ph

Installing C:
\
Perl
\
site
\
lib
\
Oraperl.pm

Installing C:
\
Perl
\
site
\
lib
\
DBD
\
Oracle.pm

PPM>



Mail::Sendmail



Download Mail::Sendmail from:


http://ppm.activestate.com/PPMPackages/zips/6xx
-
builds
-
only/Mail
-
Sendmail.zip



Extract the file Mail
-
Sendmail.ppd to c:
\
temp
\
perl.


Extract the file MSWin32
-
x86
-
multi
-
thread/Mail
-
Sendmail.tar.gz to c:
\
temp
\
perl.


Now modify the Mail
-
Sendmail.ppd file to point to the new location for Mail
-
Sendmail.tar.gz


Change the section that appears as:


<IMPLEMENTATION>


<CODEBASE HREF="MSWin32
-
x86
-
multi
-
thread/Mail
-
Sendmail.tar.gz" />


<ARCHITECTURE NAME="MSWin32
-
x86
-
multi
-
thread" />


<OS N
AME="MSWin32" />

</IMPLEMENTATION>


to look like:


<IMPLEMENTATION>


<CODEBASE HREF="file://C:/temp/perl/MSWin32
-
x86
-
multi
-
thread/Mail
-
Sendmail.tar.gz" />


<ARCHITECTURE NAME="MSWin32
-
x86
-
multi
-
thread" />


<OS NAME="MSWin32" />

</IMPLEMENTATION>



No
w from PPM, install Mail::Sendmail like this:


PPM> install
--
location=c:/temp/perl Mail
-
Sendmail

Install package 'Mail
-
Sendmail?' (y/N): y

Installing package 'Mail
-
Sendmail'...

Downloading file://C:/temp/perl/MSWin32
-
x86
-
multi
-
thread/Mail
-
Sendmail.tar.gz
...

Installing D:
\
Perl
\
html
\
site
\
lib
\
Mail
\
Sendmail.html

Installing D:
\
Perl
\
site
\
lib
\
Mail
\
Sendmail.pm

PPM>

Win32::Daemon


Win32::Daemon may be installed by first downloading the zip file:


ftp://www.roth.net/pub/ntperl/Daemon/20020606/bin/daemon_5006.zip


Extract the file Win32
-
Daemon.ppd from the archive and save it in c:
\
perl
\
temp. PPM can then be used to
install the Win32::Daemon module


PPM> install
--
location=c:/temp/per
l Win32::Daemon

Install package 'Win32
-
Daemon?' (y/N): y

Installing package 'Win32
-
Daemon'...

Downloading http://www.roth.net/perl/packages/x86/Win32/Daemon_5006.tar.gz ...

Installing D:
\
Perl
\
site
\
lib
\
auto
\
Win32
\
daemon
\
daemon.DLL

Installing D:
\
Perl
\
site
\
li
b
\
Win32
\
DAEMON.PM

Installing D:
\
Perl
\
site
\
lib
\
Win32
\
daemon
\
AutoStart.pl

Installing D:
\
Perl
\
site
\
lib
\
Win32
\
daemon
\
Create.pl

Installing D:
\
Perl
\
site
\
lib
\
Win32
\
daemon
\
daemon.pl

Installing D:
\
Perl
\
site
\
lib
\
Win32
\
daemon
\
Daemon_Template.pl

Installing D:
\
Perl
\
sit
e
\
lib
\
Win32
\
daemon
\
Win32
-
daemon.ppd

PPM>

PDBA

Now you’re ready to install the PDBA module. Just do it like this:


PPM>

PPM>

PPM> install
--
location http://www.oreilly.com/catalog/oracleperl/pdbatoolkit/ PDBA

Install package 'PDBA?' (y/N): y

Installing pac
kage 'PDBA'...

Downloading http://www.oreilly.com/catalog/oracleperl/pdbatoolkit/PDBA_1_0_Win32.tar.gz
...

Installing D:
\
Perl
\
site
\
lib
\
PDBA.pm

Installing D:
\
Perl
\
site
\
lib
\
PDBA
\
CM.pm

Installing D:
\
Perl
\
site
\
lib
\
PDBA
\
ConfigFile.pm



Installing D:
\
Perl
\
bin
\
us
er_info.pl

PPM>

Troubleshooting

It may be necessary at times to download and hack the PDD and/or zip files for any of these modules.
They are coded by Perl version, and sometimes the PPD files don’t keep up with the Perl versions, even
though the modules
may work fine with a newer version of Perl.


PDBA Scripts

Please refer to “Perl for Oracle DBA’s” for instructions on setting up any specific scripts or other modules.


http://www.oreilly.com/catal
og/oracleperl/