Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can you login as SYS using OCI in 9i ?

Re: Can you login as SYS using OCI in 9i ?

From: Lionel Mandrake <nobody_at_nospam.nowhere.nohow>
Date: Sat, 10 Nov 2001 02:12:31 GMT
Message-ID: <j20H7.132670$My2.76163170@news1.mntp1.il.home.com>


"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US