Example of oracle method for creating dblink
1. Application scenarios:
There are two databases, one is nc650115, the other is nc56, and now you want to connect to nc56 in nc650115 through dblink.
two。 First check in nc650115 to see if you have permission to create dblink. Execute in nc650115
Select * from user_sys_privs where privilege like upper ('% DATABASE LINK%')
Permissions are displayed as follows
Do not have permission to authorize in sys
Grant CREATE PUBLIC DATABASE LINK,DROP PUBLIC DATABASE LINK to nc650115
3. Create a dblink under nc650115.
Create public database link NC65DBLINK connect to nc56 identified by nc56 using'(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.17.254) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl)'
Where NC65DBLINK is the name of dblink
Connect to requires the user name of the connection, identified by password
HOST= requires ip to connect to the database
SERVICE_NAME= database instance
Check to see if the creation is successful
Select * from dba_db_links;select owner,object_name from dba_objects where object_type='DATABASE LINK';-- query time is long
4. Action:
Query the data in nc56
Select * from crm_bd_building@NC65DBLINK
Delete dblink
Drop public database link NC65DBLINK
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.