如何将Airflow连接到Oracle数据库

编程入门 行业动态 更新时间:2024-10-23 20:22:48
本文介绍了如何将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:1524/sid

Host: example: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

Host: example

模式:用户名

登录:用户名

端口:端口号

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

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

更多推荐

如何将Airflow连接到Oracle数据库

本文发布于:2023-11-24 09:10:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624604.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:连接到   如何将   数据库   Airflow   Oracle

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!