Oracle grant user authorization

Source: Internet
Author: User

Authorized users can access database objects and their contents. Prompt that after a user has the permission to Process Tables of other users, the user must have public or private synonyms of these tables before he can reference tables of other users in SQL statements, oracle can identify these tables through them.

Assume that Jrstocks has a table named sample_ B and allows all database users to access sample_ B. Another user, coreyan, used an SQL statement to query table sample_ B and obtained the following error message:

Select * from sapmle_ B;

*

ERROR at line: 1

ORA-00942: table or view does not exist

Regardless of the permissions granted, Each authorization statement is composed of three parts:

1) The recipient part is a list of one or more users who are preparing to obtain permissions.

2) The keyword permission section consists of grant followed by one or more permissions. If multiple permissions exist in the same grant statement, separate them by commas.

3) The table name starts with the keyword o n and lists the tables to be authorized on.

Let's take a look at the details below. It mainly describes how to grant users the four permissions: add, delete, modify, and query:

I. insert

Insert permission allows creation of rows in tables of other users. Statement grant insert on sample_a to public; allows all users to create new rows in sample_a. Oracle allows multiple permissions to be granted in a single grant statement. The SQL statement grant insert, select on sample_a to public is equivalent to two statements: grant select on sample_a to public; statement and grant insert on sample_a to ublic; statement.

Ii. update

The update permission allows other users to modify data in non-self tables. Statement grant update on sample_a teplownd; allows the user teplownd to modify information in table sample_a.

Iii. select

The select permission allows users to view contents in other user tables. The statement grant select on sample_3 to public; allows all users to browse the content in Table sample_3, and the statement grant select on sample_3 to ops $ rosenberge, ops $ abbeyms; only two users are allowed to view the content in sample_3. Note: When multiple users are authorized, separate them with commas.

Prompt that all database users are granted the specified permission when the public object is used as the authorization object. If your database has 15000 users, You need to authorize the database 15000 times (once for each user) separately, and authorize the database to public once.

Iv. delete

The delete permission allows other users to delete information rows of a specified table. This permission is small, so we recommend that you use it with caution. The following is an example: if a user connects to the product database, he thinks that the user is connected to the test database. He released a command to delete from people_master; and Oracle made a response to 12003 rows delet. after the ed exits SQL * Plus, the next program accesses lele_master to view the records of Rick Bower and will be notified that the record does not exist.

Command grant delete, update, select on sample_a to public; give specified permissions to all database users, while command grant select, update, insert, delete on sample_a to teplownd, greerw; only teplownd and greerw are allowed to perform the actions listed in the command on the table sample_a.

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.