BLOB column will caused large memory consumed ?

our appliation server is AS9.0.4 and
We using this Jdev 10g with BC4J and JSP
to build some application that contain blob column BC4J entity object, we found the blob column will caused the memory consumed issue , each time the contain blob column application page request by browser that will consume about 50M memory on OC4J component instance, and incremental by each request until the instance out of memory. It seems the garbage collection or memory leak problem ? or have another solution to avoid the memory problem

I encountered a similar problem when I was retrieving BLOB files in the .NET architecture. I used chunking to solve the problem.
What happens is that the server reads the entire BLOB into memory before it sends anything to the client requesting it. So I set it up so that I would read a chunk (say 32KB) of the BLOB into a byte array, transmit it to the client, then read the next chunk from the BLOB and use it to overwrite the byte array, and so on. That way the maximum amount of memory that can be used is no greater than the size you specify for the chunk.
This will cause downloads to slow, but it's the only way I know of to avoid massive memory consumption. Sorry I don't have any code to go with this, but I've just started working with Java/Jdeveloper recently. Hope this helps.

Similar Messages

  • 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!

  • Full text search in BLOB columns NOT Working

    Hi, I am using Oracle 9i.
    Presently I use following code to create index.
    begin
    Ctx_Ddl.Drop_Preference ('text_only');
    end;
    begin
    Ctx_Ddl.Create_Preference ( 'text_only', 'basic_lexer');
    Ctx_Ddl.Set_Attribute ( 'text_only', 'index_text', 'true' );
    Ctx_Ddl.Set_Attribute ( 'text_only', 'index_themes', 'false' );
    end;
    CREATE TABLE MY_XML_DOCS(
    XML_RES_ID NUMBER (16) NOT NULL,
    XML_RES BLOB NOT NULL,
    XML_RES_PATH VARCHAR2 (128),
    XML_DOCS_CREATED_BY VARCHAR2 (16) NOT NULL,
    XML_DOCS_CREATED_DT DATE NOT NULL,
    XML_DOCS_MODIFIED_BY VARCHAR2 (16),
    XML_DOCS_MODIFIED_DT DATE ) ;
    drop index FULL_TEXT_INDEX ;
    create INDEX FULL_TEXT_INDEX ON MY_XML_DOCS(XML_RES)
    INDEXTYPE IS ctxsys.CONTEXT
    parameters ('lexer text_only stoplist ctxsys.empty_stoplist');
    BEGIN
    CTX_DDL.sync_index('FULL_TEXT_INDEX ','10M');
    END;
    And I've some XML documents stored in blob columns in the above table. But my query with 'contains' param does not return expected results.(it presently returns no results). Do I miss anything? Do I need to specify any thing else while I create the Index? Kindly advice.

    I would agree the CLOB storage would be preferable for XML. If you are using BLOB storage, by default the documents are going to be FILTERed by the INSO_FILTERS. A BLOB column will give you reduced storage in a unicode environment though.
    If you wish to store your data in a BLOB though, you should specify the NULL_FILTER in your create index statement to avoid having the INSO_FILTERS invoked.
    Further, you may also require a CHARSET column in your table specifying the character set of your data for each row if it can vary. The Column should then also be specified in the 'PARAMETERS' clause of the create index statement, this way Oracle knows the correct character set to use when converting the binary data to character data.
    My guess that you are not getting any query results because none of the documents are actually being indexed. Be sure to query the ctx_user_index_errors view to determine if you are getting errors at indexing time.

  • How to upload/download file into/from blob column in ADF/JDev 11g.

    Hello to all.
    I found demo from Kuba user on that page: http://kuba.zilp.pl/?id=1
    But that demo is for release 10g and too complicated for me for this time (I'm fish in Jdeveloper).
    I can create some simple table view (of form view) with oracle connection with table with blob data.
    Blob column will content doc/xls/pdf ...etc.
    Now I can add two buttons for download and upload.
    What I have to do in next time?
    Is it possible to use some component or something?
    Thank you
    Ben

    I was able to accomplish downloading from a blob, but I'm trying to dynamically set the ContentType.
    As the table may contain different types of files, I'm setting the ContentType to #{row.Fileext}, where Fileext is set in SQL select as follows:
    pseudocode: get file extension, and set the content type based on file extension.
    sql select :decode(substr(fdv.file_name,instr(fdv.file_name,'.',-1,1)+1),'log','text/plain; charset=utf-8','xml','text/xml','xls','application/vnd.ms-excel','tif','image/tiff','jpg','image/jpeg','unknown')
    I rather use a fuction/method, and tried the following instead:
    ContentType = #{backingBeanScope.backing_processReqs.FileAttachContType}
    where FileAttachContType =
    public class ProcessReqs {
    public String FileAttachContType() {
    // code to substring filename for extension and decode values
    return strContType
    But I get the following error:
    Error 500--Internal Server Error
              javax.el.PropertyNotFoundException: The class 'sunrider.reqpoportal.view.backing.ProcessReqs' does not have the property 'FileAttachContType'.
                   at javax.el.BeanELResolver.getBeanProperty(BeanELResolver.java:547)
                   at javax.el.BeanELResolver.getValue(BeanELResolver.java:249)
                   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
    Ideas?
    PS: Kuba, I've been trying to get to your blog all day, and it would just time out.
    Thanks everyone in advance!
    -R
    Edited by: user6631964 on Jul 24, 2009 5:55 PM

  • Performance of LOB Segments for Blob Columns

    Hi,
    I am migrating 11,000 rows of tiff images from Informix to Oracle.In Informix the datatype for the image storage is Byte and Oracle we chose it to Blob.
    The Blob column is creating lob segment and lob index.
    When I do the migration I observe that the size of the lob segment object is increasing rather than the table object.
    So due to creation of this lob segment for the Blob column,will there be any performance issues while retrieval of images from the database and Inserting images into into the database.
    Can I get all the issues that can be encountered by storing data in blob column in terms of lob segment.
    This is very important information for us as the application has lot of SQL queries for retrieving and injecting images in the database.
    It will be really apprecialbe if you can provide Information about this.
    Thanks & Regards
    Ramanathan KrishnaMurthy

    I agree with D.Morgan that object type with 250 attributes is doubtful.
    I don't like object tables (tables with "row objects") too.
    But, your table is a relational table with object column ("column object").
    C.J.Date in An introduction to Database Systems (2004, page 885) says:
    "... object/relational systems ... are, or should be, basically just relational systems
    that support the relational domain concept (i.e., types) properly - in other words, true relational systems,
    meaning in particular systems that allow users to define their own types."
    1. How will Oracle store the data in the ADT column?...
    For some answers see:
    “OR(DBMS) or R(DBMS), That is the Question”
    http://www.quest-pipelines.com/pipelines/plsql/tips.htm#OCTOBER
    and (of course):
    "Oracle® Database Application Developer's Guide - Object-Relational Features" 10g Release 2 (10.2)
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14260/adobjadv.htm#i1006903
    Regards,
    Zlatko

  • Mdnsresponder will not quit.  Consumes above 100% CPU and kills my battery.  Also causes my fan to run constantly and my computer to get extremely hot.  Force quitting doesn't work.  It just comes back.

    The mdnsresponder will not quit.  Consumes above 100% CPU and kills my battery.  Also causes my fan to run constantly and my computer to get extremely hot.  Force quitting doesn't work.  It just comes back.   I posted about this earlier and never got an answer.  Somebody, please help. 
    Thanks.

    mDNSResponder is a background process that runs all the time. If you kill it, it's relaunched automatically.
    Please launch the Console application and select "system.log" from the file list. Enter "mDNSResponder" (without the quotes) in the search field. Post a sample of the log messages in the Console window -- only one example of each repeated message, please.

  • Problem inserting large files into a Blob-Column

    hi all,
    i am using a oracle 10g database.
    i defined a table including one blob column as follows:
    create table contact(
    id     number(22) primary key not null,
    lastupdated date not null,
    lastwriter_id number(22) not null,
    contacttype_id number(22) not null,
    notice varchar2(2000),
    attachment blob,
    attachmentname varchar2(255))
    tablespace users
    storage (initial 2M pctincrease 0)
    lob (attachment) store AS (
    tablespace users
    storage (initial 10M)
    enable storage in row
              pctversion 5
              chunk 1
    index lob_attachment_idx (tablespace users storage (initial 1M)));
    now i fill this table from a java application using hibernate.
    small files (for example 2700 chars) are ok, the pass into the attachment column.
    larger files dont go there. i receive no errormessage.
    whats going wronr?
    ist my create table statement wrong?
    thnax for help dieter

    Quick and dirty testcase:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table t;
    Table dropped.
    test@ORA10G> create table t (x blob);
    Table created.
    test@ORA10G>
    test@ORA10G> insert into t (x)
      2  select utl_raw.cast_to_raw(rpad('a',1000,'x')) from dual;
    1 row created.
    test@ORA10G>
    test@ORA10G> commit;
    Commit complete.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> select dbms_lob.getlength(x) as len, dbms_lob.substr(x,10,1) as chunk from t;
           LEN CHUNK
          1000 61787878787878787878
    test@ORA10G>
    test@ORA10G>pratz

  • Interactive Report will not save BLOB Column Attributes

    I have created many interactive reports with 4.0 and 4.1 that had BLOB columns with no problems and the download link worked fine. After upgrading to 4.2, the interactive reports get the following error when clicking on the download link:
    Not found
    The requested URL /apex/apex_util.get_blob was not found on this server
    If I open the edit page from the report, the BLOB downloads fine. When I looked at the report attributes details for the BLOB column, I noticed the BLOB Column Attributes had not been populated. I have tried repeatedly to populate them (Table Name, Column Name, Primary Key, MIMETYPE, etc.) but after applying the changes and reopening the attributes page for the blob column, the values I entered are not saved.
    For completeness, here is the select statement for the report:
    select "DESC_ATT_ID",
    "BR_ID",
    "FILENAME",
    "MIMETYPE",
    dbms_lob.getlength("DESC_ATTACHMENT") "DESC_ATTACHMENT"
    from "#OWNER#"."ALTEC_BR_DESC_ATT"
    WHERE BR_ID = :P3_BR_ID
    Also, here is the value for the Number/Date format for the BLOB Column:
    DOWNLOAD:ALTEC_BR_DESC_ATT:DESC_ATTACHMENT:DESC_ATT_ID
    Can someone please point me in the right direction to get the link for the interactive report working properly?
    Many thanks,
    Jerry

    Hello,
    How about you do not use BLOB format Column, you do it manually as this example here:
    apex.oracle.com
    workspace: somefeto
    user: test
    pwd: test
    Application 63066
    in the same workspace, there is      Sample File Upload and Download (App ID 10540), and it is working fine ....
    Otherwise, Pls, reproduce the problem on apex.oracle.com
    Best Regards,
    Fateh
    If you believe that my answer is correct or helpful to you, then pls, mark the answer as helpful or correct

  • Table with BLOB  column re-partitioning

    Currently I have a table with a blob column Z partitioned on Column X I want to re-partition the table on Column Y is there a quick way of doing this.
    INSERT INTO SELECT * has limitations on the blob size I guess.
    Can someone explain this?
    Edited by: user10229350 on Mar 1, 2010 7:36 AM

    I am using hash partitioning looks like split partition doesn't apply for hash partition:
    "The SPLIT PARTITION clause of the ALTER TABLE or ALTER INDEX statement is used to redistribute the contents of a partition into two new partitions. Consider doing this when a partition becomes too large and causes backup, recovery, or maintenance operations to take a long time to complete. You can also use the SPLIT PARTITION clause to redistribute the I/O load.
    This clause cannot be used for hash partitions or subpartitions."

  • Importing a table with a BLOB column is taking too long

    I am importing a user schema from 9i (9.2.0.6) database to 10g (10.2.1.0) database. One of the large tables (millions of records) with a BLOB column is taking too long to import (more that 24 hours). I have tried all the tricks I know to speed up the import. Here are some of the setting:
    1 - set buffer to 500 Mb
    2 - pre-created the table and turned off logging
    3 - set indexes=N
    4 - set constraints=N
    5 - I have 10 online redo logs with 200 MB each
    6 - Even turned off logging at the database level with disablelogging = true
    It is still taking too long loading the table with the BLOB column. The BLOB field contains PDF files.
    For your info:
    Computer: Sun v490 with 16 CPUs, solaris 10
    memory: 10 Gigabytes
    SGA: 4 Gigabytes

    Legatti,
    I have feedback=10000. However by monitoring the import, I know that its loading average of 130 records per minute. Which is very slow considering that the table contains close to two millions records.
    Thanks for your reply.

  • ORA-00600 error when inserting NULL in BLOB column

    Hi,
    I want to insert NULL value into a BLOB column w/o using empty_blob(), but I am getting the following error upon submission (both through program and upon directly executing it from TOAD/SQL*):
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kxtotolc_lobopt], [], [], [], [], [], [], []
    The query is as follows:
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Html, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size) values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, null, '1', '30670908')
    In the table r.Html, r.Original_Text are blob and clob columns respectively.
    If I remove the column r.Html (blob) and its corresponding value the following query executes fine :
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size)
    values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, '1', '30670908')
    I know I can also insert the query using the string empty_blob(), but I dont want to do it without using empty_blob() since it will involve changing my generic DB classes.
    The strange thing is that I created another table involving blob and clob columns through TOAD.
    In this table I can insert NULL values in the blob column without any error.
    Is there anything that can be done to insert a NULL into my blob column? Am I missing anything?
    Is there a setting in the database that will allow me to do this? cuz one table accepts null and the other doesn't. Its strange.
    I am using Oracle8i Enterprise Edition Release 8.1.7.0.0
    The query doen't execute through toad or sql* plus or through program (I am using thin oracle drivers: the usual classes12.zip file)
    thanks in advance
    - Nilesh

    From metalink
    Oracle 9i Message~~~~~~~~~~~~~~~~~
    Error:     ORA-14400 (ORA-14400)
    Text:     inserted partition key does not map to any partition
    Cause:     An attempt was made to insert a record into, a Range or Composite
         Range object, with a concatenated partition key that is beyond the
         concatenated partition bound list of the last partition -OR- An
         attempt was made to insert a record into a List object with a
         partition key that did not match the literal values specified for
         any of the partitions.
    Action:     Do not insert the key. Or, add a partition capable of accepting
         the key, Or add values matching the key to a partition
         specification
    >
    So check the date .
    What is your insert statement.
    Anand
    Edited by: Anand... on Mar 4, 2009 5:42 PM

  • Problem displaying PDF stored in BLOB column

    Hello everyone.
    I've been trying to follow this tutorial http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::p11_question_id:232814159006 on displaying PDFs stored in BLOB columns. This is being performed on Apex 4.2, with my DB running 11g. I've got my procedure, which I'll post below:
    create or replace procedure "PDF" (p_id IN gvo_documents.doc_id%type)
    is
        l_lob    blob;
        l_amt    number default 30;
        l_off   number default 1;
        l_raw   raw(4096);
    begin
        select contents into l_lob
            from gvo_documents
             where doc_id = p_id;
    -- make sure to change this for your type!
        owa_util.mime_header( 'application/pdf' );
        begin
            loop
              dbms_lob.read( l_lob, l_amt, l_off, l_raw );
              htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
              l_off := l_off+l_amt;
              l_amt := 4096;           
        end loop;
            exception
               when no_data_found then
                  NULL;
            end;
    end;
    I am trying to run this through a PL/SQL dynamic region and while I don't receive any error's, the content displayed is a huge mess of garbled text and odd characters. I've tried to run this procedure on numerous other document types, including word files and jpeg images, all with the necessary changes in my procedure, and regardless of what I use, I still get a large mess of strange characters. Does anyone have any information or ideas about why this is happening?

    If I understand correctly, your requirements needs to be broken down into two problems:
    1) click link that pops up a window displaying a new APEX page
    2) an APEX page the displays the document, not downloads it.
    I haven't done #1 (yet).
    However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
    This has a related question, but no answer yet:
    open pdf in popup browser window
    The key is target="_blank" for the anchor tag.
    To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
    If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
    For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
    From what I remember:
    Start with a blank page with one blank HTML region (all the Items go in the HTML region)
    Add an Item for the PK/Doc_ID
    part I forgot Create a Data Manipulation Process
    - Automated Row Fetch
    - On Load - After Header
    - (stuff for your table/view)
    part I forgot Create an (I believe) "File Browser" item type. For Settings:
    - Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
    - MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
    - Filename Column: (column name) -- I highly recommend you have this.
    - Content Disposition == INLINE <-- this is the kicker
    Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
    Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
    Again, I don't remember the exact details, but that should cover most of it.
    MK

  • Image stored in BLOB column crashes report's engine

    Hi,
    I have a report where I display logos stored in a BLOB column on the DB.
    The report is generated as RTF.
    When images have sizes of 624x168 or 423x324 everything is OK. One image, 1221x224, is crashig the report with a dr. Watson error.
    Any idea why?
    The size of the "bad" image file is 38K, and the "good" ones are about 300K.
    Monica

    Sajjad wrote:
    I altered student table to store photoes of students. For this I added STIMG as blob, MIMETYPE,FILENAME,IMAGE_LAST_UPDATE COLUMNS to studentadmitted table. Image stored and displayed in report very nicely. With the following query
    select "ROWID",
    "ST_ID",
    "FIRST_NAME",
    "LAST_NAME",
    "FFIRST_NAME",
    "FLAST_NAME",
    "COURSE_ID",
    "SESSION_ID",
    "CONTACT#" "CONTACT_H",nvl(dbms_lob.getlength(STIMG),0) IMAGE
    from "#OWNER#"."STUDENTADMITTED"
    Images are displayed in column but they have different sizes.Stick to declarative BLOB images as above. They can be resized in reports using CSS. Add a style sheet in the page Inline CSS property:
    td[headers="IMAGE"] img {
      display: block;
      width: 75px;
      border: 1px solid #999;
      padding: 6px;
      background: #f6f6f6;
    }where the <tt>IMAGE</tt> value in the attribute selector is the table header ID of the image column. Setting only one dimension (in this case the width) scales the image with the correct aspect ratio. (The border, padding and background properties are just eye candy...)
    However, if the original images are large then scaling them in the browser this way is a huge waste of bandwidth and produces poorer quality images than creating proper scaled down versions using image tools. Downloading megapixel images and then reducing them to thumbnail size results in pointlessly pushing millions of bytes that will never be seen.
    For improved performance and image quality, and where you require image-specific scaling the best approach is to use the database ORDImage object to produce thumbnail and preview versions automatically. Note that this is not possible in Oracle XE as Multimedia is not included

  • Apex 4.0 display image item :BLOB column returned by SQL statement

    Hello
    I'm creating an display image item in apex 4.0. The source is a BLOB column returned by SQL statement.
    When I'm issuing an sql statement like this:
       select lado.blob_content
       from   large_documents      lado
       ,        large_doc_headers    ladh
       where lado.ladh_nr = ladh.nr
       more criteriait works fine.
    When I create a function inside a package with the same query (in a cursor)
    function get_image(some parameters in) return blob
    Following in apex by:
    select get_image(some parameters) from dualI get a
    ORA-06502: PL/SQL: numeric or value error: character string buffer too smallAnybody any idea why this does not work?
    Regards Erik

    Hi Eric,
    the environment assumes varchar2-output by default, which will be limited to 32767 characters and may have problems with binary formats. You could define a blob-variable to select the value into.
    DECLARE
      l_blob BLOB;
    BEGIN
      SELECT get_image(some parameters)
        INTO l_blob
        FROM dual;
    END;
    /If you expect the BLOB-Content to be text (you should consider CLOB then), you may use UTL_RAW.CAST_TO_VARCHAR2 to convert the content. If your object is larger than the maximum varchar2 size, or you want to convert BLOB to CLOB, you might be interested in some converter like described here: {message:id=559749}
    Hope this is what you were searching for.
    -Udo

  • Stuck threads reading blob column from db table

    WLS 10.3.5, JDK 1.6u29, Oracle 11g RAC, ojdbc6 latest driver
    We're having problems with stuck threads trying to read a blob column from a DB table. The query to extract the blob is a simple select, without any locking such as "for update" clauses or whatever. The blob's size is <= 100k.
    The thread dump shows the following stack trace:
    +"[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native+
    +     java.net.SocketInputStream.socketRead0(Native Method)+
    +     java.net.SocketInputStream.read(SocketInputStream.java:129)+
    +     oracle.net.ns.Packet.receive(Packet.java:300)+
    +     oracle.net.ns.DataPacket.receive(DataPacket.java:106)+
    +     oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)+
    +     oracle.net.ns.NetInputStream.read(NetInputStream.java:260)+
    +     oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:105)+
    +     oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1517)+
    +     oracle.jdbc.driver.T4C8TTILobd.unmarshalLobData(T4C8TTILobd.java:476)+
    +     oracle.jdbc.driver.T4C8TTILob.readLOBD(T4C8TTILob.java:770)+
    +     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:361)+
    +     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)+
    +     oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:146)+
    +     oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2392)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:348)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:222)+
    +     weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB.getBytes(Unknown Source)+
    +     com.ibatis.sqlmap.engine.type.BlobTypeHandlerCallback.getResult(BlobTypeHandlerCallback.java:33)+
    +     com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult(CustomTypeHandler.java:52)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getPrimitiveResultMappingValue(ResultMap.java:619)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:345)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)+
    +     com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:282)"[STUCK] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native+
    +     java.net.SocketInputStream.socketRead0(Native Method)+
    +     java.net.SocketInputStream.read(SocketInputStream.java:129)+
    +     oracle.net.ns.Packet.receive(Packet.java:300)+
    +     oracle.net.ns.DataPacket.receive(DataPacket.java:106)+
    +     oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:315)+
    +     oracle.net.ns.NetInputStream.read(NetInputStream.java:260)+
    +     oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:105)+
    +     oracle.jdbc.driver.T4CMAREngine.getNBytes(T4CMAREngine.java:1517)+
    +     oracle.jdbc.driver.T4C8TTILobd.unmarshalLobData(T4C8TTILobd.java:476)+
    +     oracle.jdbc.driver.T4C8TTILob.readLOBD(T4C8TTILob.java:770)+
    +     oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:361)+
    +     oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)+
    +     oracle.jdbc.driver.T4C8TTILob.read(T4C8TTILob.java:146)+
    +     oracle.jdbc.driver.T4CConnection.getBytes(T4CConnection.java:2392)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:348)+
    +     oracle.sql.BLOB.getBytes(BLOB.java:222)+
    +     weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB.getBytes(Unknown Source)+
    +     com.ibatis.sqlmap.engine.type.BlobTypeHandlerCallback.getResult(BlobTypeHandlerCallback.java:33)+
    +     com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult(CustomTypeHandler.java:52)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getPrimitiveResultMappingValue(ResultMap.java:619)+
    +     com.ibatis.sqlmap.engine.mapping.result.ResultMap.getResults(ResultMap.java:345)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:384)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:300)+
    +     com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:189)+
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)+
         com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
    +     com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:541)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)+
    +     com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:94)+
    +     com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:282)+
    Some threads eventually end (after 1-2 hours), most of them remain there for days.
    Any hint would be quite useful, thanks.

    Threads are executing the actual allocated request from the Weblogic Kernel. Most of the problems happen when the Thread execution is reaching the application or business layer.
    At this point your application Java code module is sending or receiving data from external sources such as a an Oracle database for example. Any problem with such external system will cause the Thread to hang and wait for data to come back.
    Other situations can occur such as internal deadlock, infinite looping, heavy IO contention on your server etc.
    Doesn't loo like a driver issue.
    http://docs.oracle.com/cd/E21764_01/doc.1111/e14770/weblogic_server_issues.htm#autoId2
    Check at the Database end
    Cheers ...

Maybe you are looking for