开发者

How to connect to Oracle with Perl using LDAP?

I will 开发者_运维问答be needing to connect to an Oracle server on a system that only supports LDAP for name lookup, rather than TNSNAMES.ora. Is this possible with perl? I am quite sure that I can install the Net::LDAP module and parse the connection information myself, but I was looking for a standard way.


Sounds like you are trying to connect to Oracle Internet Directory (OID) which is an LDAP implementation... not an Oracle database directly. Correct?

If so, Net::LDAP all the way via Perl...

my $LSERV  = 'yourldaphost.yourdomain.com';                   
my $BASE_DN = 'cn=*,dc=*,dc=*';  # these * values must be filled in correctly for your LDAP
my $timeout = 10;                # How long to wait (in secs).
my $success; my $message;
my $ldap = Net::LDAP->new(
     $LSERV, 
     timeout => $timeout
) or die "! Unable to connect to OID LDAP.";


It should use whatever is defined in the sqlnet.ora of the client install. Perl shouldn't have to worry about the naming method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜