如何将 Airflow 连接到 oracle 数据库

How to Connect Airflow to oracle database(如何将 Airflow 连接到 oracle 数据库)

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

问题描述

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

根据他们的

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

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

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

版本:Airflow v1.7.0,Oracle11g

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

解决方案

在深入研究源代码后,这就是它最终为我工作的方式:

连接类型:Oracle

主机:example.com

架构:用户名

登录:用户名

端口:端口号

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

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

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

Host: example.com:1524/sid

filled other fields as:

Conn Type: Oracle

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

Login: username

Password: * * *

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:listener does not currently know of service requested in connect descriptor

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

Version: Airflow v1.7.0, Oracle11g

EDIT:

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 Type: Oracle

Host: example.com

schema: username

login: username

port: port number

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

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

本文标题为:如何将 Airflow 连接到 oracle 数据库

基础教程推荐