Тетрадочка DBA

Posts Tagged ‘top 10’

Задача «WF clean»

Posted by shane54lv на 22 Май, 2009

Какие-то запросы из той задачи:

SELECT   item_type, COUNT (item_key)
    FROM applsys.wf_items
GROUP BY item_type;

SELECT t1.segment_name, ROUND (t1.BYTES / 1024 / 1024, 0) AS "Mb"
  FROM dba_segments t1
 WHERE t1.owner = 'APPLSYS'
   AND t1.segment_name IN
          ('WF_ITEMS',
           'WF_ITEM_ACTIVITY_STATUSES',
           'WF_ITEM_ACTIVITY_STATUSES_H',
           'WF_NOTIFICATIONS',
           'WF_NOTIFICATION_ATTRIBUTES',
           'WF_COMMENTS',
           'WF_ITEM_ATTRIBUTE_VALUES',
           'WF_DIG_SIGS'
          );

SELECT COUNT (item_key)
  FROM apps.wf_items
 WHERE item_type = 'WFERROR';

SELECT COUNT (*)
  FROM applsys.wf_items
 WHERE item_type = 'WFERROR';

SELECT COUNT (*)
  FROM applsys.wf_items
 WHERE TRUNC (end_date) = TO_DATE ('13.06.2008', 'dd.mm.yyyy');

SELECT *
  FROM dba_indexes t1
 WHERE t1.owner = 'APPLSYS'
   AND t1.status != 'VALID'
   AND t1.table_name IN
          ('WF_ITEMS',
           'WF_ITEM_ACTIVITY_STATUSES',
           'WF_ITEM_ACTIVITY_STATUSES_H',
           'WF_NOTIFICATIONS',
           'WF_NOTIFICATION_ATTRIBUTES',
           'WF_COMMENTS',
           'WF_ITEM_ATTRIBUTE_VALUES',
           'WF_DIG_SIGS'
          )
Реклама

Posted in Query'ы | Отмечено: , , , | Leave a Comment »