How does one Oracle user access tables of other users?

Source: Internet
Author: User

If Oracle has two users A and B, if A wants to access the table owned by B, the statement should be:
Copy codeThe Code is as follows:
SELECT * from B. TABLENAME.

I want to ask, can I modify the Oracle settings to change the language in which A accesses B's table to the same statement as that in user B's logon: SELECT * FROM TABLENAME?
Copy codeThe Code is as follows:
Create synonym tablename for B. TABLENAME;

In addition to creating synonyms on the first floor, user A must be granted the permission to access and change the word.
Copy codeThe Code is as follows:
Drop synonym tablename;

1. You can use a query to generate an SQL statement, such
Copy codeThe Code is as follows:
Select 'create synonym' | table_name | 'for a.' | table_name from dba_tables where owner = 'A'

Then execute these SQL statements. Or write the stored procedure.
2 select any table permissions allow access to all tables

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.