Tuesday, July 4, 2017

OID/LDAP command usage and examples

Set Environment
export ORACLE_INSTANCE=/u01/app/oracle/middleware/asinst_1 
export ORACLE_HOME=/u01/app/oracle/middleware/Oracle_OID
Bind Admin
$ORACLE_HOME/bin/ldapbind -h oidhost -p 3060 -D cn=orcladmin -w welcome1

$ORACLE_HOME/bin/ldapbind -h oidhost -p 3060 -D "cn=orcladmin,cn=users,dc=raastech" -w welcome1
Bind User
$ORACLE_HOME/bin/ldapbind -h oidhost -p 3060 -D "cn=ahmed,cn=users,dc=raastech" -w welcome1
Bind on SSL Port
$ORACLE_HOME/bin/ldapbind -h oidhost -p 3131 -U 1 -D cn=orcladmin -w welcome1
Search
$ORACLE_HOME/bin/ldapsearch -h oidhost -p 3131 -U 1 -D cn=orcladmin -s sub "(objectclass=*)" -w welcome1
Add User
Create file: oid_add_user.ldif

dn: cn=ahmed,cn=users,dc=raastech
changetype: add
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
uid: ahmed
givenName: ahmed
sn: ahmed
cn: ahmed
mail: ahmed@ahmed.ahmed
userPassword: welcome1


$ORACLE_HOME/bin/ldapmodify -h oidhost -p 3060 -D cn=orcladmin -w welcome1 -f oid_add_user.ldif
Change Password
Create file: oid_update_password.ldif

dn: cn=ahmed,cn=users,dc=raastech
changetype: modify
replace: userPassword
userPassword: welcome1


$ORACLE_HOME/bin/ldapmodify -h oidhost -p 3060 -D cn=orcladmin -w welcome1 -f oid_update_password.ldif
Delete User
Create file: oid_delete_user.ldif

dn: cn=ahmed,cn=users,dc=raastech
changetype: delete

$ORACLE_HOME/bin/ldapmodify -h oidhost -p 3060 -D cn=orcladmin -w welcome1 -f oid_delete_user.ldif

 
Applicable Versions
  • Oracle Internet Directory (OID) 11g

 

1 comment:

kanhaiya said...

Authentication failed
ORA-31202: DBMS_LDAP: LDAP client/server error: Invalid credentials. 80090308: LdapErr: DSID-0C090439, comment: AcceptSecurityContext error, data 52e, v4563

how we can resolve this error code please guide.