Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Can you login as SYS using OCI in 9i ?
"kenny lim" <kennylim_at_earthlink.net> wrote in message
news:9sg7f9$ooc$1_at_nntp9.atl.mindspring.net...
>
> Hi all,
>
> Is there a way to login as SYS user from the OCI (Oracle Call Interface)
> layer
> "without" having to add 07_DICTIONARY_ACCESSIBILITY=TRUE in
> the init.ora file for Oracle 9i?
>
> Any advise would be greatly appreciated.
>
> Thanks.
>
> Kenny-
>
>
Specifying 'OCI_SYSDBA' for the 'mode' parameter in the OCISessionBegin call might be one way...
Something like:
OCIHandleAlloc((dvoid *)envhp, (dvoid **)&usrhp, (ub4) OCI_HTYPE_SESSION, (size_t) 0, (dvoid **) 0);
OCIAttrSet((dvoid *)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid *)"sys", (ub4)strlen("sys"), OCI_ATTR_USERNAME, errhp);
OCIAttrSet((dvoid *)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid *)"passwd", (ub4)strlen("passwd"), OCI_ATTR_PASSWORD, errhp);
OCISessionBegin (svchp, errhp, usrhp, OCI_CRED_RDBMS,OCI_SYSDBA);
OCIAttrSet((dvoid *)svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid *)usrhp, (ub4)0, OCI_ATTR_SESSION, errhp);
HTH, -LM Received on Fri Nov 09 2001 - 20:12:31 CST
![]() |
![]() |