tokpela has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have run into an issue when inserting BLOBs into Oracle using DBI.
When our database ran out of space - records were still inserted into the table but the BLOBs were not inserted resulting in incomplete records (zero byte BLOBs).
I have been tasked with making sure that my script does not insert a row if this space issue comes up again. Our DBA created a test database for me to test this issue.
I created a test script to test insertions using both AutoCommit and a manual commmit/rollback insert.
When using AutoCommit - the record is inserted with a zero-byte BLOB. By inserted - I mean that the other non-BLOB data fields were inserted into the table.
DBI trace (level 1) shows the lob extension failure:
abcdefghijklmnopqrstuvw...', :p8=561] at test_script.pl line 75. ][ORA +-01691: unable to extend lob segment OBX.SYS_LOB0000095979C00009$$ by + 128 in tablespace OBX (DBD ERROR: OCILobWrite in post_execute_lobs)] at te +st_script.pl line 81.
Using manual commit/rollback, the results were as expected with no record inserted into the table and the following message received:
abcdefghijklmnopqrstuvw...', ...)= ( 1 ) [1 items] at test_file.txt li +ne 71 <- bind_param_inout(8, SCALAR(0x276f2f4), ...)= ( 1 ) [1 items] at + test_script.pl line 72 !! ERROR: 1691 'ORA-01691: unable to extend lob segment OBX.SYS_LO +B0000095979C00009$$ by 128 in tablespace OBX (DBD ERROR: OCILobWrite +in post_execute_lobs)' (err#1) <- execute= ( undef ) [1 items] at test_file.txt line 75 !! ERROR: 1691 CLEARED by call to rollback method <- rollback= ( 1 ) [1 items] at test_file.txt line 80 <- DESTROY(DBI::st=HASH(0x276f014))= ( undef ) [1 items] at test_s +cript.pl line 81 <- DESTROY(DBI::db=HASH(0x265ed64))= ( undef ) [1 items] at test_s +cript.pl line 81
While I can fix this issue easily by making the script use a manual commit/rollback - my question is whether the AutoCommit response is as expected? I would have expected the same result with the entire record being rolled back.
Has anyone else had any experience with this issue?
Thank you!
Chris
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI BLOB Insert Issue - Database out of space
by FloydATC (Deacon) on Mar 18, 2015 at 09:33 UTC | |
|
Re: DBI BLOB Insert Issue - Database out of space
by erix (Prior) on Mar 18, 2015 at 09:43 UTC |