Tuesday, October 2, 2012

To Find users in Database.


There will times when you want to find the user in the database. Its simple command but need system user access to the database.
For Linux user 
1. Login to oracle user.
2. Login to Sqlplus using the system user credentials. 
3. Type the Command 
                   
                   select username form dba_users;

4. You can also find other columns describing the dba_users.

                   desc dba_users;

Problem that might me encountered Sqlplus command not found.
1. Check whether ORACLE_BASE is set . It should be oracle installed directory.
       ORACLE_BASE=/<home directory of  oracle>/oracle

2. Check whether ORACLE_HOME is set. 
3. Check whether ORACLE_SID is set. This should be set to current running database instance.
4. Check whether LD_LIBRARY_PATH=$ORACLE_HOME/lib is set. 
5. Check whether PATH variable is set to bin folder in ORACLE installed directory.   
                          PATH=$PATH:$ORACLE_HOME/bin