Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    24

    Unanswered: Script to show Top-Users and/or Top-DBs

    I have the following Problem, we have a big DB2-Server with 63 Databases.
    And the Hardware is crap.

    So sometimes the phone rings and someone asks me "Why is the server so slow" and then i had to connect to the DB and start looking.

    Now i have the idea to write a script in some language to do this automated for me. So when the phone again rings, i only have to start the script and see why the server is at 100% CPU usage.

    I hope someone could help, or give me an idea.

    jhp
    black_

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you are running DB2 for Linx, Windows, or UNIX then having 63 active databases at one time is not a good idea. Each database uses a certain amount of memory that is not shared between the databases. You might want to consider consolodating databases and using schemas to keep the data seperate.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Nov 2003
    Posts
    24
    Its our Development Server so the performance is not so critical.
    But if someone locks the server complete up, i want to know who it is.

    About the transfer in schemas, i recommend this a time ago, but noone wants it.
    And if they are pleased with the performance, why should i keep trying.

    jhp
    black_

  4. #4
    Join Date
    Jan 2004
    Location
    Egypt
    Posts
    61
    if u running UNIX or linux try this sheel script, then see which process get max CPU tics "C" column



    if [ $1 eq '']
    then
    a=1
    else
    a=$1
    fi

    if [ $1 eq '']
    then
    b=25
    else
    b=$2
    fi

    while true
    do
    vmstat 1 2 > /tmp/process.out
    echo "-------------------------------------------------------------------" >> /tmp/process.out
    print " ORDER BY CPU Ticks [ C ]" >> /tmp/process.out
    print " UID PID PPID C STIME TTY TIME CMD " >> /tmp/process.out
    echo "-------- ---- ------ --- -------- ------ ----- --------------------" >> /tmp/process.out
    ps -ef | sort -rn +3 | head -n $b >> /tmp/process.out

    clear
    head -n $b /tmp/process.out
    sleep $a
    done
    hany heggy,
    IBM certified Professional, AIX system support
    www.melodyhits.tv

  5. #5
    Join Date
    Nov 2003
    Posts
    24
    Thx for the script, but i forget to mention that the server is UDB 8.1 on Windows 2000 Server.

    jhp
    black_

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •