1. View Dblink
SELECT owner,object_name from dba_objects WHERE object_type= ' DATABASE LINK ';
Or
SELECT * from Dba_db_links;
2. Create Dblink Prerequisites:
The user who created the Dblink has the corresponding database permissions. Create public or CREATE DATABASE link
can use
To authorize.
Create Public database link Dblinkname connect to username identified by password using ' (DESCRIPTION = (address_l IST = (ADDRESS = (PROTOCOL = TCP) (HOST = database_ip) (PORT = 1521))) (Connect_data = (service_name =servicena me)) ';
If you do not add public after create, the created Dblink is not common, only the creator can use it.
Add:
How to determine the servicename of a database:
1. Use in Sqlplus
Show Parameter[s] Service_names;
Note that both parameter and parameters can
2. Use
Select Name,value from V$parameter where name= ' service_names ';
3. Using Dblink
For example, a scott_rmthost public dblink (using a Scott user connection to a remote host) is created on the native database, and a sqlplus is connected to the native database, and a select * from [email protected]_ Rmthot can get the data from the EMP table under the Scott user on the remote database.
You can also create a synonym in the local to point to [email protected]_rmthost, so that the value is much more convenient.
4. Delete Dblink
Note: The user has create public database link or CREATE DATABASE link permission.
View, create, and delete of DATABASE LINK