To query OID you can use ldapsearch that comes with oracle.
If you want to get the Portal password for you Oracle Portal installation you can issues the following from the command line:
ldapsearch -v -D “cn=orcladmin” -w “orcladminpassword” -h host -p 389 -s sub -b “cn=IAS Infrastructure Databases, cn=IAS, cn=Products, cn=OracleContext” “orclresourcename=PORTAL” orclpasswordattribute