Oracle Database [synonym]

Source: Internet
Author: User

Synonym Synonyms

 

 

Synonyms (Oracle database only)
Such a query statement always exists:
Select sysdate from dual; (Query System Information)
I have always stressed that dual is a virtual table. Although it is a virtual table, it is
Where is it defined?
If you are using system to connect to the database, check whether the table belongs to the System
Switch user
Conn system/magager (password set after database installation)
Select * From tab where tname = 'dual ';
Query all tables without dual;
Go to the super administrator sys user to query:
Conn sys/change_on_install as sysdba;
Select * From tab where tname = 'dual ';
This table exists under sys
However, I can access table names directly under Scott users. Normally, if you want to access different users
The table must use "User Name. Table name ";
Use the following SQL statement under sys
Select * from EMP;
Error: Table or view does not exist
Select * from Scott. EMP;
It can be seen that dual actually plays a role through synonyms, which allow other users
You can easily access the "user name. Table Name" to access tables under other users.
Create synonym name for username. Table Name;
Example: Create an EMP synonym for the EMP table under the Scott user.
Query by Synonym
Create synonym EMP for Scott. EMP;
Select * from EMP;
Query can be completed
Example: delete a synonym for EMP
Drop synonym EMP;

 

 

 

Source: http://student.csdn.net/space.php? Uid = 362532 & Do = Blog & id = 32174

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.