Tuesday, May 14, 2013

How to debug ORA-31203: DBMS_LDAP: PL/SQL - Init Failed error?

Reference link: https://forums.oracle.com/forums/thread.jspa?threadID=946119

We got into this problem when installing 10G OIM. DBMS_LDAP is a package in the 10g Metadata repository. The following is observed in logs:

SQL> Creating OID entries for SSO
Error code   : 1
Error message: User-Defined Exception
LDAP error    : ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.
ERROR: deleting application entry
Error code: 1
Error message: User-Defined Exception
ERROR: creating SSO users and groups in OID

PL/SQL procedure successfully completed.

*** Refreshing WWC OID cache....***
declare
*
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "ORASSO.WWSEC_OID", line 1199
ORA-06512: at "ORASSO.WWSEC_OID", line 1328
ORA-06512: at "ORASSO.WWSEC_OID", line 2498
ORA-06512: at "ORASSO.WWSEC_OID", line 2528
ORA-06512: at "ORASSO.WWSEC_OID", line 1606
ORA-06512: at "ORASSO.WWSEC_OID", line 1755
ORA-06512: at "ORASSO.WWSEC_OID", line 2133
ORA-06512: at line 8

Following is what we did:
1. find out whether Ldap server is running or not.
netstat -ano|findstr 363

or do a ldapbind:
ldapbind -h hostname -p 363
bind successful

2.Go to the database to ensure that the package DBMS_LDAP is present.
3.Then run the following from the database SQL:

If it fails, it means database server is unable to connect to the server where OID resides via that port 363.
Further to confirm this, we asked the DBA to telnet to the server using the following:

Telnet <server name where OID resides> 363
And he confirmed that an access problem does exist. The access problem needs to be fixed first before OIM installation can continue.
 -------------------------------------------------

1. Connect to your repository db and run the following code:

sqlplus sys/<password>
set serverout on
DECLARE
retval PLS_INTEGER;
my_session DBMS_LDAP.session;
BEGIN
my_session := DBMS_LDAP.init('host address where the oid resides','636');
retval := DBMS_LDAP.open_ssl(my_session, null, null, 1);
dbms_output.put_line('open_ssl returns: '|| to_char(retval));
retval := DBMS_LDAP.simple_bind_s(my_session,'cn=orcladmin','');
dbms_output.put_line('simple_bind_s returns: '|| to_char(retval));
retval := DBMS_LDAP.unbind_s(my_session);
dbms_output.put_line('unbind_s returns: '|| to_char(retval));
END;
/

2. This should fail...

DECLARE
*
ERROR at line 1:
ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_LDAP", line 50
ORA-06512: at line 5

No comments:

Post a Comment