如何在 TheSchwartz 中将数据库从 MySQL 更改为 Oracle

How to change database from MySQL to Oracle in TheSchwartz

我想在 Perl 的 TheSchwartz 模块(作业队列系统)中将数据库从 MySQL 切换到 Oracle。我怀疑以下代码有密钥。

my $client = TheSchwartz->new(
    databases => [{
    dsn  => 'dbi:mysql:TheSchwartz',
    user => 'dbi',
    pass => 'xxxxxxx',
    }],
    verbose => 1,
);  

我更改了密码。

dsn  => 'dbi:mysql:TheSchwartz',  

dsn  => 'dbi:Oracle:OraDB01',    

然后我收到了消息。

#Disabling DB 9e410d44ac4b9ede28c9ef34f6c1e817 because unknown

TheSchwartz 没有告诉我任何有关 Oracle 错误的线索(例如密码错误,或网络错误......)。

我的问题是
1. perl的TheSchwartz可以使用Oracle吗?
2.调试时,如何获取TheSchwartz中的ORA-Error信息?

欢迎任何帮助。
此致,

几乎可以肯定,使用 TheSchwartz 完全是转移注意力。 TheSchwartz 只是在创建 DBI 连接。因此,一旦您可以在 TheSchwartz 外部成功创建 DBI 连接,您应该也可以在 TheSchwartz 内部执行相同的操作。

我的处理方式分为两个阶段:

  • 编写一个简单的 DBI 程序来连接到 Oracle 数据库。
  • 将您的成功连接详细信息复制到您的 TheSchwartz 代码。

我写的最简单的DBI程序,只需要这么简单:

#!/usr/bin/perl

use strict;
use warnings;

use DBI;

my $dbh = DBI->connect('dbi:Oracle:OraDB01', 'dbi', 'xxx')
  or die $DBI::errstr;

这可能会以与您现有代码相同的方式失败,但您会收到原始 DBI 连接错误,这应该让您找出问题所在。

显然,您可能会发现 DBD::Oracle documentation 也很有用。