Temp CLOB tablespace not released - Returning CLOB from SP
I'm trying to call a stored procedure from a .NET application that returns a CLOB as an OUT parameter. The problem that we are experiencing the tablespace allocation from the temporary clob created in the stored procedure is not released after the stored procedure is finished executing. Here is an extract of the code we use to create the CLOB
DBMS_LOB.createTemporary(TempCLOB, FALSE, DBMS_LOB.CALL);
XMLDOM.writeToClob(xmlDocumentNode, TempCLOB); --write the xml results to the clob
Then the TempCLOB is returned to .NET as an OUT parameter. After the procedure is executed the lob locators in v$temporary_lobs rise by one for each execution of the stored procedure. We've tried using DBMS_LOB.freetemporary(TempCLOB) but the CLOB variable is returned to .NET as null.
Anyone have any ideas of how to properly dispose of the temp CLOB?
> Anyone have any ideas of how to properly dispose of the temp CLOB?
Using DBMS_LOB.FreeTemporary() after the temp CLOB has been used..
Have the .NET client call this PL/SQL API call when it is done with the CLOB. Remember that what is passed to the .NET client is a pointer to the temp CLOB - not the temp CLOB itself. Therefore if you release the CLOB and then pass the pointer to the client, that pointer refers to nothing.
The client uses this pointer to access bits and pieces of the CLOB (in temp space on the Oracle Server). When the client is done, it is only good manners on the client's part to inform the server that it is done with that server resource and that it can be released.
Ditto with ref cursors.
Similar Messages
-
I recently switched from an iPhone to an Android phone. I cannot receive text messages because Apple will not "release" my number from iMessage. I see others have had the same issue. How did you solve the problem, if you did?
This tech note addresses your problem: iOS: Deactivating iMessage
-
Premiere Elements 13 issue with the mouse on MAC OSX Yosemite 10.10.1
When I select a clip of video and move to a different place in my time line, Premiere Elements 13, will not release the clip from the mouse.
The clip follows my mouse movements and goes to other places in my time line.
I try to delete these extra insertions, but the mouse will not release the clip.
Action I’ve taken: I’ve re-installed Premiere Elements 13. Problem remains.
This issue has consumed too much of my time and does not go away. It ruins my video.
Help please.
ThanksI tried using the Guest Account on my Mac. In the Guest Account, Illustrator works perfect!
Then I started wondering what processes (tools/tweaks) I run by default on my account. Turned out the problem was called by a little background tool called RightZoom. RightZoom let's the green 'zoom' button always maximize your current window.
So thanks! Problem solved! -
Problem is releasing excel application from memory using webutil
Hi Experts,
This code is working fine but it is not releasing the excel from the memory. if i try the same set of code with Wort.Applicationa or Access.Application it works fine. But only with excel it is not working.
Is there is any way to kill the excel application?
application := CLIENT_OLE2.create_obj('Excel.Application');
CLIENT_OLE2.invoke(application,'Quit');
CLIENT_OLE2.release_obj(application);
Thanks & Regards
RajeshThis is probably <Bug:3082119 which is fixed in the production release.
Regards
Grant Ronald
Forms Product Management -
XML,CLOB AND MEMORY : CONSUMED BUT NOT RELEASED !!!
Hi,
I'm working with XMLGEN Package and XSLT Processor to produce XML Document on Oracle 8.1.7.3 server, I use 9i XML and Java packages.
I'm facing the following BIG MEMORY problem :
Environment : I must generate an XML parsed with an XSL document of 80Mo (nearly 22 000 rows),
as XMLGEN is on DOM parsing method, I extract my XML by 500 Rows and I loop until 22 000 rows. I use DBMS_JOB with jobs who read and execute export each minute.
The algorithme is :
keeprow=22000
while keeprow>0
Create 3 clob (DBMS_LOB Package) : one for XSL Sheet, one for XML and one for result
GetXML (XMLGEN Package)
Transform in XSL (XSL Processor)
Write to disk (UTL_FILE Package)
Free the 3 Clob ((DBMS_LOB Package))
keeprow =keeprow-500
loop
The problem : The process start at 250Mo ot total memory and END at 1000 Mo of used memory and NEVER RELEASE 1 ko of memory.
So often I get a JavaOutOfMemoryError (I've allocated 1Go Ram to my JAVA process).
Any help will be very very appreciated !
My derived problem is 22 000 rows is not enough I've some export of 200 000 rows to do (And I cannot allocate 10 Go of RAM !!!)
Following My PL/SQL Code.
Regards
Fred
PROCEDURE DO_EXPORT_XML(
P_JOB_ID JOB_PARAMETRE.JOB_ID%TYPE,
P_JOB_ID_ORDRE JOB_PARAMETRE.JOB_ID_ORDRE%TYPE,
P_CLE_UP UPLOADREQ_TEMP.ID%TYPE,
P_LOAD_OR_DELOAD VARCHAR2)
IS
L_FILE_NAME JOB_PARAMETRE.JOB_FILE_NAME_DEST%TYPE;
L_REP_NAME JOB_PARAMETRE.JOB_REP_NAME_DEST%TYPE;
L_FILE_STYLESHEET JOB_PARAMETRE.JOB_STYLESHEET%TYPE;
L_VERSION_PDM JOB_PARAMETRE.JOB_VPDM%TYPE;
P_SELECT varchar2(4000):='';
P_CURSOR varchar2(4000):='';
l_filehandler_out UTL_FILE.FILE_TYPE;
--Variable pour le traitement par lot de 500
L_NBROW_TODO_ATONCE number := 500;
L_NBROW_MIN number := 1;
L_NBROW_MAX number := -1;
L_NBROWKEEPTODO number := -1;
xslString CLOB := null;
res number default -1;
xmlString CLOB := null;
li_ret number := 0;
li_faitle number := 0;
amount integer:= 255;
li_loop integer := 0;
charString varchar2(255);
ls_deload varchar2(255) default '';
ls_SQL varchar2(4000) default '';
ls_temp_file varchar2(255) default '';
text_file_dir varchar2(32) := 'e:\temporarydir';
l_par xmlparser.parser;
l_xml xmldom.domdocument;
l_pro xslprocessor.processor;
l_xsl xslprocessor.stylesheet;
docfragnode xmldom.DOMNode;
docfrag xmldom.DOMDocumentFragment;
l_parsedclob clob := null;
l_amount binary_integer := 32767;
l_ligne varchar2(32767);
l_offset number default 1;
l_pos number default null;
l_pos2 number default null;
l_lobsize number default null;
l_memsize number default 1073741824; --1024 Mo
l_mempipo number default 0;
type rc is ref cursor;
l_cursor rc;
cursor TEMPLATE is select UNSPSC,1 as NB from UPLOADREQ_TEMP where 1=2;
c1rec TEMPLATE%rowtype;
BEGIN
l_mempipo:=setmaxmemorysize(l_memsize);
dbms_lob.createtemporary(l_parsedclob, true, dbms_lob.session);
dbms_lob.createtemporary(xmlstring, true, dbms_lob.session);
--return the good select
GET_SELECT_TO_EXPORT_XML(P_JOB_ID , P_JOB_ID_ORDRE , P_CLE_UP , P_SELECT,P_CURSOR, P_LOAD_OR_DELOAD);
SELECT JOB_FILE_NAME_DEST,JOB_REP_NAME_DEST,JOB_STYLESHEET
INTO L_FILE_NAME,L_REP_NAME,L_FILE_STYLESHEET
FROM JOB_PARAMETRE
WHERE JOB_ID =P_JOB_ID AND JOB_ID_ORDRE=P_JOB_ID_ORDRE;
l_filehandler_out := UTL_FILE.FOPEN(text_file_dir, L_FILE_NAME, 'w',l_amount);
--Return XSL Sheet in a clob : cause of memory consumed but not released
xslString := METACAT.load_a_file( 1,L_FILE_STYLESHEET);
open l_cursor for P_CURSOR;
LOOP
fetch l_cursor into c1rec;
exit when l_cursor%notfound;
L_NBROW_MIN := 1;
L_NBROW_MAX := 0;
L_NBROWKEEPTODO:=c1rec.NB;
LOOP
begin
if(L_NBROWKEEPTODO > L_NBROW_TODO_ATONCE) THEN
begin
L_NBROW_MAX:= L_NBROW_TODO_ATONCE + L_NBROW_MAX;
L_NBROWKEEPTODO:= L_NBROWKEEPTODO - L_NBROW_TODO_ATONCE;
end;
else
begin
L_NBROW_MAX:= L_NBROW_MAX + L_NBROWKEEPTODO;
L_NBROWKEEPTODO:=0;
end;
end if;
--on ouvre le fichier de risultats
ls_SQL:= P_SELECT || ' AND ( ROWNUM BETWEEN ' || L_NBROW_MIN || ' AND ' || L_NBROW_MAX || ' ) and UNSPSC=''' || c1rec.UNSPSC || '''';
ls_temp_file := c1rec.UNSPSC || '_' || L_FILE_NAME;
L_NBROW_MIN:=L_NBROW_TODO_ATONCE + L_NBROW_MIN;
--CAT_AUTOLOAD.JOB_ADD_TRACE (P_JOB_ID,'UPLOAD REQUISITE : Export donnies REQUETE ' || to_char(li_loop), ls_SQL,'',0,0);
xmlgen.resetOptions;
xmlgen.setErrorTag('ERROR_RESULT');
xmlgen.setRowIdAttrName('NAH');
xmlgen.setRowIdColumn('NAH');
xmlgen.setEncodingTag('ISO-8859-1');
xmlgen.useNullAttributeIndicator(false);
if(xmlString is not null) then
dbms_lob.open(xmlString,dbms_lob.lob_readwrite);
l_lobsize:= dbms_lob.Getlength(xmlString);
if(l_lobsize>0) then
dbms_lob.erase(xmlString,l_lobsize,1);
end if;
dbms_lob.close(xmlString);
dbms_lob.freetemporary(xmlString);
dbms_lob.createtemporary(xmlstring, true, dbms_lob.session);
end if;
--Return XML in a clob : cause of memory consumed but not released
xmlString := xmlgen.getXML(ls_SQL,0);
l_par := xmlparser.newparser;
xmlparser.parseclob(l_par, xslString);
l_xsl := xslprocessor.newstylesheet(xmlparser.getdocument(l_par),null);
xmlparser.parseclob(l_par, xmlString);
l_xml := xmlparser.getdocument(l_par);
l_pro := xslprocessor.newprocessor;
xslprocessor.showWarnings(l_pro, true);
xslprocessor.setErrorLog(l_pro, text_file_dir || substr(ls_temp_file,0,length(ls_temp_file)-4) || '_logerreur.XML');
if(l_parsedclob is not null) then
dbms_lob.open(l_parsedclob,dbms_lob.lob_readwrite);
l_lobsize:= dbms_lob.Getlength(l_parsedclob);
if(l_lobsize>0) then
dbms_lob.erase(l_parsedclob,l_lobsize,1);
end if;
dbms_lob.close(l_parsedclob);
dbms_lob.freetemporary(l_parsedclob);
dbms_lob.createtemporary(l_parsedclob, true, dbms_lob.session);
end if;
--Return XML Processed with XSL in a clob : cause of memory consumed but not released
xslprocessor.processxsl(l_pro,l_xsl,l_xml,l_parsedclob);
--release NOTHING
xmlparser.freeparser(l_par);
xslprocessor.freeprocessor(l_pro);
l_ligne:='';
l_offset :=1;
l_pos := null;
l_pos2 := null;
if(li_loop=0) then
begin
--on ouvre le fichier et on sauve l'entete + les donnies dedans.
l_pos:=dbms_lob.instr(l_parsedclob,'</DATA>');
if ( nvl(l_pos,0) > 0 ) then
loop
if(l_pos-1>l_amount + l_offset ) then
l_ligne:=dbms_lob.SUBSTR(l_parsedclob,l_amount,l_offset);
UTL_FILE.PUT(l_filehandler_out,l_ligne);
UTL_FILE.fflush(l_filehandler_out);
l_offset:=l_offset+l_amount;
else
l_ligne:=dbms_lob.SUBSTR(l_parsedclob,l_pos-1 -l_offset ,l_offset);
UTL_FILE.PUT(l_filehandler_out,l_ligne);
UTL_FILE.fflush(l_filehandler_out);
exit;
end if;
end loop;
else
EXIT;
end if;
end;
else
--on met les donnies donc on ne repete pas le debut
begin
l_pos:=dbms_lob.instr(l_parsedclob,'<ITEM');
if ( nvl(l_pos,0) > 0 ) then
l_pos2:=dbms_lob.instr(l_parsedclob,'</DATA>');
if ( nvl(l_pos2,0) > 0 ) then
loop
if(l_pos + l_amount <= l_pos2 -1 ) then
l_ligne:=dbms_lob.SUBSTR(l_parsedclob,l_amount,l_pos);
UTL_FILE.PUT(l_filehandler_out,l_ligne);
UTL_FILE.fflush(l_filehandler_out);
l_pos:=l_pos +l_amount;
else
l_ligne:=dbms_lob.SUBSTR(l_parsedclob,l_pos2 -1 -l_pos,l_pos);
UTL_FILE.PUT(l_filehandler_out,l_ligne);
UTL_FILE.fflush(l_filehandler_out);
exit;
end if;
end loop;
else
exit;
end if;
end if;
end;
end if;
li_loop:=li_loop + 1 ;
--UTL_FILE.FCLOSE(l_filehandler_in);
JAVA_GC();
EXIT WHEN L_NBROWKEEPTODO=0;
Exception
when others then
begin
-- IF(utl_file.is_open(l_filehandler_in)) THEN
-- utl_file.fclose( l_filehandler_in);
-- END IF;
IF(utl_file.is_open(l_filehandler_out)) THEN
utl_file.fclose( l_filehandler_out);
END IF;
RAISE_APPLICATION_ERROR(-20001,'File with errors');
end;
END;
END LOOP;
END LOOP;
CLOSE l_cursor;
if ( xmlString is not null ) then
dbms_lob.open(xmlString,dbms_lob.lob_readwrite);
l_lobsize:= dbms_lob.Getlength(xmlString);
if(l_lobsize>0) then
dbms_lob.erase(xmlString,l_lobsize,1);
end if;
dbms_lob.close(xmlString);
dbms_lob.freeTemporary( xmlString);
end if;
if(l_parsedclob is not null) then
dbms_lob.open(l_parsedclob,dbms_lob.lob_readwrite);
l_lobsize:= dbms_lob.Getlength(l_parsedclob);
if(l_lobsize>0) then
dbms_lob.erase(l_parsedclob,l_lobsize,1);
end if;
dbms_lob.close(l_parsedclob);
dbms_lob.freetemporary(l_parsedclob);
end if;
UTL_FILE.NEW_LINE(l_filehandler_out);
l_ligne:='</DATA></CATALOG>';
UTL_FILE.PUT(l_filehandler_out,l_ligne);
UTL_FILE.FCLOSE(l_filehandler_out);
EXCEPTION
when others then
begin
IF(utl_file.is_open(l_filehandler_out)) THEN
utl_file.fclose( l_filehandler_out);
END IF;
end;
END;
******************************Thank you for the info - I had no idea I was puing myself in danger by cutting it so close. Since your post I have moved my iphoto library to an external drive and now have 165 GB of space on my HD. Following this I have 2 questions.
1. Since my available HD space was reduced by the size of the photo download it seems logical that the download is somewhere on my HD still. Is there a place where these photos might be hiding on my HD even though they are not available on the iphoto library?
2. I was able to recover the .jpg files which are fine. I also recovered the .mov files but they have been compromised. I am hoping I can find the originals still on the HD somewhere. If not, do you have any suggestions for recovery methods or programs? I have not used the SD card since the incident so I should be able to attempt another recovery to salvage the .mov files if there is an alternative method/program available.
Thanks again! -
Clob temporary table space is not released
In our java web application, it uses datasource to call oralce stored procedure and get back data in Clob data type. The oracle version is 8.1.7.4. After the database call, the database connection is closed. But I found that the tablespace for Clob data is not released. Right now it becomes a critical issue of our production database. Anybody has any clue? Really appreciate.
Team,
We have a table of size 550gigs in size and we truncated the table , truncated sucessfully but space is not released in os level, what action we can take to release the space and this table has only one row and contains the binary data.
Thanks
PGR
Hello,
Yes space wont be released immediately .If large extents are in picture which I assume is your case it goes into deferred drop a background process which will execute after some time( time may vary).See below link for details.
As per BOL if extents are more than 128 it goes in deferred drop.
http://msdn.microsoft.com/en-us/library/ms177495.aspx
You should wait for some time .keep checking the free space
Below discussion will surely help you in understanding.See Jonathan's reply
http://social.msdn.microsoft.com/Forums/en-US/4aa2537e-246b-4bfe-818d-3482531d9149/sql-server-2005-massive-400gb-table-dropped-space-not-released
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Queries are not releasing temp tablespace in 11g standard edition
Queries are not releasing temp tablespace in 11g standard edition
user8928004 wrote:
Hi any one faced one issue.... please help
Patience, Grasshopper
You posted this follow-up a mere two minutes after your previous post.
This forum is not a chat line, and it is not paid support.
Everyone here has a job for which they are paid, and this forum is not it.
No one is responsible for monitoring it and giving a quick response.
Furthermore, it is a global forum. The person with the information you seek may very well live 20 time zones away from you and was going to bed just as you posted. He will not even see your post for several more hours.
Your original post went up in the middle of the night for half the world.
No one with the information you seek is deliberately withholding it until you sound sufficiently desperate.
======================================================
Please present evidence to backup your assertion that "Queries are not releasing temp tablespace"
From the very fine 11g Database Administrator's Guide, at Managing Tablespaces
Space Allocation in a Temporary Tablespace
You can view the allocation and deallocation of space in a temporary tablespace sort segment using the V$SORT_SEGMENT view. The V$TEMPSEG_USAGE view identifies the current sort users in those segments.
When a sort operation that uses temporary space completes, allocated extents in the sort segment are not deallocated; they are just marked as free and available for reuse. -
HELP! RETURN CLOB from External DLL
Hi
I am working on an External DLL using OCI. Basically, PL/SQL
calls an
External DLL to process the data and then returns LOB back to
the PL/SQL
procedure. Inside the DLL, I created a Temporary lob to process
the data.
The error is prompted from PL/SQL:
SQL> exec isdb.test_clob;
Before original length=10
ORA-24805: LOB type mismatch
ORA-06512: at "ISDBSVR.ISDB", line 24
ORA-06512: at "ISDBSVR.ISDB", line 29
ORA-06512: at line 1
So far I know that error is caused by the return from PLS_CLOB
is not clob.
"After_original := PLS_CLOB(before_original); {you will see more
code in the
below}" However inside the DLL, I have defined OCIClobLocator
and
OCI_TEMP_CLOB to carry the CLOB data.
I have found the following observations:
1. If I change everything to blob, it works fine. (such as
OCILobLocator,
OCI_TEMP_CLOB and all variables in PL/SQL)
2. If I run the same DLL and PL/SQL in 9i, it works fine (clob
too)
I guess it would be a bug for clob, please help to check thanks
-- CODE - PL/SQL
CREATE OR REPLACE PACKAGE BODY "ISDBSVR"."ISDB"
as
Function PLS_CLOB(var_clob in clob)
RETURN clob IS
EXTERNAL LIBRARY bb
WITH CONTEXT
NAME "Encrypt_Blob"
LANGUAGE C
PARAMETERS
CONTEXT,
var_clob,
var_clob INDICATOR SB4,
RETURN INDICATOR SB4
PROCEDURE TEST_CLOB IS
before_original cLOB;
After_original cLOB;
CHAR_TO_CLOB varchar(200);
bsize int;
BEGIN
CHAR_TO_CLOB := 'AAAAAAABBBBBBCCCCCCC';
dbms_lob.createtemporary( before_original, TRUE );
DBMS_LOB.write( before_original,10,1,CHAR_TO_CLOB);
bSize := DBMS_LOB.GetLength(before_original);
DBMS_OUTPUT.PUT_LINE('Before original length='||bSize);
After_original := PLS_CLOB(before_original);
bSize := DBMS_LOB.GetLength(After_original);
DBMS_OUTPUT.PUT_LINE('After original length='||bSize);
dbms_lob.freetemporary(before_original);
END;
END ISDB;
/* CODE - DLL */
EXPORT OCILobLocator * EncryptBlob(OCIExtProcContext
*with_context,
OCILobLocator *plaintext2,
sb4 pt_indicator2,
sb4 *ret_indicator
{ FILE *fp;
OCIClobLocator *cipherbb;
ub4 amount;
ocictx oci_ctx;
ocictx *oci_ctxp = &oci_ctx;
status = OCIExtProcGetEnv(with_context,
&oci_ctxp->envhp,
&oci_ctxp->svchp,
&oci_ctxp->errhp);
status = OCIDescriptorAlloc(oci_ctxp->envhp,
(dvoid **) &cipherbb,
(ub4) OCI_DTYPE_LOB,
(size_t) 0,
(dvoid **) 0);
status = (int) OCILobCreateTemporary(oci_ctxp->svchp,
oci_ctxp->errhp, cipherbb,
OCI_DEFAULT,
OCI_DEFAULT,
OCI_TEMP_CLOB, OCI_ATTR_NOCACHE,
OCI_DURATION_SESSION);
amount = 6;
status = OCILobCopy(oci_ctxp->svchp,
oci_ctxp->errhp,
cipherbb,
plaintext2,
amount,
(ub4) 1,
(ub4) 1);
*ret_indicator = OCI_IND_NOTNULL;
OCIDescriptorFree((dvoid *) cipherbb, (ub4) OCI_DTYPE_LOB);
return(cipherbb);In what database version did you observe the problem?
Thomas -
Space is not released from tablespaces even after purging recycbin
Hi,
I had 168GB of space occupied by recyclebin objects (BIN$...) when i queried on dba_segments, after purging the recyclebin it is showing 0.
But i didn't find any difference in the free space dba_free_space in tablespaces before and after purging.
Is it the thing that even after purging recycbin, it is not released the space for respective Tablespaces?
Also wanted to know how to release the space.
Thanks,
MahiIf you have a table X, with segments in tablespace TS, and you drop the table, you now have a recycle bin object BIN$X that owns those same segments in that same tablespace TS. That's why the segments still appear in DBA_SEGMENTS. But Oracle knows that it is free to reuse the segments associated with BIN$X if it runs out of other space to use (and Oracle knows to reuse segments from recycle bin objects in the order they were dropped) so the segments are free in DBA_FREE_SPACE. Just like deleting a file on the file system is just updating a pointer to some sort of file allocation table but not actually removing the bits from the hard drive, dropping an object when the recycle bin is just marking the segments as no longer associated with a real object.
I have no idea whether 11g has changes to recover index names-- you might take a look at the 11g documentation (either the New Features guide or the Flashback Drop docs).
Justin -
Can you tell me why my temp tablespace can not release automatically?
when i up the database, the temp tablespace is used by o,but after some time it is used 99.99%,even all the task are finished,it is still used 99.99%,and can not release automatically!
who can tell me than is why?Are you receiving an error ?
A "Temporary" tablespace manages it's allocation differently than a normal tablespace. The idea is to avoid the overhead of extent allocation, etc.
Take a look at:
http://asktom.oracle.com/pls/ask/f?p=4950:8:134496932618587661::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:108812348061,
or
http://asktom.oracle.com/pls/ask/f?p=4950:8:134496932618587661::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1384603628260,
or (these URLs don't seem to be pasting correctly)
go to Ask Tom and search on "temporary" in the "page contains" option in advance search.
Ken -
Using WCF Cutom Adapter to return CLOB (or similar)
Hi all,
I am trying to return mulitple sets of data from an Oracle table each of which exceed VARCHAR2(4000).
I wish to do this in one call to a stored procedure as the intention is to assign the returned data to a messages body parts so that I can send them as multiple seperate attachments to an email (using the SMTP adapter).
My oracle stored procedure and returned data types are as follows:
PROCEDURE get_job(
po_job_id OUT jobs.job_id%TYPE, po_endpoint OUT data.endpoint%TYPE,
po_job_type OUT job_types.job_type_id%TYPE, po_data OUT rec_data_table);
TYPE rec_data_table IS TABLE OF rec_data
INDEX BY BINARY_INTEGER;
TYPE rec_data IS RECORD (
data CLOB
--data VARCHAR2(4000));
If I do restrict the data to VARCHAR2(4000), as shown commented out in the rec_data RECORD above everything works fine.
However, to return anything larger I believe would require me to return a CLOB (even though I would probably only be returning data of a few MBytes not GBytes).
Having tried this I get the following error:
"The adapter "WCF-Custom" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.TargetSystemException: ORA-03113: end-of-file on communication channel
Process ID: 499868
Session ID: 201 Serial number: 33735 ---> Oracle.DataAccess.Client.OracleException: ORA-03113: end-of-file on communication channel
Process ID: 499868
Session ID: 201 Serial number: 33735"
I am using Oracle 11gR2, BizTalk 2010 and the WCF adapter with oracle bindings.
Researching this I find conflicting information:
"LOB types: The WCF-based Oracle DB adapter provides rich support for BLOB, CLOB and BFILE types in tables and stored procedures/functions. The adapter also exposes special operations for streaming BLOB/CLOB/BFILE data in the WCF service model
interface." Source: http://blogs.msdn.com/b/adapters/archive/2007/10/29/biztalk-oracle-adapter-vs-wcf-based-oracle-db-adapter.aspx
“Due to the limitation of associative arrays, PL/SQL tables or PL/SQL tables of records that contain any of the following data types are not supported in the Oracle Database adapter:
BFILE
BLOB
CLOB ……….”
Source: http://msdn.microsoft.com/en-us/library/dd788520.aspx
Also, this post (http://social.msdn.microsoft.com/Forums/en-US/303cc67c-5e01-4ecb-ba5c-184a1d73a7f7/biztalk-wcf-adpater-oracle-store-procedure-returning-clob?forum=biztalkediandas2) seems to indicate
it is possible but there is no detail so not sure if it matches my requirements.
I have also had a quick look at the
Operate_LOB sample but not sure if this will provide me with the solution I am after as I really wanted to return an array of CLOBS (or similar).
I have seen various other posts but nothing that definitively answers my questions and from my tests I would say that I can’t easily return largish amounts of data (a few MBs) in a single element
from Oracle …. unless of course I am missing something.
Can anyone give me a definitive answer as to whether I can do what I have set out above … if not I will turn my attention to a different solution.
Many Thanks for any help/advice you can provide,
Regards,
DaveFrom your description, it can hardly give precise troubleshooting for this problem, you can
consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:
http://support.microsoft.com/default.aspx -
My Task is To Parse a XML Document to Return CLOB's
Hi folks
I am writing this mail in the hope of getting a help.Please
give me a shoulder to keep me going.
The task is to parse a XML document for a specific Tag and
read the Tag content in CLOB to return CLOB.
I know that the writetoclob will do the job as
per oracle documentation.
I am giving the code where i got stuck.
Please help me complete my rest of coding.
Thanks
Input variables are
XMLin in CLOB, -- Incoming XML Document Structure
Partype in varchar2, -- Tagname
Result out CLOB -- Return Tag value CLOB data type.
My Code : -
Declare
p xmlparser.parser;
d xmldom.DOMDocument;
e xmldom.DOMElement;
nl xmldom.DOMNodeList;
n xmldom.DOMNode;
tagvalue varchar2(255);
paramsIn Clob;
result CLOB;
BEGIN
--loading SecXML
dbms_lob.createtemporary(paramsIn,true);
dbms_lob.append(paramsIn,XMLin);
--dbms_output.put_line('ParsebyTag ='||Partype);
--defining parser
p := xmlparser.newparser;
xmlparser.parseClob(p,paramsIn);
d := xmlparser.getDocument(p);
--get tagvalue
nl := xmldom.getElementsByTagName(d,partype);
n := xmldom.item(nl,0);
IF xmldom.getlength (nl) > 0
THEN
n := xmldom.item (nl, 0);
=>=>=> => xmldom.writetoclob (n, result); <=<=<=<=<=<=====
END IF;
return; -- from a procedure
The above line marked with a arrow does not work for CLOB Variables.
Please explain with a corrected code to complete this task.
Thanks for reading my request.
Please reply to this message poster as i am frequently
checking this to see a answer.
my email is [email protected]
Balaji.First, you have 2 variables with the same name,
Second, let me show you what is that you need to do:
PROCEDURE WriteDataToClob(XMLin in CLOB, Partype in varchar2, Result out CLOB) IS
Declare
p xmlparser.parser;
d xmldom.DOMDocument;
e xmldom.DOMElement;
nl xmldom.DOMNodeList;
n xmldom.DOMNode;
tagvalue varchar2(255);
TempClob Clob;
BEGIN
--Create a temporary clob
dbms_lob.createtemporary(TempClob,true);
--loading SecXML
--defining parser
p := xmlparser.newparser;
xmlparser.parseClob(p,XMLin);
d := xmlparser.getDocument(p);
--get tagvalue
nl := xmldom.getElementsByTagName(d,partype);
n := xmldom.item(nl,0);
IF xmldom.getlength (nl) > 0 THEN
n := xmldom.item (nl, 0);
xmldom.writetoclob (n, TempClob );
END IF;
Result := TempClob;
dbms_lob.FreeTemporary(TempClob);
END; -
Hi,
could you do me help?
i can not insert a string into a oracle clob field, it echo as:
ORA22920 row containing the lob value is not locked. ORA 06512 at "SYS.DBMS_LOB" line 708
ORA 06512 at line 1;
what its means? please.
my table defined as : create table clob1(id number(5),mclob clob default empty_clob()); the id is create by a sequece of test_sequence automaticly.
my code as belows:
import java.io.*;
import java.sql.*;
//import oracle.sql.*;
public class test4 {
public static void main(String args[]) {
String url_String
= "jdbc:oracle:thin:test/test@myhost:1521:myorcl";
try {
Class.forName
("oracle.jdbc.driver.OracleDriver");
java.sql.Connection con =
java.sql.DriverManager.getConnection(url_String);
con.setAutoCommit(true);
Statement stmt
=con.createStatement();
String sqlStr ="insert into
clob1 (mclob) " + "values(empty_clob())";
stmt.executeUpdate(sqlStr);
String query = "select
test_seq.CURRVAL from dual";
ResultSet rs =stmt.executeQuery
(query);
rs.next();
int currval =rs.getInt(1);
query = "select * from clob1 where
id="+currval;
String str
="abcedefhijklmnopqrstuvwxyz";
rs =stmt.executeQuery(query);
rs.next();
java.sql.Clob clob1
=rs.getClob(2);
oracle.sql.CLOB clob=
(oracle.sql.CLOB)clob1;
System.out.print(clob);
java.io.Writer
wr=clob.getCharacterOutputStream();
wr.write(str);
wr.flush();
wr.close();
stmt.close();
con.close();
} catch(Exception ex) {
System.err.println("SQLException: "
+ ex.getMessage());
nullHi,
To avoid ORA-22920 error while selecting lob column, use the 'for update' clause in the select statement like :
query = "select * from clob1 where id="+currval+" FOR UPDATE" ;
This should solve the problem. However, after fixing this, you might get the error :
java.sql.SQLException: ORA-1002: fetch out of sequence
I got this error when testing your code. To avoid this error, before executing 'select ... for update' statement Set AutoCommit to OFF, like :
query = "select * from clob1 where id="+currval+" FOR UPDATE" ;
con.setAutoCommit(false);
rs =stmt.executeQuery(query);
Hope that Helps,
Srinivas -
Hello,
Does anyone have any examples of how a CLOB datatype can be returned from a stored procedure and used in java?
Currently we are building up strings and returning a VARCHAR2 datatype, but are running into the 32k size restriction as some of the strings are too long.
It seems that converting the strings to CLOBs and then returning is the best solution. Has anyone had a similar problem and solved it?
Regards,
EoinCreate stored procedure like this :
create or replace procedure getclob(var out clob) as
str varchar2(20);
templob CLOB;
begin
str :='mystring';
DBMS_LOB.CREATETEMPORARY(templob, TRUE, dbms_lob.session);
dbms_lob.write(templob,length(str),1,str);
var :=templob;
DBMS_LOB.FREETEMPORARY(templob);
end;
java program to call above stored procedure
import java.sql.*;
import oracle.jdbc.driver.*;
class SPLobInJava
public static void main(String args[]) throws Exception
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@insn104:1521:ora9idb", "scott", "tiger");
CallableStatement cs;
cs = conn.prepareCall("{call getclob(?)}");
cs.registerOutParameter(1,java.sql.Types.CLOB);
cs.execute();
Clob clob =cs.getClob(1);
// do whatever you want with the clob
System.out.println(clob.getSubString(1,5));
cs.close();
conn.close();
} -
Error While returning CLOB back to Front End Application
Hi All,
I have stored procedure which generate XML CLOB and returns CLOB back to front end application.
But when my CLOB exceeds some limit the front end application is not able get the CLOB.
Following is the error i am getting.
Procedure call to stored procedure
_len number;
l_buf VARCHAR2(32767);
v_ret_clob CLOB:=' ';
begin
Orcl_Proc_Ctrl_4_Xml.EXECUTE_CONTROL(v_clob,v_ret_clob);
l_len := dbms_lob.getlength(v_ret_clob);
dbms_output.put_line('the return size OF CLOB------> '||l_len);
dbms_lob.read(v_ret_clob, l_len, 1, l_buf);
virsa_dbms_output(l_buf,100);
end;
Error Output
the return size OF CLOB------> 113906
BEGIN test_oraact1019; END;
ERROR at line 1:
ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 715
ORA-06512: at "APPS.TEST_ORAACT1019", line 16
ORA-06512: at line 1
I am able to get the Size of CLOB but when i try give back to Front end application it is not properly passing CLOB.
Any help on this.
Thanks in advance
PrashantPlease also post this in the XML DB forum:
XML DB
Maybe you are looking for
-
My Note 4 is slow to download apps, sometimes won't at all.
Since I bought my Note 4, it has been slow to download apps... usually it is so slow it won't finish at all. I usually show 4G and three or four bars. When at home and connected to my wireless router, there is no difference. In fact, sometimes it
-
I've been having an issue transferring some of my song files in itunes via homesharing from my "old computer" an ibook G4 to my "new computer" a MacBook Pro. I've been able to transfer the majority of the songs; however, when i try to import certain
-
Facing Problem in Executing T-codes
Hi SAP Exoerts, I am assigned to work on Travel Management. System Admin guys has given me the access for T-codes TRIP, TP20 But even after giving access both t-codes are not working system says Infotype P0017 could not be read. I also check infotype
-
How to clone & sync systems?
Hi How do I sync my files from one mac to another? I have a macbookpro 15 and would like to copy ALL files to another macbook pro 13. Is there a way to "migrate" all files without having to re-install all apps? And is there a way to syn both of my ma
-
Adobe Flash Games Will Not Load
I have updated Firefox to latest version 26.0...also updated Adobe flash to Version 12.0.7.148...also updated video drivers for Pc..also cleared cache...also updated windows xp to windows 7..also made sure all add on were enabled that are suppose to