Tag Archives: SQL

Getting List of Users and Roles on Oracle DB

This is a simple SQL statement to get you a list of all users and their roles in the Oracle DB: “SELECT * FROM DBA_role_privs;” And if you want to get the list of users related to a specific role, … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

How to switch from one user to another in sqlplus

for example, you’re connected as sysdba using “sqlplus / as sysdba”, all you have to do is type “connect”, then enter the desired username and password, and there you go!

Posted in Uncategorized | Tagged , , , | 1 Comment

SQL Statement to get version of your Oracle DB

> sqlplus / as sysdba SQL> select * from v$version; BANNER ——————————————————————————– Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production PL/SQL Release 11.2.0.2.0 – Production CORE 11.2.0.2.0 Production TNS for Linux: Version 11.2.0.2.0 – Production NLSRTL Version 11.2.0.2.0 … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

How to query Oracle DB 11g for user account status

select USERNAME,ACCOUNT_STATUS from dba_users where USERNAME=’PUT_YOUR_USER_NAME_HERE’; Sample output: USERNAME                                    ACCOUNT_STATUS ——————————           ——————————– SADMIN           … Continue reading

Posted in Oracle | Tagged , , , | Leave a comment

How to run the Oracle Data Pump Command as sysdba

If you have access to the Oracle DB server OS and user (e.g. via ssh or telnet), then you don’t need to have credentials for any DB user to be able to run the data pump commands, all you have … Continue reading

Posted in Oracle | Tagged , , , , , | Leave a comment

SQL statement to unlock user account in oracle

ALTER USER username ACCOUNT UNLOCK;

| Tagged , , | Leave a comment

The sql_check_rw file contents in the last post

sqlplus -s “/ as sysdba” <<EOF set heading off feedback off termout off select OPEN_MODE from v\$database; exit EOF

| Tagged | Leave a comment