Solved

performance benchmark testing

Posted on 2010-09-22
8
963 Views
Last Modified: 2013-12-26
Hello Guys,

I didn't know where to ask this question, but I hope someone can help me.

I need to write a script to automate a number of procedures in Sybase IQ. I have been thinking alot about this and am really stuck.

This is what I need to automate:

1.sp_iqstatus (ideally this should be run every 15 mins)
2. IQ Monitor information (summary, cache & debug)

Does someone have a script to collect this sort of information?

Many Thanks!
0
Comment
Question by:SybaseUk
  • 4
  • 3
8 Comments
 

Author Comment

by:SybaseUk
ID: 33734938
Any update on this please?

I also need to collect sp_iqtransaction, sp_iqconnection and sp_iqlocks in my script...can somebody please help with this?

Do I need to post in a different zone?
0
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 33735099
No, you're in the right zone, there just aren't many of us posting answers to IQ questions. :)

I don't have any canned scripts I can pass on to you, but this is pretty simple, about as simple as scripting gets. All you need here is a simple wrapper that does an isql from the command line (or dbisql if you prefer - there are some tricks to making isql work with IQ but I find it's more flexible) that issues the relevant command(s) and sends them to an appropriately named output file.

You don't need anything fancy at the script level for this, as far as the bash script is concerned it is doing just one thing - calling isql which is redirecting its output to a script-controlled filename (typically with a timestamp in the name).

I suggest you have one script per command you want to run, each directing to its own output directory.

Running the jobs then is just a matter of putting the appropriate calls into crontab. Examining your output is probably also best done at the shell level - identify the KPIs you want and whip up something in Perl or grep/sed/awk to parse out the bits you want.

I don't have scripts for you to reuse for any of this because the scripting is so basic I just whip up a new set whenever I need them. :)

Let us know if you have any specific questions? I can walk you through most of this but I don't want to bury you in detail at this stage.
0
 

Author Comment

by:SybaseUk
ID: 33735949
Hi Joe...

Many thanks for your response....

Can you please whip up a skeleton script for me to collect sp_iqstatus (for an example).....

I have something like this:

vi perf_mon.sh
iqisql -UDBA -Psql -SIQDB << EOF
sp_iqstatus
go

Am I on the right track?
Do I need anything at the end of the file? How do I direct this output to a file?

Also, I need to run some monitoring, e.g.

IQ UTILITIES MAIN INTO dummy_table START MONITOR '-debug -file_suffix debug.txt -interval 5

How can I add the above into a script and have the output re-directed to a file?

Thanks Joe!
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 13

Expert Comment

by:alpmoon
ID: 33741229
You are on the right track. These additios are to re-direct the output to a file. You should add a path as well:

FILENAME='iqstatus.out'

iqisql -UDBA -Psql -SIQDB << EOF > $FILENAME
sp_iqstatus
go
EOF

Remaining is more shell scripting. I guess you can search on the web to find a sample script to add timestamp into filename by using date function and other improvements.

0
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 33741705
Something like this is what I usually use:


#!/bin/bash

USER="<user>"
PASS="<password>"
SERVER="<server>"
DIR="<path_to_store_files_in>"

FILE="${DIR}/iqstatus.${SERVER}.$( date +%Y%m%d%H%M )"

iqisql -U${USER} -S${SERVER} << EOF > ${FILE}
${PASS}
sp_iqstatus
go
EOF


You can substitute different commands and filenames for the other commands.
0
 

Author Comment

by:SybaseUk
ID: 33741879
Joe, that's exactly what I was looking for, thank you sir! Just out of curiosity, how would I hide the password in my script?

Also, how can I extract monitoring information to an output file using a script like the one above? By monitoring, I mean the 'IQ UTILITIES....' command....From my understanding, the monitoring stops once the session is terminated. So I need to make sure I keep the session open for a while...

I have something like this: -

#!/bin/bash

USER="<user>"
PASS="<password>"
SERVER="<server>"
DIR="<path_to_store_files_in>"

FILE="${DIR}/iqstatus.${SERVER}.$( date +%Y%m%d%H%M )"

iqisql -U${USER} -S${SERVER} << EOF > ${FILE}
${PASS}

set option public.MONITOR_OUTPUT_DIRECTORY = '/tmp'
go
IQ UTILITIES MAIN INTO iq_dummy START MONITOR '-debug -file_suffix debug.txt -append -interval 5'
go
IQ UTILITIES PRIVATE INTO iq_dummy START MONITOR '-debug -file_suffix debug.txt -append -interval 5'
go
WAITFOR DELAY '23:00:00'
go
EOF

I will then run this in the background, so the session isn't terminated so I keep collecting the monitor information as long as needed?

Will the above work?

Many Thanks!!



0
 
LVL 24

Accepted Solution

by:
Joe Woodhouse earned 500 total points
ID: 33743803
If you want to hide the password in the script, you can put it in a hidden file which can only be read by the Sybase login.

So say you create a file called /home/sybase/scripts/.password and put the password in it as the only text, then edit your script like this:

PASS=$( cat  /home/sybase/scripts/.password )

With the IQ MONITOR that should work, that would put everything into one file. If that's not what you want, you could monitor for a shorter time and have each script (say) monitor for 10 mins twice an hour or something.
0
 

Author Comment

by:SybaseUk
ID: 33744296
Thanks Joe!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
UNiX Script filesystem space usage Part2 54 88
EXCHANGE 2007, SCRIPTS 67 82
get remote physical servers and platforms 5 55
AWK: Pythagoras script 6 23
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question