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:
The alias defined is:
When I execute the shell script via the alias: notice I get some ksh not found and a 14873 and my command prompt etc.. AND when the shell finishes, I don't get my prompt back...
When I press enter then I get the following:
and I get my prompt.
When I execute it directly as a shell script. I get the following:
Here too, I don't get the prompt back. I have to press the enter key to get my prompt back.
Any idea what I need to do to fix all these?
Thanks
Moderator's Comments:
Please use code tags, and indent your code / output, etc.
Last edited by Scott; 01-13-2011 at 02:12 PM..
Reason: Code tags; spacing.
Wow..such obvious mistakes...well most of my problems have been resolved. One issue remains...for some reason, one of the variables remains defined between runs. i.e. The first time I run it with a parameter (wild card for tablespace names) it seems to carry that over into the next execution.
Last edited by Scott; 01-13-2011 at 01:33 PM..
Reason: Code tags; spacing.
... but as it errors on my system it is hard to work out what it is meant do do. It is very unusual to use backticks inside parentheses. If we take the backticks away then it calculates where the "%" character is in the parameter $1 or returns zero if there is no "%" character.
Any ideas/suggestions where I can look to resolve this last remaining puzzle?
I have no clue what could be causing this. I checked the env variables, there is nothing there defined that is being used in the shell script. I am not doing an export of any variables.
Hi
can some one please help me how i can get the output i require:
My text file "sample.txt" contains the text like below
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_fedora-lv_root
15G 2.6G 12G 19% /hari
Filesystem Size ... (3 Replies)
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)
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)
Hi
Linux
Set up - alias ls='ls -l'
Then run script
#! /bin/ksh
sub()
{
ls
}
sub
Is there any way to get it working. I don't want to define alias inside of the program
Thank you (2 Replies)
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: touch: not... (2 Replies)
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)
Bourne: How to invoke an alias from within a shell script
If I type in the alias in the command line, it runs
If I insert that same alias into my shell script and run the shell script, the alias is not invoked.
Help please. (2 Replies)
Hi,
I want to use an 'if statement' that will check if a certian file is greater in size than a certain value given by the user, but cannot get it to work. Do you have any ideas how this can be done?
Your help is appreciated! (6 Replies)