Oracle Series: (21) access to objects under other users [authorize]

Source: Internet
Author: User



Disclaimer: Scott or HR call username/scheme name/space name

Scott--tiger

HR-----Lion

Query who the current user is

Show user;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/1A/wKiom1fUF4jBIjRCAAAPoOM61GI926.jpg "title=" 004. JPG "alt=" wkiom1fuf4jbijrcaaapoom61gi926.jpg "/>


When querying all objects under Scott's own table space, add, or no user name, select * from EMP;

SELECT * from EMP;

Or

SELECT * from Scott.emp;


Unlock HR General account as Sysdba

Alter user HR account unlock;


Set the password for the HR general account as Sysdba

Alter user HR identified by Lion;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/87/18/wKioL1fUGGCTNEFAAADFdQvNNWo217.jpg "title=" 005. JPG "alt=" wkiol1fuggctnefaaadfdqvnnwo217.jpg "/>


When Scott queries all tables under the HR table space, you must add a user name

SELECT * from Hr.jobs;

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/1B/wKiom1fUGd_COFolAACx9cNLAWc266.jpg "title=" 007. JPG "alt=" wkiom1fugd_cofolaacx9cnlawc266.jpg "/>


By default, each user can only query the permissions of objects under their own space, and cannot query objects under other user spaces

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/1B/wKiom1fUHJ6gIjJbAABeuRdzOYo379.jpg "title=" 008. JPG "alt=" wkiom1fuhj6gijjbaabeurdzoyo379.jpg "/>


Grant Scott users the ability to query object permissions under all user spaces as the SYSDBA identity role

Grant Select any table to Scott;


Revoke the Scott user's access to object permissions under all user spaces as a SYSDBA identity

Revoke select any table from Scott;


Scott is self-viewing the permissions he has

SELECT * from User_sys_privs;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/87/19/wKioL1fUH17Tr-FkAADsZ6OdcSc001.jpg "title=" 009. JPG "alt=" wkiol1fuh17tr-fkaadsz6odcsc001.jpg "/>


Navigating from the Scott user space to the SYSDBA user space

Conn/as Sysdba;


Navigating from SYSDBA user space to Scott user space

Conn Scott/tiger;


Navigating from Scott user space to HR user space

Conn Hr/lion;


Querying all objects in the HR user space

SELECT * from tab;


Navigating from the HR user space to the Scott user space

Conn Scott/tiger;


In the Scott user space, query the jobs table under HR user space, plus the HR user space name

SELECT * from Hr.jobs;









Oracle Series: (21) access to objects under other users [authorize]

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.