Common Oracle commands (2)

Source: Internet
Author: User

After oracle is installed, three users are generated by default, which are:

SysUser: Super Administrator with the highest permissions. Its role isDBAThe password is:Change_on_install

SystemUser: it is a system administrator and has high permissions. Its role isDbaoperThe password isManager

ScottUser: common user, password isTiger

 

1. Create a user

Create a new user in OracleCreate userCommand, and you must have the DBA (Database Administrator) permission to use.

Example:

Create user Lida identified by m123;

Note: Lida is the username to be created. The password of the user to be created is followed by the identified by statement.

Note: The password must start with a letter and cannot start with a number.

2. Change the password for the user

1. If you change your password, you can directly usePassword UsernameThis command, for example:

Password Lida;// Change the password of Lida.

2. If you change the password for someone else, you must have the DBA (System Administrator) permission orAlert userSystem permissions

Alter user Lida identified by Lida;

3. delete a user

Generally, a user is deleted as a DBA. If another user is used to delete a user, the user must have the permission to drop the user. The command to delete the user is:

Drop User Username [cascade]

Note: If you have already created a table, you need to include the [cascade] parameter when deleting the table. when a user is deleted, the table created by the user is also deleted in cascade mode.

Iv. permission authorization

Grant connect to Lida;// Grant the database connection permission to the Lida user

Grant select on EMP to Lida;// Grant the permission to query the EMP table to Lida.

Grant all on EMP to Lida;// Grant all permissions on the EMP table to Lida

5. revoke permissions

Revoke select on EMP from lida;// Revoke Lida's permission to query the EMP table

Vi. Permission Maintenance

If you want Lida users to query the content of the EMP table, And you want lida to grant the permission to query the EMP table to other users

For object permissions, addWith grant optionSuch:

Grant select on EMP to Lida with grant option;

If it is a system permission, then:

Grant connect to Lida with Grant admin option;

Note: If the Scott User grants the Lida permission to query the EMP table and grants permissions to other users, the Scott user suddenly revokes the Lida query for the EMP table one day, other permissions granted by lida to query the EMP table are also revoked.

 

 

 

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.