Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create dblink in oracle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces how to create dblink in oracle, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. Local service has been configured

The following is a reference clip:

Create public database

Link fwq12 connect to fzept

Identified by neu using 'fjept'

CREATE DATABASE LINK database link name CONNECT TO username IDENTIFIED BY password USING 'instance name of locally configured data'

2. No local service is configured

The following is a reference clip:

Create database link linkfwq

Connect to fzept identified by neu

Using'(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 10.142.202.12) (PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = fjept)

)

)'

Ip address of host= database, ssid of service_name= database.

In fact, the two methods of configuring dblink are similar. I personally feel that the second method is better, so that it is not affected by local services.

The database connection string can be defined in NET8 EASY CONFIG or directly modified in TNSNAMES.ORA.

Database parameter global_name=true requires that the database link name be the same as the remote database name

The global name of the database can be found with the following command

SELECT * FROM GLOBAL_NAME

Query tables in a remote database

SELECT... FROM table name @ database link name

Querying, deleting, and inserting data is the same as manipulating a local database, except that the table name needs to be written as "table name @ dblink server".

Incidentally, the creation of synonyms:

CREATE SYNONYM synonym name FOR table name

CREATE SYNONYM synonym name FOR table name @ database link name

Delete the dblink:DROP PUBLIC DATABASE LINK linkfwq.

If you create a global dblink, you must use the systm or sys user and precede the database with public.

On how to create dblink in oracle to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report