• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

ANR2579E failed - return code 230

jamesmacd40

ADSM.ORG Member
#1
Hi

i have a schedule set up that runs a DB2 reclaim script that issues the following command
su - db2inst1 -c /home/db2inst1/tsm/db2_reclaim.ksh

the command runs ok when i issue it from the host (signed in as root), however when it is scheduled to run using the tsm scheduler, i get the error that it failed with the RC of 230

I cannot find anything on what the RC 230 means anywhere.

I checked permissions on the ksh script, db2inst1 has permission to it, in fact permission wise, it is the same as the db2_backup_full.ksh script, that runs fine on a TSM schedule also.

Anyone have any idea what RC 230 means?

thanks
 

RecoveryOne

ADSM.ORG Senior Member
#2
For scheduled commands if using the tsm scheduler, the return code is the return code from the command that was run. Not much help I know. Any chance you can break it into smaller parts and check the result of each section?
 

jamesmacd40

ADSM.ORG Member
#3
Well, when i log into the box using root, i can issue the command and it will run without any errors. but as soon as i try to get the scheduler to run it, it fails.

I will try a few more things to see what i can figure out with it

thanks
 

RecoveryOne

ADSM.ORG Senior Member
#4
Right, so you as root are running 'su - db2inst1 -c /home/db2inst1/tsm/db2_reclaim.ksh' no issues.
I've had some issues with AIX and ksh scripts from cron fail if a term wasn't exported.
I've gotten in the habit of doing something like this to all my scripts at the start.
Code:
TERM=vt100;export TERM
 

RecoveryOne

ADSM.ORG Senior Member
#6
Yeah, for example it would be:
Code:
#!/bin/sh

TERM=vt100;export TERM
#rest of script goes here
What it does is set the running term type of the script to vt100.
 

DazRaz

ADSM.ORG Senior Member
#8
It's probably scheduler service which needs to be started differently. Had the same problem and started the scheduler to run scripts like this:

nohup dsmc sched -optfile=/usr/tivoli/tsm/client/api/bin64/custom.opt >/dev/null 2>&1 < /dev/null &

Remove the part selecting the opt file if you don't need to use a different one.
 

jamesmacd40

ADSM.ORG Member
#9
I have the dsmcad running which invokes the scheduler - dsm.sys for each node has managedservices schedule webclient


ps -ef | grep dsmcad
root 8519798 1 0 Jan 16 - 0:00 /usr/tivoli/tsm/client/ba/bin64/dsmcad
root 10158152 1 0 Jan 16 - 0:00 /usr/tivoli/tsm/client/ba/bin64/dsmcad -optfile=/home/db2inst1/tsm/dsm.opt
root 10747992 1 0 Jan 16 - 0:00 /usr/tivoli/tsm/client/ba/bin64/dsmcad -optfile=/home/db2inst2/tsm/dsm.opt
root 12976336 6619378 0 06:57:54 vty0 0:00 grep dsmcad

THis server has the cad running for regular BA client OS level backup, 1 configured to run a DB2 backup against the databases in DB2INST1 and another for DB2INST2

the script to run the DB2 backups are ok

the ksh script for running the online backup is

#!/bin/ksh
#set -x

# The list of databases is taken from db2 -v 'LIST DATABASE DIRECTORY' command from the current DB2 instance

for i in `db2 -v 'LIST DATABASE DIRECTORY' | grep "Database name" | awk -F'=' '{ print $2}'` ;
do
echo backing up database $i ; db2 backup database $i online use tsm ;

if [[ $? -ne 0 ]] ;
then
logger db2 backup failed for $i database ;
# If you get this message - please check your TSM server
# This backup will fail if TSM server is not available
else
echo success ;
fi ;

done


This works fine

The script to reclaim old DB2 backups is this

#!/bin/ksh
# set -x

# KEEP_FULL is the number of full DB backups will be retained in TSM
# including all Archivelogs

KEEP_FULL=35

## Delete full DB backups and keep $KEEP_FULL
#
for DB in `db2 -v "LIST DATABASE DIRECTORY" | grep "Database name" | awk -F'=' '{ print $2 }'` ;
do
db2adutl delete full keep $KEEP_FULL db $DB without prompting
#
# This is the tricky part to determine the oldest logfilenumber
# We assume that the last image in the query output has the oldest log number
# We had to subtracte one from the oldest logfile in order to keep the
# last backup valid.
#
let OLDEST_LOG=$(db2adutl query full db $DB | grep Time: | tail -2 | awk '{print $3}' | cut -c2-8 )
let OLDEST_LOG=$(db2adutl query full db $DB | grep Time: | tail -1 | awk '{ print $6 }' | cut -c2-8)
let OLDEST_LOG=$OLDEST_LOG-1
echo OLDEST_LOG $OLDEST_LOG
OLD_LOG=$(printf "%-7.7d" $OLDEST_LOG)
OLD_LOG="S$OLD_LOG.LOG"
# Now delete obsolete logs
#
db2adutl delete logs between S0000000.LOG and $OLD_LOG db $DB without prompting
done

I think there is something off with the way the scheduler kicks off hte script, even though it is set up the exact same as the rest of the environments being backed up.
 
#10
Very Odd, but i modified the script to change the keep_full from 35 to 8 (there were only 10 backups reporting in TSM, which lines up as the node was configured 10 days ago), the scheduled job ran, but reported failed again with same RC 230.
I took a look at the what TSM was now showing for that node ./db2adutl query, and the script actually worked and removed the oldest 2 DB2 backups for that instance.

So, i am not gonna worry too much about it, as long as the oldest backups are getting removed i am good with that.
 

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 10 15.9%
  • Keep using TSM for Spectrum Protect.

    Votes: 38 60.3%
  • Let's be formal and just say Spectrum Protect

    Votes: 9 14.3%
  • Other (please comement)

    Votes: 6 9.5%

Forum statistics

Threads
31,208
Messages
132,862
Members
21,357
Latest member
prihatnos
Top