Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_LDAP.SEARCH_S with search filter for objectGUID

obiee123Sep 3 2014 — edited Sep 4 2014

Hi,

I need to lookup username (cn) from Active Directory based on provided objectGUID.

Search function call:

v_RetVal := DBMS_LDAP.search_s(v_LDAPSession, v_LDAPBaseDN,

                                  DBMS_LDAP.SCOPE_SUBTREE,

                                  v_SearchFilter,

                                  v_AttributeCollection,

                                  0,

                                  v_SearchResults);

If I use any of the following, search is returning results

     v_SearchFilter:='cn=abc*'; -- returns attributes for user names starting with abc

     v_SearchFilter:='cn=*'; -- reaches limit and exits with ORA-31202: DBMS_LDAP: LDAP client/server error: Sizelimit exceeded

I intend to search user based on objectGUID filter. But, search_s does not return any records when I query using objectGUID.

I have tried:

     v_SearchFilter:='objectGUID=*';

          Returns results

     v_SearchFilter:='objectGUID=a*';

          Returns results, for objectGUIDs starting with 61. convert 'a' to ascii (97). Convert ascii (97) to hex (61).

          But this formula does not return exact match of guid, when full guid is converted.

Also, ldp.exe and DB represents guid differently. It swaps two characters (hex numbers) with in dashed parts, but leaves last one as is. ie.e b1 6c 17 ac becomes AC 17 6C B1 in database.

     LDP.exe GUID: b16c17ac-0f1b-4399-b639-a3069b2c18fb;

     SEARCH_S, DB GUID: AC176CB11B0F9943B639A3069B2C18FB;

Has anyone used SEARCH_S to search an entry by objectGUID? What is the syntax for objectGUID?

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 2 2014
Added on Sep 3 2014
1 comment
1,028 views