Sunday, September 7, 2014

Oracle 11g User Account Admin


Logging onto SQLPLUS without login:
C:\> sqlplus /nolog
SQL> Connect / as sysdba

Check usernames and account status:
SQL> Select username, ACCOUNT_STATUS, EXPIRY_DATE from dba_users;
* This generates a table of users, whether account is open, expired, or locked, and expiry dates.

USERNAME                       ACCOUNT_STATUS                   EXPIRY_D
------------------------------ -------------------------------- --------
MGMT_VIEW                      OPEN
SYS                            OPEN
SYSTEM                         OPEN
[...]
DBSNMP                         EXPIRED                          24/05/10
SYSMAN                         EXPIRED                          24/05/10
OUTLN                          EXPIRED & LOCKED                 16/11/09
FLOWS_FILES                    EXPIRED & LOCKED                 16/11/09

Create a user in SQLPLUS:
at SQL>, type:
SQL> Create User <username> identified by <pwd>
SQL> Default Tablespace <username>
SQL> Temporary Tablespace temp;

Note: one semi-colon at the end.

User was already created, change password:
SQL> Alter User sys identified by new_password:

Remove Expiration for user:
SQL> Alter profile default
SQL> Limit password_life_time Unlimited

Check to see if password works:
SQL> Connect sysman/<new_password>

Then you can exit out of Sqlplus at prompt.

Sometimes it may be necessary to refresh Enterprise Manager to the database instance after that.
Then do the following:

1. C:\>SET ORACLE_SID=<The database SID>
2. C:\ emctl stop dbconsole
3. Go to ORACLE_HOME/<HostName_SID>/sysman/config and save a backup of emoms.properties file.
4. Open the emoms.properties file and replace the encrypted value with new password value on line:oracle.sysman.eml.mntr.emdRepPwd=<some encrypted value>
5. Change oracle.sysman.eml.mntr.emdRepPwdEncrypted=TRUE to False.
6. Save and close emoms.properties
7. Restart the dbconsole: emctl start dbconsole
8. Open emoms.properties again and you can see the password is now encrypted.

ORACLE DB SUPPORT LIBRARY IS LOCATED AT:

http://docs.oracle.com/cd/E11882_01/index.htm










No comments:

Post a Comment