More info on the oraus.msb problem.

I saw this on dbi-dev about two years ago:

FROM: Tim BunceDATE: 10/28/1999 13:01:42SUBJECT: RE:  oraus.msb being
reopened repeatedly     *** From dbi-dev -- To unsubscribe, see the end of
this message. ***


On Thu, Oct 28, 1999 at 11:47:43AM -0400, Greg Stark wrote:
> 
> Trussing my apache processes i see the oraus.msb file being opened
repeatedly,
> presumably every time an error occurs. This means every time I get a
unique
> constraint failure which is fairly frequent.
> 
> Is there any way to convince oracle to read this file into core once
before it
> apache forks and not have it read it every time there`s an error? I
thought
> that`s what it did already.

No. But you could try hacking DBD::Oracle so it doesn`t call the Oracle
OCI function to fetch the error string. If that makes a significant
difference I`d consider making it an option.

Tim.


The problem is, the opens appear to be happening within
OCIStmtFetch, when the last row is reached, i.e.
when NO_DATA is returned.  I found this out by trussing
with user libs.  Here is the relevant part.  I have a 
one row query, so its the second fetch that causes the
read:

/1:     -> libclntsh:OCIStmtExecute(0x2301d4, 0x243bc4, 0x2303fc, 0x0)
write(5, "\09A\0\006\0\0\0\0\003 ^".., 154)     = 154
read(5, "0114\0\006\0\0\0\0\01019".., 2064)     = 276
brk(0x0024BAF0)                                 = 0
brk(0x0024DAF0)                                 = 0
/1:     <- libclntsh:OCIStmtExecute() = 0
/1:     -> libclntsh:OCIStmtFetch(0x243bc4, 0x2303fc, 0x1, 0x2)
/1:     -> libclntsh:kpufch(0x243bc4, 0x2303fc, 0x1, 0x2)
/1:     <- libclntsh:OCIStmtFetch() = 0
/1:     -> libclntsh:OCIStmtFetch(0x243bc4, 0x2303fc, 0x1, 0x2)
/1:     -> libclntsh:kpufch(0x243bc4, 0x2303fc, 0x1, 0x2)
open("/usr/oracle/product/8.1.6/rdbms/mesg/oraus.msb", O_RDONLY) = 6
fcntl(6, F_SETFD, 0x00000001)                   = 0
lseek(6, 0, SEEK_SET)                           = 0
read(6, "1513 "011303\t\t\0\0\0\0".., 256)      = 256
lseek(6, 512, SEEK_SET)                         = 512
read(6, "1C88 YBB xCE\0\0\0\0\0\0".., 512)      = 512
lseek(6, 1024, SEEK_SET)                        = 1024
read(6, "\018\0 $\0 7\0 @\0 J\0 V".., 512)      = 512
lseek(6, 39936, SEEK_SET)                       = 39936
read(6, "\0\t0519\0\0\0 >051A\0\0".., 512)      = 512
close(6)                                        = 0
/1:     <- libclntsh:OCIStmtFetch() = 100

notice that all the data comes back from the server during
the OCIStmtExecute.  The first OCIStmtFetch succeeds without
any further interaction with the server or will any file io.
It is the second OCIStmtFetch which causes the file io.

So is there any way to avoid this?  If I do a 
        $sth = $dbh->prepare
        $sth->fetch
        $sth->finish
I don't get the file io, but of course that only works
when I know that there is exactly one row.

-Paul






-----Original Message-----
From: Paul G. Weiss 
Sent: Wednesday, October 24, 2001 2:46 PM
To: '[EMAIL PROTECTED]'
Subject: RE: File read for every record retrieved


Correction.  Not every row - just once at the end of retrieving
all the rows.  Still - how can I avoid it?

-Paul

>  -----Original Message-----
> From:         Paul G. Weiss  
> Sent: Wednesday, October 24, 2001 2:30 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      File read for every record retrieved
> 
> I'm using DBD::Oracle to read records from an Oracle database.
> It's Oracle 8.1.6.2, DBI version 1.15, DBD::Oracle version 1.07.
> The platform is Solaris 2.7.
> 
> When trussing my Perl process, I've noticed the following lines
> between every record retrieved:
> 
> open("/usr/oracle/product/8.1.6/rdbms/mesg/oraus.msb", O_RDONLY) = 9
> fcntl(9, F_SETFD, 0x00000001)                   = 0
> lseek(9, 0, SEEK_SET)                           = 0
> read(9, "1513 "011303\t\t\0\0\0\0".., 256)      = 256
> lseek(9, 512, SEEK_SET)                         = 512
> read(9, "1C88 YBB xCE\0\0\0\0\0\0".., 512)      = 512
> lseek(9, 1024, SEEK_SET)                        = 1024
> read(9, "\018\0 $\0 7\0 @\0 J\0 V".., 512)      = 512
> lseek(9, 39936, SEEK_SET)                       = 39936
> read(9, "\0\t0519\0\0\0 >051A\0\0".., 512)      = 512
> close(9)                                        = 0
> 
> Can anyone explain what is going on here?  This file hasn't changed 
> since July.  Why is it being read for every record?
> 
> -Paul Weiss
> 

Reply via email to