Roles of public users in Oracle databases

Source: Internet
Author: User

Public is not a role. You can understand it as a set of all database users.

If a permission is granted to the public, the database user can have this permission (of course, some users may not have the connect permission ).

For example, if you want to grant all users the select permission to an object t1
Grant select on user1.t1 to public;
Create public synonym t1 for t1;
All public users can access table t1.

For example
Grant dba to public;
All users have the dba permission.

See the following example.
SQL> grant dba to public;
Authorization successful.

SQL> create user hh identified by hh123 default tablespace users;
User Created

SQL> conn hh/hh123
Connected.
SQL> create table t1 (a int );
The table has been created.
SQL> conn/as sysdba
Connected.
SQL> revoke dba from public;
Withdrawing successful.

SQL> conn hh/hh123
ERROR:
ORA-01045: user FANG lacks create session privilege; logon denied

In this example, the DBA permission is granted to all users. Therefore, the created hh user has the DBA permission and can log on. Then, the DBA permission of all users is revoked, hh users cannot log on again.

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.