Solved

performance benchmark testing

Posted on 2010-09-22
8
953 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
This video discusses moving either the default database or any database to a new volume.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now