error in script path for tablespace usage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error in script path for tablespace usage
# 1  
Old 04-26-2009
error in script path for tablespace usage

Hi ,
I am trying to run this script in crontab but I get errors. When I run it explicitly like ./monitor_tblsp from another location then it runs fine . I am messing somewhere with paths but I don't know where and how . Please help .
Here is the error part

./monitor_tblsp[14]: touch: not found [No such file or directory]
./monitor_tblsp[15]: chmod: not found [No such file or directory]
./monitor_tblsp[16]: touch: not found [No such file or directory]
./monitor_tblsp[17]: chmod: not found [No such file or directory]
./monitor_tblsp[18]: touch: not found [No such file or directory]
./monitor_tblsp[19]: chmod: not found [No such file or directory]

Database Connection Information

Database server = DB2/LINUXX8664 9.5.0
SQL authorization ID = DB2ADMIN
Local database alias = WAG_HUB

TSP NAME TOTAL SPACE USED SPACE % USED

./monitor_tblsp: line 31: cat: not found
./monitor_tblsp[61]: sort: not found [No such file or directory]
./monitor_tblsp[68]: /tmp/tmp_fsps.out: cannot open [No such file or directory]
./monitor_tblsp[69]: rm: not found [No such file or directory]
./monitor_tblsp[70]: rm: not found [No such file or directory]
./monitor_tblsp: line 71: rm: not found


Here is some of the lines from the script

more monitor_tblsp
#!/bin/ksh
#Script to find tablespace usage

PATH=/usr/bin::/home/db2admin/sqllib/bin:/home/db2admin/sqllib/adm:/home/db2admin/sqllib/misc
DB2INSTANCE=db2admin
LD_LIBRARY_PATH=:/home/db2admin/sqllib/lib:/usr/lib:/lib
export PATH DB2INSTANCE


tmpfile_listts=/tmp/tmp_tsls.out
tmpfile_fsps=/tmp/tmp_fsps.out
tmpfile_fsps_sort=/tmp/tmp_fsps_sort.out

touch ${tmpfile_listts}
chmod 660 ${tmpfile_listts}
touch ${tmpfile_fsps}
chmod 660 ${tmpfile_fsps}
touch ${tmpfile_fsps_sort}
chmod 660 ${tmpfile_fsps_sort}

Thanks in advance !
# 2  
Old 04-27-2009
Add /bin to the PATH variable.

Regards
# 3  
Old 04-27-2009
It is working !

Thanks a lot sir Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script error on tape usage

getting ./query: 0403-057 Syntax error at line 1 : `|' is not expected. here is the top portion of the script below. #!/bin/ksh DATE=`date +%b-%d` TIME=`date +%H%M` TIMEA=`date +%H:%M` STAT=stat.csv USERID=user PASSWD=user_password COMD="dsmadmc -id=$USERID -password=$PASSWD... (1 Reply)
Discussion started by: rvstovall
1 Replies

2. Shell Programming and Scripting

Error in Scripting to monitor tablespace in Oracle DB

Buddies, I am writing the below script 'tab.sh' to monitor the tablespaces in Database:- ------------------------------- export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export PATH=$PATH:$ORACLE_HOME/bin export ORACLE_SID=orcl sqlplus system/oracle as sysdba <<EOF spool... (5 Replies)
Discussion started by: sandip250382
5 Replies

3. Shell Programming and Scripting

Path Error in script

Hi All, I copied an existing script so that I could make updates to it and test those updates. In both scripts I set the path which is the exact same in both scripts as I copied from the old to the new script. setting path is this command: # Add the path required for EMC commands to... (3 Replies)
Discussion started by: colinwilson1303
3 Replies

4. Shell Programming and Scripting

Script to check Oracle tablespace

I'm new to unix script, and I need to check the tablespaces daily, here is the script(quite simple), but it does not work. Did I missed something ? Please guide me, Many thanks ! #!/bin/sh echo "ORA TABLEASPACE:" sqlplus system/oracle as sysdba; set pagesize 9999; set linesize 132; ... (5 Replies)
Discussion started by: dehetoxic
5 Replies

5. Shell Programming and Scripting

tablespace monitoring script

I have prepared the below script to monitor the tablespace and alert the users whenever it reaches a threshold limit. #!/bin/sh . /home/.profile sqlplus -s $LOGON << .eof > $scripts/check_tablespace.temp set pages 0 select tablespace_name, free_percent from ( SELECT... (4 Replies)
Discussion started by: svajhala
4 Replies

6. Shell Programming and Scripting

alias to a shell script - tablespace size

I have developed the following shell script. The idea was to create an alias to execute it and return the tablespaces and their sizes from an oracle database. When I execute is via the alias, I have issues. So, here is the script first: > cat ts_size.sh #!/bin/ksh xwhere=" " xwild=" "... (8 Replies)
Discussion started by: desibabu
8 Replies

7. Shell Programming and Scripting

absolute path for a script ran with relative path

I have a script in which i want to print absolute path of the same script irrespective of path from where i run script. I am using test.sh: echo "pwd : `pwd`" echo "script name: $0" echo "dirname: `dirname $0`" when i run script from /my/test/dir/struct as ../test.sh the output i... (10 Replies)
Discussion started by: rss67
10 Replies

8. Shell Programming and Scripting

Need help in a shell script to edit a tablespace creation script.

Hi, CREATE TABLESPACE aps_blob_large01 DATAFILE '/c2r6u13/u03/oradata/qnoldv01/aps_blob_large0101.dbf' SIZE X 270532608 REUSE DEFAULT STORAGE (INITIAL 134217728 NEXT... (2 Replies)
Discussion started by: rparavastu
2 Replies

9. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

10. Shell Programming and Scripting

Shell Script to find the tablespace size in oracle.

Hi, I need to execute a script to find the tablespace size in oracle.But i get an error.:confused: Script Executed:- #!/bin/ksh ORACLE_SID= oracelinstance ORACLE_HOME= oracle path PATH=$ORACLE_HOME/bin export ORACLE_SID ORACLE_HOME PATH sqlplus... (4 Replies)
Discussion started by: vighna
4 Replies
Login or Register to Ask a Question