Tuesday, October 27, 2009

adpreclone.pl: ERROR while running Stage...

Back to blogging after a couple of months of inactivity!! Here is an issue I faced while trying to run adpreclone on dbtier:
/oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/scripts/STPJS_server > perl adpreclone.pl dbTier
Running Rapid Clone with command...
perl /oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/bin/adclone.pl java=/oracle/product/9.2.0.7_autoconfig/STPJS/jre/1.4.2 mode=stage
stage=/oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/clone component=dbTier method=CUSTOM dbctx=/oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/STPJS1_server.xml showProgress

Beginning database tier Stage - Tue Oct 27 01:46:48 2009
APPS Password : ******
Log file located at /oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/log/STPJS1_server/StageDBTier_10270046.log
\ 0% completed
ERROR while running Stage...

ERROR while running perl /oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/bin/adclone.pl java=/oracle/product/9.2.0.7_autoconfig/STPJS/jre/1.4.2 mode=stage stage=/oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/clone component=dbTier method=CUSTOM dbctx=/oracle/product/9.2.0.7_autoconfig/STPJS/appsutil/STPJS1_server.xml showProgress ... Please check the log for more details..

The log does not have any details.

Fix:

1. comment out the following lines in STPJS1_server.env



#PATH=${PERLBIN}:${PATH}

#export PATH

#PATH=".:/usr/bin:/usr/ccs/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/resmon/bin:/
opt/perf/bin:/opt/OV/bin/OpC:/opt/ignite/bin:/usr/sbin/stm/uut/bin/progs:/usr/lo
cal/bin:/usr/local/tools:/usr/contrib/bin:/usr/sbin/diag/contrib:/opt/hparray/bi
n:/opt/graphics/common/bin:/opt/prm/bin:/opt/OV/bin:/opt/langtools/bin:/opt/NetA
pp/santools/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sfm/bin:/users/oracle/bin:/usr
/bin:/usr/local/bin:/bin:/etc:/usr/etc:/usr/bin:/usr/bin/X11:/usr/contrib/bin:/u
sr/local/X11R5/bin:/oracle/product/9.2.0.7_autoconfig/STPJS/bin:/usr/tools/orac
le/Standard/script:/users/oracle/bin"


2. copy the correct version of zip to $ORACLE_HOME/bin. The zip version should be greater than 2.2.

3. set path as follows:
export PATH=$ORACLE_HOME/bin:$PATH

4. Which zip should show $ORACLE_HOME/bin/zip

5. Which perl should show /usr/local/bin/perl

6. Run adpreclone.pl dbTier, it should work correctly.


Troubleshooting this issue requires some proof reading of the adpreclone.pl script to understand what it does and where exactly it errors out. Here is the result of that:

since /usr/local/bin has both perl and zip executables, the lower version of zip was being picked up from /usr/local/bin. Even if you copy the newer version of zip to $ORACLE_HOME/bin and set the path manually before you start the adpreclone to PATH=$ORACLE_HOME/bin:$PATH, you will encounter the error. This is because adpreclone calls adclone.pl and before calling adclone.pl it sources the STPJS1_server.env file which will reset the PATH to original value which will wipe out $ORACLE_HOME/bin from the path. This is why we have commented out path in env file in above steps.

Revert the changes back after adpreclone runs successfully.

Permanent Fix: Copy the correct version of zip to /usr/local/bin after making sure that there are no other applications running on the server that have dependency on older version of zip.


-Aravind Kamath Posral

2 comments:

Anonymous said...

Hi while running adpreclone.pl dbTier

Got the below mentioned error

$ which perl
/9ihome/9.2.0/Apache/perl/bin/perl
$ perl adpreclone.pl dbTier
Can't locate loadable object for module Fcntl in @INC (@INC contains:
/9ihome/9.2.0/Apache/perl/lib/5.00503/IA64.ARCHREV_0
/9ihome/9.2.0/Apache/perl/lib/5.00503
/9ihome/9.2.0/Apache/perl/lib/site_perl/5.005/IA64.ARCHREV_0
/9ihome/9.2.0/Apache/perl/lib/site_perl/5.005
/9ihome/9.2.0/appsutil/perl
/project/ia64hpunix64/9202/APACHE/src/pdc_perl/bin/HPUX/Opt/lib/5.00503/IA64.ARCHREV_0
/project/ia64hpunix64/9202/APACHE/src/pdc_perl/bin/HPUX/Opt/lib/5.00503
/project/ia64hpunix64/9202/APACHE/src/pdc_perl/bin/HPUX/Opt/lib/site_perl/5.005/IA64.ARCHREV_0
/project/ia64hpunix64/9202/APACHE/src/pdc_perl/bin/HPUX/Opt/lib/site_perl/5.005 .) at adpreclone.pl line 35
BEGIN failed--compilation aborted at adpreclone.pl line 35.

How to resolve the perl error.

Regards,
Sreedhar

Aravind Kamath said...

Hello Sreedhar,

Check PERL5LIB env variable and see if that helps..

Aravind