troubleshooting Question

I am getting seemingly incomplete/inaccurate result from these SQL and I don't know why. Can you help debug?

Avatar of Enuda
Enuda asked on
LinuxDB2SQL
3 Comments1 Solution438 ViewsLast Modified:
Hi all, I have RHEL 4.x Linux, DB2UDBv8.2, run the followinf snapshot sql from my windows control center. I am getting results that don't seem correct to me and I would appreciate it if one or two experts can confirm my suspicion and perhaps point out the needed corrections to make:
THE SQL run from control center:

select total_log_available, total_log_used, sec_logs_allocated,sec_log_used_top,
      int(total_log_used/1024/1024) as "Log Used (Meg)",
      int(total_log_available/1024/1024) as "Log Space Free (Meg)",
      int((float(total_log_used) / float(total_log_used+total_log_available))*100) as "Pct Used",
      int(tot_log_used_top/1024/1024) as "Max Log Used (Meg)",
      int(sec_log_used_top/1024/1024) as "Max Sec. Used (Meg)",
      int(sec_logs_allocated) as "Secondaries"
from db2$mon_db
THE RESULT
TOTAL_LOG_AVAILABLE     TOTAL_LOG_USED     Log Used (Meg)     Log Space Free (Meg)
  2609024909                               2175091                          2                             2488

Pct Used                   Max Log Used (Meg)      Max Sec. Used (Meg)    Secondaries
  0 (WHY 0 ??)                          85                                      0                          0
  1 record(s) selected

And here's a linux   df -h disk usage showing the /dmi mount point where the log files are located.
[db2inst1@fsfntudb1 ~]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                             66G   34G   29G  55% /
                             Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p1      97M   41M   52M  45% /boot
none                           16G     0   16G   0% /dev/shm
/dev/sda1                 493G  370G   98G  80% /ald
/dev/sdb1                  99G   18G   76G  19% /ali
/dev/sdc1                  99G   93M   94G   1% /alt
/dev/sdd1               493G  242G  227G  52% /bbd
/dev/sde1               394G  224G  150G  60% /bbi
/dev/sdf1                 99G  7.8G   86G   9% /bbt
/dev/sdg1              345G  170G  158G  52% /dmd
/dev/sdh1                99G   53G   42G  56% /dmi  <<<---------logs
/dev/sdi1                 50G   85M   47G   1% /dmt
/dev/sdj1               345G  223G  105G  69% /dwd
/dev/sdk1                99G   11G   84G  11% /dwi
/dev/sdl1                 50G  4.0G   43G   9% /dwt
/dev/sdm1               99G  7.3G   87G   8% /stuff
/dev/sdn1              690G  176G  479G  27% /zled

Futhermore, a du command in the /dmi directory shows me this number (in bytes?) ---->>>53088276.
My question is: (1) Does anyone know what formula the linux df -h command uses to compute the above storage space numbers? (2) If I issue a linux du command, the result is in bytes or kilobytes?
(3) Looking at the SQL above, why is the "Pct Used" column zero (0)? Is it a rounding issue and how to solve it with an example?
(4) Why is TOTAL_LOG_USED (217509 meg) so different from du (directory usage 53088276 (in bytes and converted to meg?)).

Can someone please educate me what I am looking at when I see these numbers. They don't add up for me and I need to be able to rely on these numbers.

Thanks
ASKER CERTIFIED SOLUTION
momi_sabag

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros