Home » Infrastructure » Unix » find command error (Oracle 10g Hp-UX)
find command error [message #540421] Mon, 23 January 2012 08:16 Go to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
Hi Team,
I am encountering the below error at the time of running the below find command :-

find ${USER_DUMP_DEST} -type f -name "*.trc" -mtime +${DaysTokeep} -exec ls {} \;

Usage: find path-list [predicate-list]

Can anyone help me out to resolve the issue?

Thanks
P
Re: find command error [message #540425 is a reply to message #540421] Mon, 23 January 2012 08:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Are you sure USER_DUMP_DEST is set?

Regards
Michel
Re: find command error [message #540426 is a reply to message #540425] Mon, 23 January 2012 08:46 Go to previous messageGo to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
Hi
The below are my script details :-
==============================================


if [ $# -ne 1 ]
then
echo "Insuficient Parameter!"
echo "Example: $0 <SID>"
exit 1
fi

#Variables
DATE=`date +%d-%m-%Y`
DaysTokeep=30
SCRIPT_NAME=$0
LOG_DIR="/home/oracle/dba/log"
LOG_FILE=${LOG_DIR}/Cleanup.log_${DATE}
BASE_DIR="/home/oracle/dba/util"
ORACLE_SID=$1
ORACLE_HOME=`cat /etc/oratab | grep ${ORACLE_SID} | grep -v "^#"| awk -F":" '{print $2}'`
LD_LIBRARY_PATH=${ORACLE_HOME}/lib
export BASE_DIR ORACLE_SID ORACLE_HOME LOG_DIR LD_LIBRARY_PATH

#Check for Instance UP and Running
OPEN_MODE=`${ORACLE_HOME}/bin/sqlplus -s "/ as sysdba" <<EOF
set feedback off
set heading off
set echo off
select status from v\\$instance;
exit
<<EOF`

#Check for the status
if [ $? -eq 0 ]
then
echo "${ORACLE_SID} Instance is Up"
DUMPFILE=`${ORACLE_HOME}/bin/sqlplus -s "/ as sysdba" <<EOF
set feedback off
set heading off
set echo off
select value from v\\$parameter where name in ('core_dump_dest','user_dump_dest');
exit
<<EOF`
else
echo "${ORACLE_SID} Instance is Down!"
echo "Programme terminated!"
exit 1
fi

USER_DUMP_DEST= echo $DUMPFILE | awk '/udump/ {print $1;}'
CORE_DUMP_DEST= echo $DUMPFILE | awk '/cdump/ {print $2;}'
#Removing the files
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
echo " Starting to Remove files at ${DATE} \n"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"

find ${USER_DUMP_DEST} -type f -name "*.trc" -mtime +${DaysTokeep} -exec ls {} \;
Re: find command error [message #540427 is a reply to message #540426] Mon, 23 January 2012 08:48 Go to previous messageGo to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
But When I was running it MANUALLY
it is running fine.

find /db/dbdump/SID_NAME/udump -type f -name '*.trc' -mtime +3 -exec ls {} \;

[Updated on: Mon, 23 January 2012 08:49]

Report message to a moderator

Re: find command error [message #540428 is a reply to message #540427] Mon, 23 January 2012 08:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes but there you put the path NOT the variable.
So my question: "Are you sure USER_DUMP_DEST is set?"

Regards
Michel
Re: find command error [message #540429 is a reply to message #540428] Mon, 23 January 2012 08:54 Go to previous messageGo to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
No,
I have NOT set my USER_DUMP_DEST yet.
Can you please suggest how can I set my USER_DUMP_DEST?
Should I fire the below command?--
export user_dump_dest=${USER_DUMP_DEST}?

[Updated on: Mon, 23 January 2012 08:54]

Report message to a moderator

Re: find command error [message #540430 is a reply to message #540429] Mon, 23 January 2012 08:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Can you please suggest how can I set my USER_DUMP_DEST?

This is your script, do it as you want.

Quote:
Should I fire the below command?--
export user_dump_dest=${USER_DUMP_DEST

No this is irrelevant.

Regards
Michel
Re: find command error [message #540449 is a reply to message #540421] Mon, 23 January 2012 11:47 Go to previous messageGo to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
All,
Now I am facing the below error :-

su: USER_DUMP_DEST: Parameter not set.

Any idea how can i set the parameter?

thanks
p

[Updated on: Mon, 23 January 2012 11:48]

Report message to a moderator

Re: find command error [message #540450 is a reply to message #540449] Mon, 23 January 2012 12:03 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
USER_DUMP_DEST=/dev/null

[Updated on: Mon, 23 January 2012 12:12]

Report message to a moderator

Re: find command error [message #540451 is a reply to message #540450] Mon, 23 January 2012 12:15 Go to previous messageGo to next message
pokhraj_d
Messages: 117
Registered: December 2007
Senior Member
The below are my script :-
=================
DUMPFILE=`${ORACLE_HOME}/bin/sqlplus -s "/ as sysdba" <<EOF
set feedback off
set heading off
set echo off
select value from v\\$parameter where name in ('core_dump_dest','user_dump_dest');
exit
<<EOF`


USER_DUMP_DEST= echo $DUMPFILE | awk '/udump/ {print $1;}'

find ${USER_DUMP_DEST} -type f -name "*.trc"

While running the script I am getting the error "Parameter not set."

How Can set the parameter?

Thanks-
P
Re: find command error [message #540452 is a reply to message #540451] Mon, 23 January 2012 12:26 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>How Can set the parameter?
I already showed you how to set the value.
To what value should it be set?
Re: find command error [message #541978 is a reply to message #540426] Fri, 03 February 2012 10:04 Go to previous message
snaky
Messages: 1
Registered: February 2012
Location: India
Junior Member
Hi,

Try using
USER_DUMP_DEST= `echo $DUMPFILE | awk '/udump/ {print $1;}'`
instead of
USER_DUMP_DEST= echo $DUMPFILE | awk '/udump/ {print $1;}'

It should set the value for the variable Smile Smile Smile

Previous Topic: Can't See Newly Created LUN
Next Topic: Not able to transfer a file using SCP
Goto Forum:
  


Current Time: Fri Mar 29 06:48:11 CDT 2024