Two implementation methods for Oracle user unlocking commands

Source: Internet
Author: User

After installing Oracle 10 Gb, I want to enable SQL * plus for learning, and then follow the steps in the book to connect to the database with scott user. After the installation, an error is prompted several times.

Error: the account is locked

Then I checked the Internet and found that the user was locked. The reason why the user was locked may be the following.

1. Failed to log on multiple times. (The password may be incorrect)

2. the user is manually locked by the Administrator.

3. the user password expires. The password has not been modified on time...

This user is definitely unable to log on, and then I log on with the user "system", but I haven't logged on for half a day and went online to check again, most of the users and passwords on the Internet are about oracle 9i. Later I remember that I was prompted to enter the password during installation. I tried it and connected it, therefore, in oracle 10 Gb system, the user's password is not the default one, but is set during installation.

After logging in with system, run the following command:

 
 
  1. SQL> alter user scott account unlock; 

The user has changed.

This completes the unlock operation. Next, you can set a new password for scott.

Modify scott's logon Password

 
 
  1. SQL> alter user scott identified by pan; 

The user has changed.

OK. You can log on to scott and pan again!

 
 
  1. SQL> conn scott/pan 

Connected.

After the new Oracle 10 Gb is installed, the system/password can be used to log on normally, but the scott/tiger user cannot log on:

 
 
  1. conn scott/tiger   
  2. error:Oracle 10g the account is locked   
  3. Oracle 10g the password has expired 

Cause: Oracle 10 Gb scott cannot log on by default. Disabled.

Solution:

First, confirm that the oracle database and client have been installed.

. Execute the following statement in the DOS client:

Note the symbol

 
 
  1. C: \ sqlplus/nolog
  2. Sqlp \ conn sys/system @ oracle10AsSysdba // sys is the current oracle user system. The password oracle10 is SID.
  3. #Alter UserSoctt account lock; // lock scott user
  4. #Alter UserScott account unlock; // unlock the scott user
  5. #Alter UserScott identifiedByScott // change scott's user password to scott, and scott's user's default password to tiger

1 input C: \ sqlplus/nolog in Dos

2. Log On As A DBA

 
 
  1. conn sys/password as sysdba;  

3 unlock

 
 
  1. alter user scott account unlock; 

4. A dialog box is displayed to change the password.

 
 
  1. Conn scott/tiger
  2. SQL> conn sys/sysAsSysdba;
  3. Connected.
  4. SQL>Alter UserScott account unlock;
  5. UserAltered.
  6. SQL>Commit;
  7. CommitComplete.
  8. SQL> conn scott/tiger // enter the new password and confirm the password. OK
  9. PasswordChanged
  10. Connected.
  1. Oracle username re-indexing method
  2. Explain how to query user tablespaces in Oracle
  3. An analysis of the management method of the Oracle user permission table
  4. Introduction to Oracle database backup and recovery features
  5. Five restrictions on using Oracle External tables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.