Skip to content

Instantly share code, notes, and snippets.

@mujahidk
Last active August 29, 2015 14:02
Show Gist options
  • Save mujahidk/226195b85be7690b2c43 to your computer and use it in GitHub Desktop.
Save mujahidk/226195b85be7690b2c43 to your computer and use it in GitHub Desktop.
Oracle day2day db information queries
-- db version and other information
SELECT * FROM V$VERSION;
SELECT * FROM PRODUCT_COMPONENT_VERSION;
SELECT SYS_CONTEXT('USERENV','SERVICE_NAME') FROM DUAL;
SELECT * FROM GLOBAL_NAME;
-- database instance, host name, version, status, startup time etc.
SELECT * FROM V$INSTANCE;
SELECT * FROM V$PARAMETER;
SELECT * FROM V$SESSION;
-- get the list of sql statements executed & executing*.
SELECT * FROM V$SQL ORDER BY LAST_LOAD_TIME DESC;
-- Database time zone and system date
SELECT DBTIMEZONE, SYSDATE FROM DUAL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment