There are two ways to set up a 64-bit Perl environment with the DB2 Perl driver (DBD-DB2) on AIX 5.2:
Option 1 - Using the pre-packaged Perl (recommended):
1.1) Check to see if the Perl eFix is installed.
Run the following command as root:
# emgr -l | grep -i perl
1 S perlconfig 09/23/04 14:41:35 fixes truncated Config.pm for Perl
If you don't see the "fixes truncated Config.pm for Perl" then the eFix has not been installed. You can obtain the eFix from your local AIX support or by sending an email to db2perl@ca.ibm.com. The eFix (perlconfig.083004.epkg.Z) is also attached below for your convenience.
To install the eFix, you can run the following command as root:
# emgr -e perlconfig.083004.epkg.Z
See "man emgr" for more options.
1.2) Switch to the prepackaged 64-bit Perl
The file /usr/opt/perl5/README explains how to switch to the pre-packaged 64-bit Perl.
Run the following script: (as root)
(but check the README to ensure nothing has changed)
#!/bin/ksh
ln -f /usr/opt/perl5/bin/perl5.8.0_64bit /usr/bin/perl
ln -sf /usr/opt/perl5/bin/a2p_64bit /usr/bin/a2p
ln -sf /usr/opt/perl5/bin/cppstdin_64bit /usr/bin/cppstdin
ln -sf /usr/opt/perl5/bin/enc2xs_64bit /usr/bin/enc2xs
ln -sf /usr/opt/perl5/bin/h2ph_64bit /usr/bin/h2ph
ln -sf /usr/opt/perl5/bin/libnetcfg_64bit /usr/bin/libnetcfg
ln -sf /usr/opt/perl5/bin/perlbug_64bit /usr/bin/perlbug
ln -sf /usr/opt/perl5/bin/perlcc_64bit /usr/bin/perlcc
ln -sf /usr/opt/perl5/bin/perldoc_64bit /usr/bin/perldoc
ln -sf /usr/opt/perl5/bin/perlivp_64bit /usr/bin/perlivp
ln -sf /usr/opt/perl5/bin/splain_64bit /usr/bin/splain
Make sure you have a valid compiler installed. To check which compiler was used to build your pre-packaged 64-bit Perl, use the "perl -V" command.
1.3) Install the DBI module
Make sure the Perl where you want to install DBI is in the path. The 'which perl' command should return this 64-bit Perl.
If you do not have the latest DBI module, you can download the module by clicking on the Download link at http://search.cpan.org/~timb/DBI/. The latest version at the time of this writing is DBI-1.43.
Once you have downloaded DBI-1.43.tar.gz, you can install it via the following commands:
gzip -d DBI-1.43.tar.gz
tar -xf DBI-1.43.tar
cd DBI-1.43
perl Makefile.PL
make
make test
make install
1.4) Install the DBD-DB2 module
If you do not have the latest DB2-DB2 module, you can download it from http://www.ibm.com/software/data/db2/perl/
If you are using the root user id or an id different from your DB2 instance id , then you must first set the DB2_HOME variable to the location of the DB2 sqllib.
For example, if you installed DB2 64-bit, or the DB2 Development Client 64-bit to /home/db2inst1/sqllib, then do the following:
export DB2_HOME=/home/db2inst1/sqllib
Install the DBD-DB2 module using the following commands:
(Assuming the file you downloaded is DBD-DB2-0.78.tar.gz)
gzip -d DBD-DB2-0.78.tar.gz
tar -xf DBD-DB2-0.78.tar
cd DBD-DB2-0.78
perl Makefile.PL*
make
make test
make install
* Remember to read the README, it contains information about system requirements.
Option 2 - Building 64-bit Perl from source
2.1) Download the latest stable build from http://www.perl.com
After downloading the stable.tar.gz package, you should rename it. Once you have renamed the package, for example to perl584.tar.gz, you will need to issue the following commands:
gzip -d perl584.tar.gz
tar -xf perl584.tar
Configure -Duse64bitall
The installation will prompt you for the location where you want to install Perl. You can use default locations (which will overwrite any existing files) or specify a new location.
You may also consider installing into an AFS directory so that this installation can be shared among all users.
Once the configure command has completed, issue the following commands:
make
make test
make install
Now that you have built the 64-bit Perl, you can then verify that it is 64-bit by using the command:
perl -V
You should see "use64bitall=define".
Make sure the Perl where you want to install DBI is in the path. I.e 'which perl' should return this 64-bit Perl.
2.2) Install the DBI module
Please see the documentation for Option 1 on this same step.
An example:
gzip -d DBI-1.43.tar.gz
tar -xf DBI-1.43.tar
cd DBI-1.43
perl Makefile.PL
make
make test
make install
2.3) Install the DBD-DB2 module
Please see the documentation for Option 1 on this same step.
An example:
gzip -d DBD-DB2-0.78.tar.gz
tar -xf DBD-DB2-0.78.tar
cd DBD-DB2-0.78
perl Makefile.PL*
make
make test
make install
* Remember to read the README, it contains information about system requirements.
Option 1 - Using the pre-packaged Perl (recommended):
1.1) Check to see if the Perl eFix is installed.
Run the following command as root:
# emgr -l | grep -i perl
1 S perlconfig 09/23/04 14:41:35 fixes truncated Config.pm for Perl
If you don't see the "fixes truncated Config.pm for Perl" then the eFix has not been installed. You can obtain the eFix from your local AIX support or by sending an email to db2perl@ca.ibm.com. The eFix (perlconfig.083004.epkg.Z) is also attached below for your convenience.
To install the eFix, you can run the following command as root:
# emgr -e perlconfig.083004.epkg.Z
See "man emgr" for more options.
1.2) Switch to the prepackaged 64-bit Perl
The file /usr/opt/perl5/README explains how to switch to the pre-packaged 64-bit Perl.
Run the following script: (as root)
(but check the README to ensure nothing has changed)
#!/bin/ksh
ln -f /usr/opt/perl5/bin/perl5.8.0_64bit /usr/bin/perl
ln -sf /usr/opt/perl5/bin/a2p_64bit /usr/bin/a2p
ln -sf /usr/opt/perl5/bin/cppstdin_64bit /usr/bin/cppstdin
ln -sf /usr/opt/perl5/bin/enc2xs_64bit /usr/bin/enc2xs
ln -sf /usr/opt/perl5/bin/h2ph_64bit /usr/bin/h2ph
ln -sf /usr/opt/perl5/bin/libnetcfg_64bit /usr/bin/libnetcfg
ln -sf /usr/opt/perl5/bin/perlbug_64bit /usr/bin/perlbug
ln -sf /usr/opt/perl5/bin/perlcc_64bit /usr/bin/perlcc
ln -sf /usr/opt/perl5/bin/perldoc_64bit /usr/bin/perldoc
ln -sf /usr/opt/perl5/bin/perlivp_64bit /usr/bin/perlivp
ln -sf /usr/opt/perl5/bin/splain_64bit /usr/bin/splain
Make sure you have a valid compiler installed. To check which compiler was used to build your pre-packaged 64-bit Perl, use the "perl -V" command.
1.3) Install the DBI module
Make sure the Perl where you want to install DBI is in the path. The 'which perl' command should return this 64-bit Perl.
If you do not have the latest DBI module, you can download the module by clicking on the Download link at http://search.cpan.org/~timb/DBI/. The latest version at the time of this writing is DBI-1.43.
Once you have downloaded DBI-1.43.tar.gz, you can install it via the following commands:
gzip -d DBI-1.43.tar.gz
tar -xf DBI-1.43.tar
cd DBI-1.43
perl Makefile.PL
make
make test
make install
1.4) Install the DBD-DB2 module
If you do not have the latest DB2-DB2 module, you can download it from http://www.ibm.com/software/data/db2/perl/
If you are using the root user id or an id different from your DB2 instance id , then you must first set the DB2_HOME variable to the location of the DB2 sqllib.
For example, if you installed DB2 64-bit, or the DB2 Development Client 64-bit to /home/db2inst1/sqllib, then do the following:
export DB2_HOME=/home/db2inst1/sqllib
Install the DBD-DB2 module using the following commands:
(Assuming the file you downloaded is DBD-DB2-0.78.tar.gz)
gzip -d DBD-DB2-0.78.tar.gz
tar -xf DBD-DB2-0.78.tar
cd DBD-DB2-0.78
perl Makefile.PL*
make
make test
make install
* Remember to read the README, it contains information about system requirements.
Option 2 - Building 64-bit Perl from source
2.1) Download the latest stable build from http://www.perl.com
After downloading the stable.tar.gz package, you should rename it. Once you have renamed the package, for example to perl584.tar.gz, you will need to issue the following commands:
gzip -d perl584.tar.gz
tar -xf perl584.tar
Configure -Duse64bitall
The installation will prompt you for the location where you want to install Perl. You can use default locations (which will overwrite any existing files) or specify a new location.
You may also consider installing into an AFS directory so that this installation can be shared among all users.
Once the configure command has completed, issue the following commands:
make
make test
make install
Now that you have built the 64-bit Perl, you can then verify that it is 64-bit by using the command:
perl -V
You should see "use64bitall=define".
Make sure the Perl where you want to install DBI is in the path. I.e 'which perl' should return this 64-bit Perl.
2.2) Install the DBI module
Please see the documentation for Option 1 on this same step.
An example:
gzip -d DBI-1.43.tar.gz
tar -xf DBI-1.43.tar
cd DBI-1.43
perl Makefile.PL
make
make test
make install
2.3) Install the DBD-DB2 module
Please see the documentation for Option 1 on this same step.
An example:
gzip -d DBD-DB2-0.78.tar.gz
tar -xf DBD-DB2-0.78.tar
cd DBD-DB2-0.78
perl Makefile.PL*
make
make test
make install
* Remember to read the README, it contains information about system requirements.