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