SQLPlus Usage

good links

http://psoug.org/reference/sqlplus.html

 

Connect your self as DBA,  sys/sysman account;

conn  sys/password@orcl as sysdba;

 

 

There are many users on a full installation of Oracle, most of which you probably won’t need. To lock an Oracle user account, you can use the following command:

alter user username account lock;

To unlock the user, simply replace ‘lock’ with ‘unlock.’

Oracle comes with a few default accounts that should never be locked or dropped. These include: SYS, SYSTEM, SYSMAN (Oracle 10g), OUTLN. However, you do want always to change the password for these users. The default password for SYS is change_on_install. It is important that you follow these directions. To change the password for a user:

alter user username identified by new_password;

For non-critical users, you can always lock and expire the account. We can change the password for, lock, and expire the account CTXSYS all at once:

alter user ctxsys identified by 0bscur3 account lock password expire;

To make the password can not expired.

alter profile default limit password_life_time unlimited;

Unlike older releases, Oracle 11g sets password expiry by default. That's really annyoing

  • for SYS and SYSTEM: noboday wants to regularly change (and forget) them.
  • for any accounts that are used by application servers: the password is usually configured in a datasource file, nobody would ever want to change it
  • if some superusers directly access the DB and keep forgetting the password, the automatic locking will lock your application out: not great for your uptime.

So let’s get rid of these annoyances with: ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED PASSWORD_LIFE_TIME UNLIMITED;

One way to do this is to change the profile in the enterprise manager. You log on as sys/sysdba, go to Server->Profiles->Default->Edit->Password->Expire in->Unlimited. That’s it. I don’t know if this will change once set Expiration Dates as well, otherwise re-set the profile on the user (in enterprise mgr again)


 


Advertisements