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: