Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 994
  • Last Modified:

performance benchmark testing

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
SybaseUk
Asked:
SybaseUk
  • 4
  • 3
1 Solution
 
SybaseUkAuthor Commented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
SybaseUkAuthor Commented:
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 
alpmoonCommented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
SybaseUkAuthor Commented:
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
 
Joe WoodhousePrincipal ConsultantCommented:
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
 
SybaseUkAuthor Commented:
Thanks Joe!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now