Oracle creates Dblink issues

Source: Internet
Author: User

1. If you set up a server database connection in the local "D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora", you must set up the same name configuration for the server:

For example:

Local

1 Prepaid = 2 (DESCRIPTION =3  (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.4) (PORT = 1521))4
   
     (Connect_data =
    5 
     (SERVER = dedicated)
    6 
     (SID = Prepaid)
    7 
     )
    8 )
   

Server

1 Prepaid = 2 (DESCRIPTION =3  (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))4  ( Connect_data =5  (SERVER = dedicated)6  (SID = Prepaid)7  ) /c13>8 )

Create a Dblink statement

1 Create  Public Database  to  by ' Prepaid ';

If only locally created, the query is an error:

SQL>Select* from scott.emp@mylink; Select *  error from scott.emp@mylink                        *1  line: ORA-  12154: TNS: Unable to resolve the specified connection identifier

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

2. Do not set, specify directly in the CREATE statement

Create  Public Database  to  by  '(DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP) (HOST = database_ip) (PORT = 1521))) ( Connect_data = (service_name =servicename))';

Oracle creates Dblink issues

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.