on 2006 Oct 06 11:14 AM
Hi all,
I am writing a batch file to take a backup of NW04 and NW04s on Windows with Database. I have executed the same
successfully on linux using shell scripts.But I am unable to execute some of the DB commands that I could execute on shell.They are as follows..
echo "#MaxDB backup commands to backup database instance"
#medium_cmd="medium_put $SID"_"$SUFFIX /sapdata/backup/$SID"_"$SUFFIX.DB FILE DATA"
medium_cmd="medium_put $SID"_"$SUFFIX $SID"_"$SUFFIX.DB FILE DATA"
echo $medium_cmd
backup_cmd="backup_start $SID"_"$SUFFIX DATA"
echo $backup_cmd
echo "executing complete data backup..."
_o=`cat <<EOF | dbmcli -d $SID -u control,control -uUTL
db_admin
util_connect
$medium_cmd
$backup_cmd
db_online
EOF`
the varaible like SID are taken from the user. Now I am not able to execute the same using DOS. My question is how to execute the DB commands as a single commands. Please help me as It is of high priority.
Thanks a heap in advance.
try this:
dbmcli -d $SID -u control,control -uUTL db_admin
dbmcli -d $SID -u control,control -uUTL util_connect
dbmcli -d $SID -u control,control -uUTL $medium_cmd
dbmcli -d $SID -u control,control -uUTL $backup_cmd
dbmcli -d $SID -u control,control -uUTL $db_online
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ahh,
and don't forget,
dos variable are addressed like this: %sid%,
for example echo %sid%,
I hope this would help you,
ilan shani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure I had understood your linux script,
here are some tips for dos, which might help you:
the command: set /p sid=
would input information from the user.
the command: dbconnect < input.txt
would table the input of dbconnect from the file input.txt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.