Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCI question -- if you have souls please help!
On 12 May 2003 10:56:29 -0700, laredotornado_at_zipmail.com (D. Alvarado)
wrote:
>Hi,
> I am trying to write an Apache module (running on a Solaris
>machine) that will connect to my Oracle 8.1.7 database. I am using
>some of the C libraries that came with Oracle, but I can't seem to
>connect to the db, which is running on a different machine than
>Apache. I repeatedly get the error: "ORA-01034: ORACLE not
>available."
>
>Here's some of the code:
>
> /* Set some environment variables */
> two_task = (char *)ap_palloc(r->pool,15 +
>strlen(sec->auth_ora8_two_task));
> sprintf(two_task,"TWO_TASK=%s",sec->auth_ora8_two_task);
> putenv(two_task);
>
> /* Try and connect to db. */
> if (orlon(&lda,hda,(text*)sec->auth_ora8_uid_login,-1,(text*)sec->auth_ora8_pwd_login,-1,0))
> {
> ap_log_error(APLOG_MARK, APLOG_NOTICE, NULL, "Failed to log
>on.");
> text msg[512];
> oerhms(&lda, lda.rc, msg, (sword) sizeof msg);
> msg[strlen(msg) - 1] = 0;
> sprintf(ora8_errstr,"ORA8: Could not connect to Oracle8(%s)
>as %s : %s",(sec->auth_ora8_two_task) ? sec->auth_ora8_two_task : se
>c->auth_ora8_sid ,sec->auth_ora8_uid_login,msg);
> return NULL;
> }
>
>I have tried numerous things for the connect string, but nothing
>works! Some of the things I've tried are:
>
>T:hostname:port:tnsname
>hostname:port:tnsname
>T:hostname:tnsname
>hostname:tnsname
>tnsname
>
>I can connect to Oracle fine through sql*plus on the same machine from
>which I'm trying to connect through C. Does anyone know how the
>connect string should be properly formed?
>
>Thanks, Dave
Has nothing to do with the connect string. Either the database is not running at all, or the Oracle executables don't have the setuid bit set or you have other privilege problems. The privileges it should have are described in the installation manual.
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Mon May 12 2003 - 13:14:01 CDT