Skip to content

Instantly share code, notes, and snippets.

@stelf
Last active July 19, 2021 09:38
Show Gist options
  • Save stelf/74627a70b09cc0454282c46dbafd2ae6 to your computer and use it in GitHub Desktop.
Save stelf/74627a70b09cc0454282c46dbafd2ae6 to your computer and use it in GitHub Desktop.
query oracle usage stats
--- # this GIST is available under the conditions of
--- # https://creativecommons.org/licenses/by/4.0/
SELECT
MAX(LAST_SAMPLe_DATE) AS "Last use",
NAME AS "Name",
CAST (TO_CHAR(SUM(DETECTED_USAGES) / SUM(TOTAL_SAMPLES) * 100, '999') AS VARCHAR2(5)) AS "%"
FROM
dba_feature_usage_statistics
WHERE
CURRENTLY_USED = 'TRUE'
GROUP BY
NAME,
CURRENTLY_USED
HAVING
SUM(DETECTED_USAGES) > 0
ORDER BY
NAME ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment