Oracle user creation and permission operations (oracle study Note 1)

Source: Internet
Author: User


Oracle user creation and permission operations (oracle study Note 1) 1. create userSQL> create user arthur identified by m123 (m123 is a password and must start with a letter) normal users do not have the permission to use create user. Users can be switched and then created # Use system to create user arthurSQL> conn system/password SQL> create user arthur identified by m123 login 2. note that arthur was created above, but it is only a single user without any permissions, so the following link statement will not be executed successfully www.2cto.com SQL> conn arthur/m123, // No permission, failed to run -------------------------------------------------------------------------- 3. to obtain permissions, use grant, revoking a permission revoke allows system to grant arthur permissions # first log on to systemSQL> conn system/password SQL> grant connect to arhtur and press ENTER // system to grant arthur the connect permission and then execute the link to SQL> conn arthur/m123 is successful ------------------------------------------------------------------------ 4. grant arthur the permission to create a table, arthur users cannot create SQL tables> conn system/password SQL> grant resource to arthur authorized SQL> conn arthur/m123SQL> create table table_name limit 5. we hope arthur users can query scott's emp table. the authorizer is scott (because emp is the scott table in it ), www.2cto.com SQL> conn scott/password SQL> grant select on emp to arthur successful authorization the following statement can be used if arthur wants to query the scott table emp (emp is a table) log on to www.2cto.com SQL> conn arthur/m123SQL> select * from emp; // This sentence is incorrect. SQL> select * from scott. emp; it indicates that arthur only has the permission to query emp ------------------------------------------------------------------------ 6. if arthur wants to update scott's emp, you can use the following authorization SQL> conn scott/password SQL> grant update on emp to arthur to authorize successful instructions at this time arthur only has the permission to change emp ---------------------------------------------------- 7. if arthur can modify/delete/query/Add scott's emp table, use the following statement SQL> conn scott/password SQL> grant all on emp to arthur to authorize the successful revocation of permissions (scott revoke arthur's permission to query emp tables) SQL> conn scott/password SQL> revoke select on emp from arthur ------------------------------------------------------------------ 8 'permission transfer, while scott grants arthur permissions, it also allows arthur to continue passing permissions. Of course, arthur's permissions cannot go beyond scott's permissions. scott> -- arthur> ---- somebody, if it is an object permission, join with grant optionSQL> conn scott/password connected to www.2cto.com SQL> grant select on emp to arthur with grant option. arthur authorizes another user to select emp. tom # log on first. SQL> conn arthur/m123SQL> grant select on emp to tom // This syntax is incorrect, arthur does not have the emp table SQL> grant select on scott. emp to tom Note: When scott revokes revoke from arthur's select permission, tom's select permission on emp is also revoked. If the system permission is granted to arthur grant conn to arthur with admin option, chunqiuwei

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.