Access from different Oracle databases through database link

Source: Internet
Author: User

By default, access between different Oracle Server databases is remotely accessed through local operations *. *

1. Create a database link
Example:
Create public database link orcl211 connect to username identified by password using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = *. *) (PORT = 1521 ))
)
(CONNECT_DATA =
(Service_name = ORCL)
)
)';

Parameter description:
Create public database link name

Connect to user name

Identified by password

Using 'Connection description'

The connection description must be in the following format _ or the service name www.bkjia.com configured in tnsnames. ora, but note that the following format must also be met in tnsnames. ora; otherwise, the connection will fail:

(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = *. *) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL service name)
)
)

2. the syntax for accessing objects in the Linked database is as follows: Access ts_staff_info under the edubur user in orcl211
Example:
Select * from edubur. ts_staff_info @ orcl211;
Parameter description:
Select * from user name. Table Name @ remote database link name

3. view all created database link names
 
Select owner, db_link from dba_db_links;

Ower db_link
PUBLIC ORCL211.REGRESS. RDBMS. DEV. US. ORACLE. COM


4. Delete the Database Link name
Drop public database link ORCL211.REGRESS. RDBMS. DEV. US. ORACLE. COM

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.