Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script error

Status
Not open for further replies.

230173

MIS
Jun 22, 2001
208
SG
hi,

I'm trying to implement a backup script from a book called "oracle 8i backup and recovery by Rama velpuri"
On AIX 4.3.3
But i get the following error:

$ dbbackup spcbase
/opt/app/oracle/admin/backup/backup/dbbackup_begin spcbase hot >> /opt/app/oracle/admin/backup/db_admin/spcbase/log/backup_020409.log 2>>
/opt/app/oracle/admin/backup/db_admin/spcbase/log/backup_020409.err


Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] pattern_list [file...]
dbbackup[191]: Export terminated successfully: not found.
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] -e pattern_list...
[-f pattern_file...] [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
Usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwy] [-p[parasep]] pattern_list [file...]
dbbackup[193]: Export terminated successfully: not found.

I've looked in the script and i see nothing wrong.
He complaints on a grep statement.
This is the first statement with grep:

STATUS=`ps -fu oracle | grep "ora_[a-z]*_${DBNAME}" `

But if i do this on an prompt mline this works fine.

Help!!!

PS: what's "$?" ?
Does this mean any variable?

If you don't have enough info let me know and i'll send the whole script.


thnx
 
$? is the return code from the last process run.

Are there any other grep lines? Mike
"Experience is the comb that Nature gives us after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
There are no grep lines beore this one.
The other grep lines are:

PROCS=`ps -ef |grep oracle${DBNAME} |grep -v grep |awk '{print $2}'`
 
try using debugging with: set -vx

put this a few lines into your script and you should be able to see exactly what your grepping for when it hits the grep statement or alternatively execute your script with: ksh -vx scriptname (replace ksh with sh/csh/bash.....etc).

I tend to find that a variable is NULL/EMPTY when this usually occurrs!



Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top