Sometimes it takes a table join query in two databases to use the database link.
The role of database link is to build databases and database connections.
1. First look at how to create using the Pl\sql tool.
Locate the database links right-click New
Fill in the name, where the user name is the login name of the remote database
The database is the local file D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
You can also fill in the database directly
(DESCRIPTION = (Address_list = (address= (protocol=tcp) (host=10.12.11.16) (PORT =1521))) (Connect_data = (service_name = ORC1)))
This is done after the save is created. Execute SQL Test
Select * from dual@test
2. You can also create a statement directly using the
Create Database to by'(DESCRIPTION = (Address_list = (address= (protocol=tcp) ( host=10.12.11.16) (PORT =1521))) (Connect_data = (service_name =orc1)))';
Or
Create Database to by ' T_tns ';
The tek_mes here is the database access account,123456 is the password
It is important to note that:
1. Create the permissions that must be created for the database link
2. Connection account (Tek_mes) must have create session permission