querying sysstat
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: querying sysstat

  1. #1
    Join Date
    Feb 2001
    Posts
    32
    I have been running this query all the time to monitor sorting in memory in relation to disk but today it's not working. Can anyone tell me where I'm missing something. I now it might be somethig trivial, but I still can't get it.



    SQL> select a.value "Disk Sorts", b.value "Memory Sorts",
    round(100 *b.value)/decode((a.value+b.value),
    0,1,(a.value+b.value)),2) "Pct Memory Sorts"
    from v$sysstat a, v$sysstat b
    where a.name = 'sorts (disk)'
    and b.name = 'sorts (memory)'
    0,1,(a.value+b.value)),2) "Pct Memory Sorts"
    *
    ERROR at line 3:
    ORA-00923: FROM keyword not found where expected


  2. #2
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    If you format the query a little bit it becomes easier to see:

    select
    a.value "Disk Sorts",
    b.value "Memory Sorts",
    round
    (100 *b.value) /
    decode(
    (a.value+b.value),
    0,1,(a.value+b.value)
    ),2
    ) "Pct Memory Sorts"
    from v$sysstat a, v$sysstat b
    where a.name = 'sorts (disk)'
    and b.name = 'sorts (memory)'

    ...that you are missing a ( after the call to round

    - Chris

Posting Permissions

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



Click Here to Expand Forum to Full Width