如何将Airflow连接到Oracle数据库

如何将Airflow连接到Oracle数据库

本文介绍了如何将Airflow连接到Oracle数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Airflow创建与oracle数据库实例(oracle:thin)的连接.

I am trying to create a connection to an oracle db instance (oracle:thin) using Airflow.

根据他们的文档我输入了主机名,然后输入端口号和SID :

According to their documentation I entered my hostname followed by port number and SID:

主机:example.com:1524/sid

Host: example.com:1524/sid

其他字段填写为:

连接类型:Oracle

架构:用户名(文档说:将您的用户名用于架构)

Schema: username ( documentation says: use your username for schema )

登录:用户名

密码:* * *

建立连接后,它会为我尝试执行的每个查询( ORA-12514 )提供保存错误代码.看来oracle不允许气流连接:

After connection is setup, it gives the save error code for every query that I tried to execute (ORA-12514).It seems like oracle doesn't let airflow to connect:

ORA-12514:TNS:侦听器当前不知道连接描述符中请求的服务

曾经有人遇到过相同的问题.我的意思是,对于这样的大型平台,连接数据库应该不是问题.或者我可能做错了什么.谢谢

Has someone experienced the same problem before. I mean connecting to a database shouldn't be a problem for a big platform like this. Or I am probably doing something wrong. Thanks

版本:Airflow v1.7.0,Oracle11g

Version: Airflow v1.7.0, Oracle11g

我使用的主机名与在Oracle SQLDeveloper客户端中使用的主机名相同:

I am using the same hostname which I use in Oracle SQLDeveloper client:

推荐答案

在研究了源代码之后,这终于对我起作用了:

After digging into the source code, this is what finally how it worked for me:

Conn类型:Oracle

Conn Type: Oracle

主机:example.com

Host: example.com

模式:用户名

登录:用户名

端口:端口号

额外:{"sid":我的sid","dsn":"example.com"}

extra: {"sid": "my sid", "dsn": "example.com"}

这篇关于如何将Airflow连接到Oracle数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:42