Sponsored Content
Top Forums Shell Programming and Scripting Cannot open [No such file or directory] Post 302663769 by duke0001 on Thursday 28th of June 2012 01:20:10 PM
Old 06-28-2012
Cannot open [No such file or directory]

I am seeking help on one script that I created to celan up database audit files. The error returned is

Code:
$./clean_audit.sh[41]: /opt/oracle/logs/audit_clean.log: cannot open [No such file or directory]

The same script is working on other 2 or 3 servers. But not working on other 4 servers. All servers are Oracle Linux. Here is my shell script:

Code:
#!/bin/ksh
# This shell performs a full clean audit files  of each DB that is running
export PATH=/opt/oracle/product/11.2.0.2/dbhome_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
export ORACLE_PATH=/opt/oracle/scripts/sql:$ORACLE_HOME/rdbms/admin
export SCRIPTSDIR=/opt/oracle/scripts
export SCRIPTSLOG=/opt/oracle/logs
export LOGFILE=$SCRIPTSLOG/audit_clean.log
export ORACLE_BASE=/opt/oracle
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15
export ORATAB=/etc/oratab
export ORACLE_HOME=/opt/oracle/product/11.2.0.2/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH:/usr/contrib/bin


if [ -f $LOGFILE ]; then
  rm $LOGFILE
fi

orasids=`cat /etc/oratab | grep '11.2.0.2/dbhome_1:Y$' | awk -F: '{print $1}' -`

for sid in ${orasids[*]}
do
export ORACLE_SID=$sid
export SYSPW=`cat /opt/oracle/scripts/cron/.sys_pw_$ORACLE_SID`
echo "----------------------------------------------" >> $LOGFILE
echo "Job: Clean Audit files" >> $LOGFILE
echo "Database: $ORACLE_SID \t \t \t \t Hostname: `hostname`" >> $LOGFILE
echo "----------------------------------------------" >> $LOGFILE

sqlplus -s  << EOF
/ as sysdba
@/opt/oracle/scripts/sql/clean_audit.sql
exit
EOF
done
exit 0

Please tell me why log file cannot be created and opened and also other problems it may contains. Thank you very much

Last edited by radoulov; 06-28-2012 at 06:38 PM.. Reason: please use code tags
 

9 More Discussions You Might Find Interesting

1. Programming

libRmath.so: cannot open shared object file: No such file or directory

% locate Rmath /m/backup/backup/lib/R/include/Rmath.h /usr/lib/R/include/Rmath.h % gcc -g -o stand stand.c -I/usr/lib/R/include/ -lRmath -lm % ./stand ./stand: error while loading shared libraries: libRmath.so: cannot open shared object file: No such file or directory What's the trouble... (6 Replies)
Discussion started by: cdbug
6 Replies

2. Solaris

Error- ld.so.1: expr: fatal: libgmp.so.3: open failed:No such file or directory

Hi Friends I have a compiler(Sun Forte,I believe) running in my Solaris 9 box. since y'day my development team is finding this error when they compile: ld.so.1: expr: fatal: libgmp.so.3: open failed: No such file or directory I ran a search for this file and found it in one of my file... (2 Replies)
Discussion started by: Hari_Ganesh
2 Replies

3. UNIX for Advanced & Expert Users

how to open a last modified file in a directory

how to directly open a last modified file in a directory? Please help (5 Replies)
Discussion started by: apsprabhu
5 Replies

4. Red Hat

libodbc.so.1: cannot open shared object file: No such file or directory

We are trying to install third party software on this unix server... Here is the error message we are getting... error while loading shared libraries: libodbc.so.1: cannot open shared object file: No such file or directory It seems like odbc driver is not installed... >rpm -q unixODBC... (1 Reply)
Discussion started by: govindts
1 Replies

5. Shell Programming and Scripting

fatal: cannot open file `TNAME' for reading (No such file or directory)

Hi, I am running this command through a shell script and getting the error mentioned in the subject line: testing.awk -f x.txt TNAME My testing.awk file contains something like ++++++++++++++++++ #!/usr/bin/awk -f BEGIN{ TAB_NAME="INSERT_ONE_" ARGV ; } if ( $1=="JAM_ONE" &&... (1 Reply)
Discussion started by: kunwar
1 Replies

6. Shell Programming and Scripting

Awk: cannot open file (No such file or directory)

Hello folks! I am new to Shell and awk scripting. This is my shell script that receives a string as an input from the user from the stdin. #!bin/sh printf "Enter your query\n" read query cmd=`echo $query | cut -f 1 -d " "` input_file=`echo $query | cut -f 2 -d " "` printf $input_file... (10 Replies)
Discussion started by: radiohead_
10 Replies

7. Solaris

./curl -V showing fatal: libldap.so.5: open failed: No such file or directory

Hi Guys, I am facing this Error bash-2.03$ ./curl -V ld.so.1: curl: fatal: libldap.so.5: open failed: No such file or directory Killed bash-2.03$ while executing ./curl -V in /opt/sfw/bin directory. I am using Sun Solaris 10. which package upgrage can give me this missing... (9 Replies)
Discussion started by: manalisharmabe
9 Replies

8. Linux

Cannot open shared object file: No such file or directory

Hi, While running tcpdump command on my Fedora 16 machine I am get shared library issue. # tcpdump tcpdump: error while loading shared libraries: libcrypto.so.6: cannot open shared object file: No such file or directory # which tcpdump /usr/software/sbin/tcpdump I have tried... (3 Replies)
Discussion started by: muzaffar.k
3 Replies

9. Shell Programming and Scripting

Linux open failed: No such file or directory error

Hi, The below commands works fine on serverB . /etc/profile; cd /export/home/user2/utils/plugin/ ./runme.shHowever, when i run the same commands from serverA it fails $ ssh -q user2@serverB ". /etc/profile; cd /export/home/user2/utils/plugin; ./runme.sh"Output Error: Please find the below... (8 Replies)
Discussion started by: mohtashims
8 Replies
INITSCRIPT(5)						Linux System Administrator's Manual					     INITSCRIPT(5)

NAME
initscript - script that executes inittab commands. SYNOPSIS
/bin/sh /etc/initscript id runlevels action process DESCRIPTION
When the shell script /etc/initscript is present, init will use it to execute the commands from inittab. This script can be used to set things like ulimit and umask default values for every process. EXAMPLES
This is a sample initscript, which might be installed on your system as /etc/initscript.sample. # # initscript Executed by init(8) for every program it # wants to spawn like this: # # /bin/sh /etc/initscript <id> <level> <action> <process> # # Set umask to safe level, and enable core dumps. umask 022 ulimit -c 2097151 PATH=/bin:/sbin:/usr/bin:/usr/sbin export PATH # Increase the hard file descriptor limit for all processes # to 8192. The soft limit is still 1024, but any unprivileged # process can increase its soft limit up to the hard limit # with "ulimit -Sn xxx" (needs a 2.2.13 or later Linux kernel). ulimit -Hn 8192 # Execute the program. eval exec "$4" NOTES
This script is not meant as startup script for daemons or somesuch. It has nothing to do with a rc.local style script. It's just a handler for things executed from /etc/inittab. Experimenting with this can make your system un(re)bootable. FILES
/etc/inittab, /etc/initscript. AUTHOR
Miquel van Smoorenburg ,<miquels@cistron.nl> SEE ALSO
init(8), inittab(5). July 10, 2003 INITSCRIPT(5)
All times are GMT -4. The time now is 02:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy