Oracle database user Lock and Unlock

Source: Internet
Author: User
Tags dba

After the Oracle database is installed, users such as Scott are locked by default and cannot log on to the database with Scott users.
Log in with the user with ALTER USER database permission, and select Sysdba to execute the following command:

Unlock command: sql> ALTER user username account UNLOCK;

Lock user command:sql> ALTER user username account lock;

If the logged-on user does not have ALTER user database permissions, use a user with DBA role to log in to execute the following command:
Sql> Grant alter user to username;
In this way, the corresponding users who need to log in to Sqlplus can unlock other users. But it's nonsense, and it's OK to just use a user with a DBA role to access the unlock, because the DBA role has ALTER user permission.

View statements for all roles and corresponding permissions in the database: SELECT * from Role_sys_privs;

To view the statements of the currently logged in user-owned role: SELECT * from user_role_privs;--does not seem to be able to query which roles all users have and can only query the current logged-on user.

Oracle database user Lock and Unlock

Related Article

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.