Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.server -> Re: What's a server handle or context(ORA-24327)?

Re: What's a server handle or context(ORA-24327)?

From: Andy Hassall <>
Date: Fri, 14 May 2004 22:21:17 +0100
Message-ID: <>

On Fri, 14 May 2004 15:49:39 -0400, Rob <> wrote:

>ORA-24327 need explicit attach before authenticating a user
>Cause: A server context must be initialized before creating a session.
>Action: Create and initialize a server handle.
>What is a server context and server handle?
>I tried metalink and nobody at Oracle wants to answer my
>question. I got this error using a PHP connection to Oracle
>9i on Linux 9. We rebooted and I have not seen it since but
>It made me curious to know what these terms definitions were if
>I see it again.
>All the online help returns no useful answers either.
>This query is more along the lines of definition rather than what the
>error means exactly.

 It refers to handles at the OCI level (Oracle Call Interface - the C API for connecting to Oracle, which PHP uses). Creating a server handle is one of the steps you go through in initiating an Oracle session.

 If you're getting the error above, it could imply the php_oci8 module on the version of PHP you're using is missing some error checking and has probably proceeded past an error where it should have aborted, causing this error later in the process.

 Last time I had a glance through the oci8 module's source it seemed to be quite good at checking errors after calls, and was too strict in some places (treating OCI_SUCCESS_WITH_INFO as an error and only accepting OCI_SUCCESS as success).

 More info would be useful; PHP version, Oracle version, bit of background on the circumstances this comes up (when using OCILogon presumably).

 Bit of a shot in the dark; are you using OCIPLogon, and your database went down at any point? It's an open bug in PHP that closed connections can stay in the persistent connection pool. There's a workaround listed in bug 15390 on (adding failover to your tnsnames.ora entry to cause a reconnect).

Andy Hassall <> / Space: disk usage analysis tool         /
Received on Fri May 14 2004 - 16:21:17 CDT

Original text of this message