The Dblink database link is a schema object in a database that allows you to access objects on another database.
The Dblink qualifier allows you to reference objects in a database other than the local database, and if Dblink is omitted, Oracle assumes that you are referring to an object in the local database, and not all SQL statements allow you to access objects on the remote database.
New:
Method One: with configuration files
Create DATABASE Link "Object Name" connect to "UserName" identified by "password" using "Server";
Object name: UserName: The user name of the remote database password: password for the remote database
Server: The configured database service name, a service needs to be established on the local server Tnsname.ora.
Method Two: write the remote database service location directly in the CREATE statement
CREATE DATABASE link esp_51 Connect to ESP identified by ESP
Using ' (DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.105) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)‘;
Application Examples:
1.UPDATE [email protected] SET salary=salary*1.3 WHERE last_name = ' stu ';
2. Create synonyms for merge use, CREATE synonym emp_table for [email protected];
For future direct use, select * from emp_table
3. Delete the Dblink statement drop public DATABASE LINK remote;
Oracle uses Dblink