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 !
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. HP-UX
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT NETBSD
npm-run-script
NPM-RUN-SCRIPT(1) NPM-RUN-SCRIPT(1)
NAME
npm-run-script - Run arbitrary package scripts
SYNOPSIS
npm run-script <command> [--silent] [-- <args>...]
alias: npm run
DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package
are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts.
As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is
used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your
script:
npm run test -- --grep="pattern"
The arguments will only be passed to the script specified after npm run and not to any pre or post script.
The env script is a special built-in command that can be used to list environment variables that will be available to the script at run-
time. If an "env" command is defined in your package, it will take precedence over the built-in.
In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by
locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your
package, you should write:
"scripts": {"test": "tap test/*.js"}
instead of
"scripts": {"test": "node_modules/.bin/tap test/*.js"}
to run your tests.
The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it
is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of `
https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration.
Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your
script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full
path you were in when you ran npm run.
npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is
passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the
default in npm v3), this is only performed when that node executable is not found in the PATH.
If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in
case you've forgotten.
You can use the --silent flag to prevent showing npm ERR! output on error.
You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially
undefined scripts without breaking the execution chain.
SEE ALSO
o npm help 7 scripts
o npm help test
o npm help start
o npm help restart
o npm help stop
o npm help 7 config
January 2019 NPM-RUN-SCRIPT(1)