Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> How to change user password in OID
I try to change user password by this script, but get the error: ORA-31202:
DBMS_LDAP: LDAP client/server error: Type or value exists
How can I fix it?
DECLARE
retval PLS_INTEGER;
my_session DBMS_LDAP.session; my_attrs DBMS_LDAP.string_collection; my_message DBMS_LDAP.message; my_entry DBMS_LDAP.message;
my_array DBMS_LDAP.MOD_ARRAY;
my_vals DBMS_LDAP.STRING_COLLECTION ;
ldap_host VARCHAR2(256); ldap_port VARCHAR2(256); ldap_user VARCHAR2(256); ldap_passwd VARCHAR2(256); ldap_base VARCHAR2(256);
ldap_host := <host>; ldap_port := '4032'; ldap_user := 'cn=orcladmin'; ldap_passwd:= <pass>; ldap_base := ' ';
DBMS_OUTPUT.PUT('DBMS_LDAP Change Password Example '); DBMS_OUTPUT.PUT_LINE('to directory .. '); DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Host ',25,' ') || ': ' || ldap_host); DBMS_OUTPUT.PUT_LINE(RPAD('LDAP Port ',25,' ') || ': ' || ldap_port);
my_array := DBMS_LDAP.create_mod_array(1); my_vals(1) := 'user12348';
DBMS_LDAP.populate_mod_array(my_array, DBMS_LDAP.MOD_ADD, 'sn', my_vals); retval := DBMS_LDAP.modify_s(my_session, 'cn=user99999,cn=users,dc=genesyslab,dc=com', my_array); DBMS_LDAP.free_mod_array(my_array);
retval := DBMS_LDAP.unbind_s(my_session);
DBMS_OUTPUT.PUT_LINE(RPAD('unbind_res Returns ',25,' ') || ': ' ||
TO_CHAR(retval));
DBMS_OUTPUT.PUT_LINE('Directory operation Successful .. exiting');
-- Handle Exceptions
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(' Error code : ' || TO_CHAR(SQLCODE)); DBMS_OUTPUT.PUT_LINE(' Error Message : ' || SQLERRM); DBMS_OUTPUT.PUT_LINE(' Exception encountered .. exiting');END;