Integer overflow in OCI8

A

Andreas Habel

Hi,

I`m writing a tiny agent in ruby to simplyfy my daily dba jobs and
monitor the database activity, especially the state of my standby databases.

My library of choice is RubyOCI8 because it`s the only one I think,
where I can logon as SYSDBA. Please correct me if I´m wrong!

The following statement caused OCI8 to die
SQL> SELECT * FROM DBA_TEMP_FILES;

OCIError: ORA-01455: Ueberlauf von Integer-Datentyp bei Umwandlung der
Spalte
#translation: Overflow of integer-datatype during conversion of column

from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch_a_row'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `do_ocicall'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch_a_row'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:312:in `fetch'
from ./lib/database.rb:284:in `tempfiles'
from (irb):16


My system:
RDBMS Oracle 9.2.0.4 Enterprise / Standard Edition (tested both)
Client 9.2.0.6 / 10.0.1.3 (tested both)
OS: Windows 2000 / 2003 (Client / Server)
RubyInstaller is up to date

The killing value seems to be the column MAXBYTES with a value of
34,359,721,984. The strange thing is, if I call DBA_DATA_FILES instead,
where MAXBYTES is equal to MAXBAYTES in *_TEMP_FILES, I got no problems.

Can anyone imagine what`s the problem ?

Below you see the result of the query in SQL*Plus.

Thx
Andreas



FILE_NAME
--------------------------------------------------------------------------------
FILE_ID TABLESPACE_NAME BYTES BLOCKS STATUS
---------- ------------------------------ ---------- ---------- ---------
RELATIVE_FNO AUT MAXBYTES MAXBLOCKS
INCREMENT_BY
------------ --- ------------------------------------ ----------
------------
USER_BYTES USER_BLOCKS
---------- -----------
H:\ORACLE\ORADATA\BODEV\TEMP01.DBF
1 TEMP 131072000 16000 AVAILABLE
1 YES 34359721984 4194302
80
130023424 15872
 
K

KUBO Takehiro

Andreas Habel said:
Hi,

I`m writing a tiny agent in ruby to simplyfy my daily dba jobs and
monitor the database activity, especially the state of my standby databases.

My library of choice is RubyOCI8 because it`s the only one I think,
where I can logon as SYSDBA. Please correct me if I´m wrong!

The following statement caused OCI8 to die
SQL> SELECT * FROM DBA_TEMP_FILES;

OCIError: ORA-01455: Ueberlauf von Integer-Datentyp bei Umwandlung der
Spalte
#translation: Overflow of integer-datatype during conversion of column

from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch_a_row'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `do_ocicall'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:499:in `fetch_a_row'
from c:/ruby/lib/ruby/site_ruby/1.8/OCI8.rb:312:in `fetch'
from ./lib/database.rb:284:in `tempfiles'
from (irb):16

Please change line 449 of oci8.rb as following:
From: if precision <= 9 # the precision of Fixnum (assuming 31 bit integer)
To: if precision > 0 && precision <= 9 # the precision of Fixnum (assuming 31 bit integer)

The datatype of MAXBYTES is NUMBER whose scale and precision are not
specified. In that case scale and precision are zeros, so ruby-oci8
define it as Fixnum.
My system:
RDBMS Oracle 9.2.0.4 Enterprise / Standard Edition (tested both)
Client 9.2.0.6 / 10.0.1.3 (tested both)
OS: Windows 2000 / 2003 (Client / Server)
RubyInstaller is up to date

The killing value seems to be the column MAXBYTES with a value of
34,359,721,984. The strange thing is, if I call DBA_DATA_FILES instead,
where MAXBYTES is equal to MAXBAYTES in *_TEMP_FILES, I got no problems.

In my environment I get problems in also DBA_DATA_FILES.

BTW I must release ruby-oci8 next version...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top