当前位置:网站首页>Oracle DatabaseLink cross database connection
Oracle DatabaseLink cross database connection
2022-06-11 12:27:00 【Three years old, funny】
Oracle DatabaseLink Cross database operations
I have such a need in my daily work , To build a test environment , You need to import some tables and data from the development library into the test library . Or use some tables in the development library in the test library , The data of the view . At first glance, there are many implementation methods for this requirement , At least... Can be used Oracle Import and export of . This can certainly be achieved , But the feeling is quite low, Let's take a look at a tall and fashionable way , Use Oracle Medium DATABASE LINK.
DATABASE LINK seeing the name of a thing one thinks of its function , Is the connection to the database , The function is to connect to other databases , And convenient operation of other data . But from this point of view , Is it very powerful .DATABASE LINK There are two kinds of , One is public , One is private , Here we mainly introduce the public .
1. establish DATABASE LINK ( Remote connection Library )
create public database link DATABASE_LINK_NAME
connect to CONNECT_DATABASE_USER identified by "CONNECT_DATABASE_PASSWORD"
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = CONNECT_ORACLE_SERVER)(PORT = CONNECT_ORACLE_SERVER_PORT))
)
(CONNECT_DATA =
(SERVICE_NAME = CONNECT_ORACLE_SERVICE_NAME)
)
)';
For example, I want to connect 192.168.101.111 Under this server The port number is 1521 Of orcl Database instance . User name is scott The password is tiger,database link The name is scottdl
create public database link scottdl
connect to scott identified by "tiger"
using '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.101.111)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )';
This creates a DATABASE LINK
-- see link
select * from dba_db_links;
Delete DATABASE LINK
drop public database link scottdl;
2. Use DATABASE LINK
I want to put emp The data table , Sync to my database , You can do that
create table test as (select * from EMP @scottdl );
Direct query is also possible
select * from EMP @scottdl(link name )
newly build DATABASE LINK Option two
1. open PL/SQL Tool NEW 
- Fill in the configuration information

- After creation, you can view it in the folder or sql Inquire about
-- see link
select * from dba_db_links;
Finally, you can do what you want , Isn't that easy !
边栏推荐
- 纯数据业务的机器打电话进来时回落到了2G/3G
- Redis RDB和AOF
- Solving the problem of data garbled in sqlserver connection database (Chinese table)
- 11、Synchronized与锁升级
- oracle删除用户后,却还可以使用该用户登录
- 美创科技数据安全管理平台荣获2022数博会“领先科技成果奖”
- Where is it safer to open an account for soda ash futures? How much is the margin for soda ash futures?
- 一般运维架构图
- Sulley fuzzer learning
- Harmonyos application development -- mycalculator based on self-made grid layout [my calculator][api v6]
猜你喜欢

Splunk health checks orphaned searches

saltstack安装与使用

Acwing50+Acwing51周赛+Acwing3493.最大的和(未完结)

(推荐)splunk 多少数量search head 才合适

SQLServer连接数据库(中文表)部分数据乱码问题解决

Flick grouping sets multidimensional aggregation and setting table state expiration time

一些比较的常用网站

2022年618投影仪保值品牌榜,当贝投影闲鱼保值率排行TOP1

Splunk最佳实践之workload managment

Flick scrolling window, sliding window, session window, global window
随机推荐
Wireshark packet capturing and debugging RTSP
Redis数据类型日常使用场景
Splunk健康检查orphaned searches
How can physical stores break through operational difficulties? Take a look at the store operation guide of this physical store applet
解决Splunk kvstore “starting“ 问题
Problems encountered recently when using nodejs Pinyin package
Development of TRX wave field chain pledge liquidity mining system
罗景:连接效率优化实践
Splunk 健康检查之关闭THP
flask 框架web开发视频笔记
flink 数据流图、并行度、算子链、JobGraph与ExecutionGraph、任务和任务槽
Acwing50+Acwing51周赛+Acwing3493.最大的和(未完结)
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc5 in position 13: invalid continuation byte
Moist or not? This is a problem
How does Wireshark modify the display format of packet capturing time and date?
The super document downloading tool scihub CN teaches you to download documents with one line of command
How can I use a domain name to access a website?
一般运维架构图
C#事件总线
Flink spark vs. Flink