Oracle basic learning 4-Oracle permission Transfer

Source: Internet
Author: User

An example is provided below:

First, connect to Oracle as a guest (sysdba)

Then create two users, "lisi" and "zhangsan"

Then authorize lisi and grantCreate a tablePermissions

Lisi connects to the database and creates a table named mytable.

Grant permissions for connecting to databases, creating tables, and connecting to Oracle for zhangsan

We need to know that the Operation permissions of mytable created by lisi are only owned by lisi (and system users), and other users (such as zhangsan) do not, the following describes how to transfer the permission to query the mytable table of lisi to zhangsan:

First, zhansan does not have permission to operate lisi table mytable without authorization:

Then lisi (the current connected user must be external lisi) will pass the permission to query mytable to zhangsan <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + pgltzybzcm9 "http://www.2cto.com/uploadfile/Collfiles/20140619/2014061908585710." alt = "\">

Then zhangsan can view the mytable content.

This is the so-called permission transfer, and other permissions are similar, such as: (lisi authorizes zhangsan)

Grant the insert permission: grant insert on mytable to zhangsan;

Grant all permissions: grant all on mytable to zhangsan;

You can also control permissions to a column, for example:

Grant update (id) on mytable to zhangsan)

Of course, system permissions can also be transferred to other common users by "system users:

The system user sys authorizes lisi as follows:

  

Note: by default, the authorized person no longer has the permission to grant this permission to others. If you want to grant this permission, the authorization statement must be followed by the with admin option (for example, in the above 2nd sentence, lisi will have the permission to pass the permissions that I just obtained to zhangsan ).

The following commands are commonly used:

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.