linmatty/all
Thanks! I kinda figured out what is going on. Sometime after the creation of the msg$$ file there is an additional line of data put into it from vmstat. If I stop the program at a certain point I can see two lines of numbers. I'm not sure if that is normal for vmstat or if it...
linmatty,
It does print a header, but that header exists in the static file as well. I only get double the output from the second script (note the sections that were commented have been uncommented and instead of looking at msg.txt it is reading msg$$ which is created by vmstats).
Final problem. These scripts work for a static file, but for some reason the script returns different values when sending vmstats to a file. Here is the entire script with output depending on what is commented out:
#!/bin/ksh
ORACLE_HOME=/tpsw/app/oracle/product/8.1.7
SERVER_NAME=`uname...
vgersh99,
I tried the read at the end when I first put the program together and it would not read. Moving it to the beginning got it to work correctly.
I'll copy and paste your script into unix and try again.
linmatty,
I'll try yours too.
Ok, I just noticed that the file had tmp/msg*
msg* being the key here. It was reading all the msg files in tmp (which there were a few).
I reran:
while read name1 name2 name3
do
echo 'start second loop'
sed -e '1,4d' -e 's/^[ ]*//g' /tmp/msg18145 | nawk -F '[ ][ ]*' ' {printf("%d %d...
vgersh99,
the command reproduces a line of data, but I want to put parts of that line ($1, $8, $9, $14, $15, $16, $17) into variable for inserting (echoing in my example) into a table. I am anticipating having the data from 'column' 1, 'column' 8, 'column' 9, etc in variables name1, name2...
linmatty,
It really has nothing to do with oracle, I am just reading in some server stats from a file that is updated constantly on the oracle server. The file is three rows long with several 'columns' of data on server statistics.
The last run I used this script:
while read name1 name2...
sample msg file:
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id
0 0 0 18288 5744 4 114 67 7 2265 0 3809 0 0 0 0 633 2656 1218 18 12 70
*note there are only three rows, the one...
linmatty,
I need the loop to do an insert into from the file to a table. That part works. :)
But this sed/awk/print/printf business is spitting out the wrong stuff.
Let me past the entire while loop:
while read RUNQUEPAGE_IN PAGE_OUT USER_CPU SYSTEM_CPUIDLE_CPU WAIT_CPU
do
echo 'start second loop'
cat /tmp/msg$$ | sed 1,4d | nawk -F "[ ][ ]*" '{ print $1 $8 $9 $14 $15 $16 $17 }'
#$ORACLE_HOME/bin/sqlplus xxx/xxx@xxx<<EOF
# insert into...
Yeah, but this is what I get weather I use printf or print
,
devcix
memory
page
faults cpu
The spaces represent nulls but you can see what it is grabbing. It does this three times for the different lines.
,
devcix
b
w
free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id
Then...
I'm trying to grab the value at 1, 8, 9, etc.
I'm using this script from a DBA tuning sight:
http://oracle.oreilly.com/news/unix_oracle_0101.html
This part confuses me as I am not a Unix guru. Even the way he defines it does not seem to work (as the man pages define it). The output I get...
I have a file that looks like:
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr m0 m1 m3 m4 in sy cs us sy id
0 0 0 1888 776 4 109 65 6 2277 0 3771 0 0 0 0 625 2371 1162 16 12 72
It was built from vmstat for...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.