XP Storage
1826443 Members
3764 Online
109692 Solutions
New Discussion

Re: Business copy error on hp-ux running from a shell script

 
Rick Copley
Advisor

Business copy error on hp-ux running from a shell script

Below is a snippet of a script that is for Business Copy clones and snaps, we are running it on an HP-UX system with an XP2400 Array. When we run the script, intermittently we get this error, and bombs on either a paircreate aor a pairsplit command. When we run these commands manually from the command line, it always works.

This is the error:
: [EX_CMDRJE] An order to the control/command device was rejected

This is the script syntax...
$PAIRSPLIT="/usr/bin/pairsplit"
$PAIREVTWAIT="/usr/bin/pairevtwait"

$PAIRSPLIT -IBC01 -g c1 -S
$PAIREVTWAIT -IBC01 -g c1 -ss smpl -t 60
if [ "$?" -ne 0 ]
then
echo "ERROR: Split of $CLONE to Simplex has timed out - command aborted"
exit 1
else
echo "CLONE is now in simplex mode test successful..."
fi

Any help would be appreciated..

Thanks,

Ed


7 REPLIES 7
Michal Kapalka (mikap)
Honored Contributor

Re: Business copy error on hp-ux running from a shell script

hi,

if you run this script from sh manually it always works ??? i yes, them you need to define some parameters for the shell.

mikap
Michal Kapalka (mikap)
Honored Contributor

Re: Business copy error on hp-ux running from a shell script

hi,

check this link :

http://forums.hds.com/index.php?showtopic=549

"Problem got fixed after installing addiional shadow licenses."

HITACHI USP-V = HP XP 24000

mikap
PP BIJU KRISHNAN
Trusted Contributor

Re: Business copy error on hp-ux running from a shell script

Hi Ed,

As the previous posts state, it seems like a problem with your ENV variables set on the shell prior to execution of the script.

Post your HORCM files, and scripts and I will have a look.

The errors are always cryptic and don't lead you in the right direction. The way to get it right is by doing everything as per the book.
Rick Copley
Advisor

Re: Business copy error on hp-ux running from a shell script

Thanks for your help...

env command shows

SHELL=/sbin/sh

and the script indicates:

oa1406:/scripts >head bcopy.sh
#!/bin/ksh

Can this be causing a problem?

Thanks again..

Ed


PP BIJU KRISHNAN
Trusted Contributor

Re: Business copy error on hp-ux running from a shell script

SHELL=/bin/sh is your default shell and

#!/bin/ksh is the shebang

This is not likely to cause any problem to the execution.
Rick Copley
Advisor

Re: Business copy error on hp-ux running from a shell script

This is the horcm files and the script, sorry it is pretty lengthly:

(Thankyou Again for your Help!!!)

oa1406:/etc >more horcm01.conf
HORCM_MON
#ip_address service poll(10ms) timeout(10ms)
oa1406.ironmountain.com horcm01 1000 3000

HORCM_CMD
/dev/rdsk/c21t15d5 /dev/rdsk/c19t15d5 /dev/rdsk/c21t15d6 /dev/rdsk/c19t15d6 /dev/rdsk/c21t15d7 /dev/rdsk/c19t15d7
#This is a business copy from improd to IMPTCH
HORCM_LDEV
#dev_group dev_name Serial# CU:LDEV(LDEV#) MU#
c1 02:08_03:1f 17896 02:08 0
c1 02:00_03:1b 17896 02:00 0
c1 02:01_03:01 17896 02:01 0
c1 02:02_03:03 17896 02:02 0
c1 02:03_03:05 17896 02:03 0
c1 02:04_03:07 17896 02:04 0
c1 02:05_03:09 17896 02:05 0
c1 02:06_03:0b 17896 02:06 0
c1 02:07_03:0d 17896 02:07 0
c1 02:0c_03:1c 17896 02:0c 0
c1 02:0d_03:0f 17896 02:0d 0
c1 02:0e_03:11 17896 02:0e 0
c1 02:0f_03:13 17896 02:0f 0
c1 02:10_03:15 17896 02:10 0
c1 02:11_03:17 17896 02:11 0
c1 02:12_03:19 17896 02:12 0
c1 02:13_03:00 17896 02:13 0


HORCM_INST
#dev_group ip_address service
c1 oa1406.ironmountain.com horcm02

oa1406:/etc >more horcm02.conf
HORCM_MON
#ip_address service poll(10ms) timeout(10ms)
oa1406.ironmountain.com horcm02 1000 3000

HORCM_CMD
/dev/rdsk/c21t15d5 /dev/rdsk/c19t15d5 /dev/rdsk/c21t15d6 /dev/rdsk/c19t15d6 /dev/rdsk/c21t15d7 /dev/rdsk/c19t15d7

HORCM_LDEV
#dev_group dev_name Serial# CU:LDEV(LDEV#) MU#
c1 02:08_03:1f 17896 03:1f 0
c1 02:00_03:1b 17896 03:1b 0
c1 02:01_03:01 17896 03:01 0
c1 02:02_03:03 17896 03:03 0
c1 02:03_03:05 17896 03:05 0
c1 02:04_03:07 17896 03:07 0
c1 02:05_03:09 17896 03:09 0
c1 02:06_03:0b 17896 03:0b 0
c1 02:07_03:0d 17896 03:0d 0
c1 02:0c_03:1c 17896 03:1c 0
c1 02:0d_03:0f 17896 03:0f 0
c1 02:0e_03:11 17896 03:11 0
c1 02:0f_03:13 17896 03:13 0
c1 02:10_03:15 17896 03:15 0
c1 02:11_03:17 17896 03:17 0
c1 02:12_03:19 17896 03:19 0
c1 02:13_03:00 17896 03:00 0



HORCM_INST
#dev_group ip_address service
c1 oa1406.ironmountain.com horcm01






script:

oa1406:/scripts >more bcptch.sh
#!/bin/ksh
# bcptch.sh
#
# Script to perform clone operation on IMPTCH
# Author: Ed Stremler
# Last Modified: 12/29/09
# Return code: 0 OK
# 1 error
#
# Variables:

INFO="INFO: "
WARNING="WARNING: "
ERROR="Error: "

HORCMSHUTDOWN=/usr/bin/horcmshutdown.sh
HORCMSTARTUP=/usr/bin/horcmstart.sh
PAIRCREATE=/usr/bin/paircreate
PAIRSPLIT=/usr/bin/pairsplit
PAIRDISPLAY=/usr/bin/pairdisplay
PAIREVTWAIT=/usr/bin/pairevtwait
CLONE=IMPTCH

# Initialize HORCM Instances
echo "$INFO Stop and Start of HORCM instances for $CLONE and $SNAP"
$HORCMSHUTDOWN 01 02
echo "Horcmshutdown 01 02 complete"
$HORCMSTARTUP 01 02
echo "Horcmstartup 01 02 complete"

# Confirm Clone instance is in Simplex mode
echo "Confirming the $CLONE horcm group is in Simplex Mode"
$PAIREVTWAIT -IBC01 -g c1 -ss smpl -t 60
if [ "$?" -ne 0 ]
then
echo "$ERROR $CLONE horcm group not in Simplex mode - command aborted"
exit 1
else
echo "$INFO $CLONE horcm group is in Simplex mode, ready to proceed with the Clone"
fi
sleep 5

# Start the clone process
echo "Starting the clone process on $CLONE, this part will take about 1.5 hours."
$PAIRCREATE -IBC01 -g c1 -vl
sleep 5
$PAIREVTWAIT -IBC01 -g c1 -s pair -t 20000
if [ "$?" -ne 0 ]
then
echo "$ERROR Clone process of $CLONE has timed out - command aborted"
exit 1
else
while true
do
echo "$INFO Clone of $CLONE completed successfully, Ready for DBA to put database in hotbackup"
echo "When database is in hot backup please enter (Yes) "
read YES
if [ $YES = "Yes" ]
then
break
else
continue
fi
done
fi

# Split clone instance into psus-ssus state
echo "Spliting the clone of $CLONE to psus-ssus state and verfying.... "
$PAIRSPLIT -IBC01 -g c1
sleep 5
# psus check
$PAIREVTWAIT -IBC01 -g c1 -s psus -t 1000
if [ "$?" -ne 0 ]
then
echo "$ERROR Split of $CLONE to PSUS has timed out - command aborted"
exit 1
else
echo "$INFO PSUS test successful for $CLONE..."
fi
sleep 5

#ssus check
$PAIREVTWAIT -IBC01 -g c1 -s ssus -t 1000
if [ "$?" -ne 0 ]
then
echo "$ERROR Split of $CLONE to ssus has timed out - command aborted"
exit 1
else
echo "$INFO SSUS test successful for $CLONE..."
fi
sleep 5

# Resplitting Clone to smpl (Simplex Mode)
echo "Resplitting and Confirming the $CLONE horcm group is in Simplex Mode"
$PAIRSPLIT -IBC01 -g c1 -S
sleep 5
$PAIREVTWAIT -IBC01 -g c1 -ss smpl -t 60
if [ "$?" -ne 0 ]
then
echo "$ERROR Split of $CLONE to Simplex has timed out - command aborted"
exit 1
else
echo "$INFO $CLONE is now in simplex mode test successful..."
while true
do
echo "$INFO Clone proceess of $CLONE completed successfully, Ready for DBA to take database out of hotbackup"
echo "When database is out of hot backup please enter (Yes) "
read YES
if [ $YES = "Yes" ]
then
break
else
continue
fi
done

fi

# Volume groups can now be re-imported
echo
echo "Ready to import the Volume group....."

exit 0




PP BIJU KRISHNAN
Trusted Contributor

Re: Business copy error on hp-ux running from a shell script

Hi Ed,

Sorry buried in work....

You need to set the variables via the script, coz the script runs in its own env

set HORCC_MRCF=1
set HORCMINST=0

Add these lines to the beginning of the script and I think the error would be eliminated.