cancel
Showing results for 
Search instead for 
Did you mean: 

cannot su - oracle within bpstart_notify script

Daniel_Vo
Level 2
Hi all,

I have a problem on one of my Tru64 servers which su command within bpstart_notify script is not able to execute while calling from Netbackup. But I able to execute this script manually (from interactive environment). I can tell that the script was called from netbackup when the backup job started but it was never able to execute the line (su - oracle -c "my_db_shutdown script") to shutdown the database. We are using netbackup client version 5.1 on Tru64 server. If anyone has any suggestion or solutions to this I would really appreciate it.

Thanks in advance!

Daniel
5 REPLIES 5

Rakesh_Khandelw
Level 6
There is a naming convention you need to follow to use bpstart and exit notify scripts.

To create a bpstart_notify script for a specific policy or policy and schedule
combination, create script files with a .policyname or .policyname.schedulename suffix. The
following are two examples of script names for a policy named production that has a
schedule named fulls:
/usr/openv/netbackup/bin/bpstart_notify.production
/usr/openv/netbackup/bin/bpstart_notify.production.fulls
The first script affects all scheduled backups in the policy named production. The second
script affects scheduled backups in the policy named production only when the schedule
is named fulls.

If the /usr/openv/netbackup/bin/bpstart_notify script exists, it runs in the
foreground and the bpbkar process on the client waits for it to complete before
continuing. Any commands in the script that do not end with an & character run serially.
The server expects the client to respond with a continue message within the period of
time specified by the NetBackup BPSTART_TIMEOUT option on the server.
The default for BPSTART_TIMEOUT is 300. If the script needs more time than 300 seconds, increase the value to allow more time.


Caution - If you use either the bpstart_notify or bpend_notify scripts, do not
include commands that write to stdout. If you do, NetBackup sends this output
to the server as part of the backup and the resulting backup can abort with an
error message pertaining to block sizes. Also, ensure that all commands in the
scripts are appropriate to the client platform. For example, the -s parameter is
invalid for the UNIX mail command on some UNIX platforms and its use can
cause data to be written to stdout or stderr, resulting an error.Message was edited by:
RK

Daniel_Vo
Level 2
HI Rakesh,

First of all thanks for your respond. Below is the exact script that I wrote, this script worked fine on of my Tru64 servers (call by netbackup). I try to compare the environments from both servers but cannot find any discripancy. Please scan thru my script and advise if you see anything that is not working right.

Thanks

Here is my script,

script name = bpstart_notify.Ora-DB-brahms-C2000PRD
policy name = Ora-DB-brahms-C2000PRD

Script content

#! /bin/sh
######################################################################
#
# bpstart_notify.Ora-DB-brahms-C2000PRD
#
# Job will shutdown selected databases before a full Unix backup
# (This is the script that runs at the START of the NetBackup job)
#

# --------------------------------------------------------------------
# main script starts here
# --------------------------------------------------------------------
if
then
set -x
fi

LOGDIR=/r01/app/oracle/local/op/log
LOGFL=${LOGDIR}/Ora-DB-brahms-C2000PRD.log
touch ${LOGFL}
for dbname in C2000PRD ; do
echo "`/usr/bin/date` - Shutting down database ${dbname}" >> ${LOGFL}
su - oracle -c "
export ORAENV_ASK=NO
export ORACLE_SID=${dbname}
. /usr/local/bin/oraenv
cd ~oracle/local/op
./orasid_shut 'Closed_bkup'
" >> ${LOGFL}
done

now=`date +%c`
today=`date +%Y%m%d%H%M`

echo "\nStarting Full backup at $now.." >> ${LOGFL}

if
then
set +x
fi

# End of script


Thanks

Daniel

Daniel_Vo
Level 2
Rakesh,

I was digging some more into this problem today, and I found something new hopefully you can help me figure out this by my new finding. I scanned thru the backup log and this is what showed up everytime the bpstart_notify.Ora-DB-brahms-C2000PRD script was called by netbackup

Starting Full backup at /usr/openv/netbackup/bin/bpstart_notify.Ora-DB-brahms-C2000PRD: 194386 Memory fault(coredump)

I'm wonder what is "194386 Memory fault(coredump)" meant and don't know if this is related to why netbackup not able to call the script.

Please help!

Thanks

Daniel

Dennis_Strom
Level 6
You could have a bad memory module. Check also /var/adm/messages

Daniel_Vo
Level 2
Dennis,

Thanks for replied to my msg. I have checked /var/adm/messages but don't see anything significant to my su problem. We have reinstalled Netbackup Client but the issue still happenning. Not sure what else to do.

Thanks

Daniel