CSsize_profiling_db2.sql 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. -- Licensed Materials - Property of IBM
  2. --
  3. -- BI and PM: CM
  4. --
  5. -- (C) Copyright IBM Corp. 2008, 2014
  6. --
  7. -- US Government Users Restricted Rights - Use, duplication or disclosure
  8. -- restricted by GSA ADP Schedule Contract with IBM Corp.
  9. -- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. -- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. select count(*) as "total number of objects" from CMOBJECTS;
  12. select c.NAME as "class name", count(*) as "number of objects"
  13. from CMOBJECTS o, CMCLASSES c
  14. group by o.CLASSID, c.CLASSID, C.NAME
  15. having c.CLASSID=o.CLASSID
  16. order by c.NAME;
  17. select c.NAME as "class name", count(*) as "number of secured objects"
  18. from CMOBJECTS o, CMCLASSES c, CMPOLICIES p
  19. where o.CMID=p.CMID and p.POLICIES is not null
  20. group by o.CLASSID, c.CLASSID, C.NAME
  21. having c.CLASSID=o.CLASSID
  22. order by c.NAME;
  23. select count(*) as "Total outputs",
  24. SUM(cast(coalesce(LENGTH(DATAPROP),0) as bigint)) as "Total size of outputs"
  25. from CMDATA
  26. where DATAPROP is not NULL;
  27. select count(*) as "Outputs under 10KB" from CMDATA
  28. where DATAPROP is not NULL and LENGTH(DATAPROP) < 10240;
  29. select count(*) as "Outputs 10KB - 100KB" from CMDATA
  30. where LENGTH(DATAPROP) >= 10240 and LENGTH(DATAPROP) < 102400;
  31. select count(*) as "Outputs 100KB - 1MB" from CMDATA
  32. where LENGTH(DATAPROP) >= 102400 and LENGTH(DATAPROP) < 1048576;
  33. select count(*) as "Outputs 1MB - 10MB" from CMDATA
  34. where LENGTH(DATAPROP) >= 1048576 and LENGTH(DATAPROP) < 10485760;
  35. select count(*) as "Outputs 10MB -100MB" from CMDATA
  36. where LENGTH(DATAPROP) >= 10485760 and LENGTH(DATAPROP) < 104857600;
  37. select count(*) as "Outputs 100MB - 1GB" from CMDATA
  38. where LENGTH(DATAPROP) >= 104857600 and LENGTH(DATAPROP) < 1073741824;
  39. select count(*) as "Outputs > 1GB" from CMDATA
  40. where LENGTH(DATAPROP) >= 1073741824;
  41. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  42. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS7 p
  43. where o.CMID=p.CMID and p.SPEC is not NULL
  44. group by o.CLASSID, c.CLASSID, C.NAME
  45. having c.CLASSID=o.CLASSID
  46. order by c.NAME;
  47. select count(*) as "Specifications < 10KB" from CMOBJPROPS7
  48. where SPEC is not NULL and LENGTH(SPEC) < 10240;
  49. select count(*) as "Specifications 10KB - 100KB" from CMOBJPROPS7
  50. where LENGTH(SPEC) >= 10240 and LENGTH(SPEC) < 102400;
  51. select count(*) as "Specifications 100KB - 1MB" from CMOBJPROPS7
  52. where LENGTH(SPEC) >= 102400 and LENGTH(SPEC) < 1048576;
  53. select count(*) as "Specifications > 1MB" from CMOBJPROPS7
  54. where LENGTH(SPEC) >= 1048576;
  55. select count(*) as "Total number of models" from CMOBJPROPS7
  56. where CMODEL is not NULL;
  57. select count(*) as "Models < 10KB" from CMOBJPROPS7
  58. where LENGTH(CMODEL) < 10240;
  59. select count(*) as "Models 10KB - 100KB" from CMOBJPROPS7
  60. where LENGTH(CMODEL) > 10240 and LENGTH(CMODEL) < 102400;
  61. select count(*) as "Models 100KB - 1MB" from CMOBJPROPS7
  62. where LENGTH(CMODEL) > 102400 and LENGTH(CMODEL) < 1048576;
  63. select count(*) as "Models > 1MB" from CMOBJPROPS7
  64. where LENGTH(CMODEL) > 1048576;
  65. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  66. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS34 p
  67. where o.CMID=p.CMID and p.SPEC is not NULL
  68. group by o.CLASSID, c.CLASSID, C.NAME
  69. having c.CLASSID=o.CLASSID
  70. order by c.NAME;
  71. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  72. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS43 p
  73. where o.CMID=p.CMID and p.SPEC is not NULL
  74. group by o.CLASSID, c.CLASSID, C.NAME
  75. having c.CLASSID=o.CLASSID
  76. order by c.NAME;
  77. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  78. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS66 p
  79. where o.CMID=p.CMID and p.SPEC is not NULL
  80. group by o.CLASSID, c.CLASSID, C.NAME
  81. having c.CLASSID=o.CLASSID
  82. order by c.NAME;
  83. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.RELATED),0) as bigint)) as "Total size of specifications"
  84. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS14 p
  85. where o.CMID=p.CMID and p.RELATED is not NULL
  86. group by o.CLASSID, c.CLASSID, C.NAME
  87. having c.CLASSID=o.CLASSID
  88. order by c.NAME;
  89. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  90. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS63 p
  91. where o.CMID=p.CMID and p.SPEC is not NULL
  92. group by o.CLASSID, c.CLASSID, C.NAME
  93. having c.CLASSID=o.CLASSID
  94. order by c.NAME;
  95. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  96. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS42 p
  97. where o.CMID=p.CMID and p.SPEC is not NULL
  98. group by o.CLASSID, c.CLASSID, C.NAME
  99. having c.CLASSID=o.CLASSID
  100. order by c.NAME;
  101. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  102. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS68 p
  103. where o.CMID=p.CMID and p.SPEC is not NULL
  104. group by o.CLASSID, c.CLASSID, C.NAME
  105. having c.CLASSID=o.CLASSID
  106. order by c.NAME;
  107. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  108. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS56 p
  109. where o.CMID=p.CMID and p.SPEC is not NULL
  110. group by o.CLASSID, c.CLASSID, C.NAME
  111. having c.CLASSID=o.CLASSID
  112. order by c.NAME;
  113. select c.NAME as "class name", count(*) as "Total number of specifications", SUM(cast(coalesce(LENGTH(p.SPEC),0) as bigint)) as "Total size of specifications"
  114. from CMOBJECTS o, CMCLASSES c, CMOBJPROPS57 p
  115. where o.CMID=p.CMID and p.SPEC is not NULL
  116. group by o.CLASSID, c.CLASSID, C.NAME
  117. having c.CLASSID=o.CLASSID
  118. order by c.NAME;
  119. WITH CMPROFILE (CMID, CLASSID, NOBJECTS) AS
  120. (SELECT o.PCMID, p.CLASSID, count(*) from CMOBJECTS o left outer join CMOBJECTS p on o.PCMID=p.CMID
  121. where p.CLASSID = 1 or p.CLASSID=17 or p.CLASSID=12 or p.CLASSID=9
  122. group by o.PCMID, p.CLASSID)
  123. select c.NAME as "object class", pr.NOBJECTS as "number of children", count(*) as "number of objects"
  124. from CMPROFILE pr left outer join CMCLASSES c on pr.CLASSID=c.CLASSID
  125. group by c.NAME, pr.NOBJECTS
  126. order by c.NAME, pr.NOBJECTS;
  127. select TYPE as "schedule type", count(*) "number of schedules"
  128. from CMOBJPROPS2 where ACTIVE=1 and TYPE is not NULL
  129. group by TYPE;
  130. WITH CMPROFILE (CMID, CLASSID, NOBJECTS) AS
  131. (SELECT o.PCMID, p.CLASSID, count(*) from CMOBJECTS o left outer join CMOBJECTS p on o.PCMID=p.CMID
  132. where p.CLASSID = 55 and o.CLASSID = 57 or o.CLASSID=17
  133. group by o.PCMID, p.CLASSID)
  134. select c.NAME as "object class", pr.NOBJECTS as "number of children", count(*) as "number of objects"
  135. from CMPROFILE pr left outer join CMCLASSES c on pr.CLASSID=c.CLASSID
  136. group by c.NAME, pr.NOBJECTS
  137. order by c.NAME, pr.NOBJECTS;
  138. select count(*) as "Number of empty policies" from CMPOLICIES
  139. where LENGTH(POLICIES) = 0;
  140. select count(*) as "Policies 1-127 bytes" from CMPOLICIES
  141. where LENGTH(POLICIES) >= 1 and LENGTH(POLICIES) <= 127;
  142. select count(*) as "Policies 128-255 bytes" from CMPOLICIES
  143. where LENGTH(POLICIES) >= 128 and LENGTH(POLICIES) <= 255;
  144. select count(*) as "Policies 256-511 bytes" from CMPOLICIES
  145. where LENGTH(POLICIES) >= 256 and LENGTH(POLICIES) <= 511;
  146. select count(*) as "Policies 512-1023 bytes" from CMPOLICIES
  147. where LENGTH(POLICIES) >= 512 and LENGTH(POLICIES) <= 1023;
  148. select count(*) as "Policies 1K-2K" from CMPOLICIES
  149. where LENGTH(POLICIES) >= 1023 and LENGTH(POLICIES) <= 2047;
  150. select count(*) as "Policies 2K-4K" from CMPOLICIES
  151. where LENGTH(POLICIES) >= 2048 and LENGTH(POLICIES) <= 4095;
  152. select count(*) as "Policies 4K-6K" from CMPOLICIES
  153. where LENGTH(POLICIES) >= 4096 and LENGTH(POLICIES) <= 6143;
  154. select count(*) as "Policies 6K-8K" from CMPOLICIES
  155. where LENGTH(POLICIES) >= 6144 and LENGTH(POLICIES) <= 8191;
  156. select count(*) as "Policies > 8K" from CMPOLICIES
  157. where LENGTH(POLICIES) > 8192;
  158. select count(*) as "Archive queue size" from CMARCHIVEQUEUE;
  159. select count(*) as "Delete queue size" from CMDELETEQUEUE;