Operations on accounts in the database

Source: Internet
Author: User

SYS has maximum permissions, login to Oracle, need to add as sysdba

system administrator rights account, modify user name, password only Super administrator has permission

Delete users:drop user username;

First, create a user

syntax:create user username identifideby password ;

Example: Create a test User:

Create user test ifrntified by 123;

Second, to the user authorization

syntax:grant permission 1, privilege 2...to username ;

Example: authorizing a test user to connect to a database

Grant create session to test;

For a newly created user, all permissions are assigned separately for the user to perform the appropriate action.

Oracle provides two main roles:connect,resource, and can directly assign these two roles

Test user

Grant Connect,resource to test;

Third, modify the user name password

syntax:alter user username identifiedby new password ;

Example: change the test user's password to test

Alter user test identified by test;

Four, manually let a password expire

syntax:alter user username passwordexpire;

V. Lock a user

syntax:alter user username accountlock;

VI. Unlock a user

syntax:alter user username accountunlock;

Vii. Assign permissions to the test user to query and delete the EMP table

Grant Select,delete on scott.emp to test;

To query the EMP under the test account

SELECT * from Scott.emp;

Viii. Withdrawal of authority

syntax:revoke permission name on user table name from user name ;

Example: the ability to retrieve the test user and delete Scott 's emp table

Revoke select,delete on scott.emp from test;


Operations on accounts in the database

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.