Saturday 31 December 2016

Oracle Discoverer Query to find out Workbook, last run and number of time executed query

Oracle Discoverer Query to find out Workbook, last run and number of time executed query

SELECT A.* , B.TOTCOUNT FROM
(SELECT CASE WHEN  QS_DOC_OWNER IS NULL THEN 'E' ELSE QS_DOC_OWNER END  AS USERNAME , QS_DOC_NAME, QS_DOC_DETAILS, QS_CREATED_DATE LAST_USED, QS_NUM_ROWS
FROM MPEADEVL.EUL5_QPP_STATS
WHERE QS_ID IN(
  SELECT  MAX(QS.QS_ID)
    FROM MPEADEVL.EUL5_QPP_STATS QS, MPEADEVL.EUL5_DOCUMENTS DC
    WHERE QS.QS_DOC_NAME=DC.DOC_NAME
    GROUP BY QS_DOC_OWNER, QS.QS_DOC_NAME, QS.QS_DOC_DETAILS)
ORDER BY LAST_USED DESC) A,
(SELECT CASE WHEN  QS_DOC_OWNER IS NULL THEN 'E' ELSE QS_DOC_OWNER END AS USERNAME, QS_DOC_NAME, QS_DOC_DETAILS, COUNT(*) TOTCOUNT
FROM MPEADEVL.EUL5_QPP_STATS QS, MPEADEVL.EUL5_DOCUMENTS DC
    WHERE QS.QS_DOC_NAME=DC.DOC_NAME
    GROUP BY QS.QS_DOC_OWNER, QS.QS_DOC_NAME, QS.QS_DOC_DETAILS) B
WHERE A.QS_DOC_NAME=B.QS_DOC_NAME AND A.QS_DOC_DETAILS=B.QS_DOC_DETAILS AND A.USERNAME=B.USERNAME;

10 comments:

  1. Very good brief and this post helped me alot. Say thank you I searching for your facts. Thanks for sharing with us!

    angularjs2-Training in tambaram

    angularjs4-Training in tambaram

    angularjs6-Training in tambaram

    angularjs Training in chennai


    ReplyDelete
  2. I always enjoy reading quality articles by an individual who is obviously knowledgeable on their chosen subject. Ill be watching this post with much interest. Keep up the great work, I will be back
    Data Science Training in Chennai | Data Science course in anna nagar
    Data Science course in chennai | Data science course in Bangalore
    Data Science course in marathahalli | Data Science course in btm

    ReplyDelete
  3. Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
    If you are looking for any Big data Hadoop Related information please visit our website Hadoop Training Pune page!

    ReplyDelete
  4. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    data science training in chennai

    data science training in tambaram

    android training in chennai

    android training in tambaram

    devops training in chennai

    devops training in tambaram

    artificial intelligence training in chennai

    artificial intelligence training in tambaram

    ReplyDelete