首页 > 解决方案 > Perl DBI Connect Error ORA-21561: OID generation failed

问题描述

I am running a Perl Script and I am seeing this error message.

#!/usr/bin/perl
use DBI;

my $host = 'server';
my $user = 'user';
my $pwd = $ENV{'Login'};

my $driver = "Oracle";
$dsnslam = "DBI:$driver:host=$host;service_name=vps;port=1525";
$dbhslam = DBI->connect($dsnslam, "$user", "$pwd") || die "connect failed: ";

DBI connect('host=server;service_name=abc;port=1525','user',...) failed: ORA-21561: OID generation failed (DBD ERROR: OCISessionBegin)

I can do Tnsping and sqlplus without any issues.

I am running the script from Windows and the remote database is Oracle 19c on RHEL.I also added an entry on the Windows etc hosts file and that did not help either.

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost
127.0.0.1   localhost   WindowsServer.domain    WindowsServer

Any Help will be greatly appreciated.

标签: oracleperl

解决方案


推荐阅读