What permissions are required to perform DML through an Oracle database chain

Source: Internet
Author: User
Tags commit create database oracle database

For local Users, insert permission is required only for INSERT permission, which is not sufficient for insert operations through the database chain.

Looking at Oracle's admin manual is a problem that has not been noticed before.

To see a specific example, first create a regular user locally and authorize the insert, update, and delete permissions for table T to the User:

Sql> Show User

USER is "TEST"

Sql> CREATE TABLE T (ID number);

Table created.

Sql> create user U1 identified by U1;

User created.

Sql> Grant create session to U1;

Grant succeeded.

Sql> grant INSERT, UPDATE, delete on T to U1;

Grant succeeded.

Sql> Conn U1/U1

Connected.

sql> INSERT INTO test.t values (1);

1 row created.

sql> update test.t Set id = 2;

1 row updated.

sql> Delete test.t;

1 row deleted.

Sql> commit;

Commit complete.

Locally executed, user U1 can perform insert, update, and delete operations on the T table.

Below establishes the database chain at the far end, uses U1 as the connection user:

Sql> select * from Global_name;

Global_name

--------------------------------------------------------------------------------

Testrac

Sql> CREATE DATABASE link test08

2 Connect to U1

3 identified by U1

4 using ' 172.25.13.229/test08 ';

The database link has been created.

Sql> select * from global_name@test08;

Global_name

This article URL address: http://www.bianceng.cn/database/Oracle/201410/45464.htm

--------------------------------------------------------------------------------

TEST08

sql> INSERT INTO test.t@test08 values (1);

INSERT into test.t@test08 values (1)

*

Line 1th Error:

Ora-01031:insufficient Privileges

ORA-02063: Immediately following line (from TEST08)

sql> update test.t@test08 Set id = 1;

Update test.t@test08 Set id = 1

*

Line 1th Error:

Ora-01031:insufficient Privileges

ORA-02063: Immediately following line (from TEST08)

sql> Delete test.t@test08;

Delete test.t@test08

*

Line 1th Error:

Ora-01031:insufficient Privileges

ORA-02063: Immediately following line (from TEST08)

This is because when accessing a remote object through a database chain, Oracle needs query permissions to analyze the table structure, so if the DML operation is performed through the database chain, the user will need SELECT permission in addition to the corresponding DML permissions.

Sql> Conn Test/test

Connected.

Sql> Grant Select on T to U1;

Grant succeeded.

With SELECT permissions, DML execution through the database chain can be performed successfully:

sql> INSERT INTO test.t@test08 values (1);

1 lines have been created.

sql> update test.t@test08 Set id = 2;

1 rows have been updated.

sql> Delete test.t@test08;

1 rows have been deleted.

Sql> commit;

Submit completed.

Sql> select * from test.t@test08;

No rows selected

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.