Helpful Queries

To check out the version of the Oracle database

SQL> SELECT * FROM V$VERSION;

To view the locations of the control, log and data files

SQL> SELECT * FROM V$CONTROLFILE;
SQL> SELECT * FROM V$LOGFILE;
SQL> SELECT * FROM V$DATAFILE;

To check all the system privileges granted to roles and users

SQL> SELECT * FROM SYS.DBA_SYS_PRIVS;

To check all the roles granted to user and other roles

SQL> SELECT * FROM DBA_ROLE_PRIVS

To see is there are any users logged on to Oracle database

SQL> SELECT USER#,USERNAME, STATUS FROM V$SESSION;