Oracle uses Dblink and oracle uses dblink
The DBLINK database link is a schema object in a database, allowing you to access objects in another database.
The dblink qualifier allows you to reference objects in a database other than the local database. If dblink is omitted, Oracle assumes that you are an object in the local database, not all SQL statements allow you to access objects in a remote database.
New:
Method 1: Use the configuration file
Create database link "object Name" connect to "userName" identified by "password" using "server ";
Object Name: object Name userName: Remote database userName password: Remote Database password
Server: name of the configured Database Service,You need to create a service on the local server tnsname. ora.
Method 2:Write the remote database service location directly in the creation statement
Create database link esp_51Connect to esp identified by esp
Using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.105) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)';
Example:
1.UPDATE teacher @ remoteSET salary = salary * 1.3WHERE last_name = 'std ';
2. Create a synonym for combination,Create synonym emp_tableFOR ys_adm.teacher @ remote;
For future use directly, select * fromEmp_table
3. Delete the DBLINK statement drop public database link remote;