Using BLOB or BFILE datatype

Hi, anyone used BLOB or BFILE before?
Currently I am thinking of using BLOB or BFILE to store documents (.doc, .pdf, .ppt, .rft, .csv). Can decide yet on which to use. Anyone got any recommendation on which to use?
1. Any performace issue when using blob after i had stored it in a different tablespace?
2. Will it take much longer time for export if to use blob.
3. As for BFILE will it get corrupted if the physical files is delete or been moved to some other location?
Thanks you in advance, you comments/advice is greatly appreciated..
Regards,
lbinsoon

1. If the blob is in a different tablespace from the row it resides in, that is not a performance impact.
2. Yes. And how much depends on how much blob data you have. This is because BFILE data is not exported, only the pointers are. So, if you have blob data, it IS exported, making for longer running exports.
3. Yes. Well, not corrupted, but, of course, you won't be able to access the file. You must update it to point to the new name or location, which can be done with a simple update stmt thus:
update bf set b = bfilename('d:\tmp','some_binary_file.dat')
assuming column b is of type BFILE.
Tom Best

Similar Messages

  • How to convert file format using bfile datatype

    <pre>
    Hi all,
    Assume, i has a table BFILE_IMAGE and it table structure is similar like:
    SQL> desc bfile_image;
    Name Null? Type
    IMAGE_ID NUMBER
    FILE_NAME VARCHAR2(30)
    IMAGE BINARY FILE LOB
    SQL>
    Is that impossible if we can use process() function with bfile datatype? similar like:
    ordsys.ordimage.process(image,'fileFormat=JPEG contentFormat=24BITRGB');
    The line above is work with blob datatype but doesn't with bfile datatype. Can you please give me some idea how to deal with it.
    Thanks,
    Kevin

    a BFILE is content stored outside the Oracle database. It is a read-only object.
    process() is an in-place modification of the image. This is only possible with BLOB stored content.
    If you are using BFILE you could use the processCopy() method to create a new copy of the BFILE stored image that has been processed according to your command.

  • Using BLOB,BFILE

    hello Gurus,
    I want to know these two things
    ٭ How to use BLOB data type?
    ٭ How to use BFILE data type?
    Regards
    Santosh Kumar

    Apart from what Raford mentioned, you should also keep in mind about the security aspect of it.
    Documents stored in db are more secured or can be made more secured.
    When you use bfiles, they are stored in OS and thus can be deleted intentionally or by mistake.
    Performance wise, they donot make much difference even though bfile have an overhead of going to file system to fetch the fiiles/information.

  • Example of PL/SQL PROGRAM USING  BLOB datatype

    give me one example of PL/SQL PROGRAM BY USING BLOB DATATYPE

    Try this link
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96591/toc.htm
    Best Regards
    Krystian Zieja / mob

  • Can we use BLOB fields (that store images) in Crystal Report ?

    I'm developing with ASP.NET, VS.NET 2003.
    Using Crystal Report for VS.NET
    DataBase: Oracle 10g
    I store a BLOB field in a table. This field store images, like jpg files.
    The Stored Procedure that I use to fill the report is:
    OPEN MyCursor FOR
    SELECT MyId , MyImg
    FROM MyTable
    MyImg is BLOB field
    However, when I try to use the stored procedure in Crystal Report at design mode, any field can be displayed and then drag and drop to the report, but MyImg is not possible.
    There is an error message:
    Details: ADO Error Code: 0x80004005
    Source: Microsoft OLE DB Provider for Oracle
    Description: Data type is not supported
    I'm afraid that is not so easy for me to change DB connector drivers.
    My question is:
    - Is it possible to use BLOB fields in Cyrstal Reports?
    - Or should I convert them previously to something, so they can be displayed in Crystal Report at desing mode ?
    - If I should change DB connector drivers, which one should I use and from where should I download it and then install it in my Web Server?
    Thank you very much!

    Hi,
    I dont know much at all about CR, but I do know Microsoft's OLEDB Provider for Oracle doesnt support Blob datatype.. http://support.microsoft.com/kb/q244661/
    Oracle's OLEDB provider does though, you can get it as part of the ODAC download on OTN.
    Hope that helps,
    Greg

  • Can we use BLOB instead of LONG RAW in JMSStore

    (Oracle 9i, Weblogic 8.1.2)
              We are putting in place a Dataguard environment (or standby database). In such environment, prod data is copied to another database in 'pseudo' real time. Unfortunately some 'old' datatypes are not supported by Dataguard. In JMS tables %JMSSTORE, the field RECORD is defined as LONG RAW and LONG RAW is one of the unsupported datatypes.
              Can we alter those tables in order to use BLOB instead of LONG RAW ?
              Regards,
              Bao Nguyen
              

    Hi Bao,
              Answers in-line:
              Bao Nguyen wrote:
              > (Oracle 9i, Weblogic 8.1.2)
              >
              > We are putting in place a Dataguard environment (or standby database). In such environment, prod data is copied to another database in 'pseudo' real time. Unfortunately some 'old' datatypes are not supported by Dataguard. In JMS tables %JMSSTORE, the field RECORD is defined as LONG RAW and LONG RAW is one of the unsupported datatypes.
              >
              > Can we alter those tables in order to use BLOB instead of LONG RAW ?
              Not supported in 8.1. A supported Oracle BLOB capability will be
              available in the next release. I can think of two
              possible work-arounds:
              (1) The following might work, but is not currently supported by
              BEA: Manually create the table with a BLOB type and use
              an Oracle OCI or BEA type IV driver. Definitely do NOT use
              an Oracle thin driver, as data corruption may result.
              (2) I recall that another customer had a replication product
              they were able to get working with LONG RAW by modifying
              the table definition so that the table's handle index was a primary key.
              I do not remember the name of the product.
              (The latter modification is supported for certain releases
              now - but I think this usage must be confirmed with customer support.)
              Tom
              >
              > Regards,
              >
              > Bao Nguyen
              >
              

  • Export and Import Of Tables having BLOB and Raw datatype

    Hi Gurus,
    I had to export one schema in one database and import to another schema in another database.
    However my current database contains raw and blob datatype.I have exported the whole database by the following commnad
    exp SYSTEM/manager FULL=y FILE=jbrms_full_19APR2013.dmp log=jbrms_full_19APR2013.log GRANTS=y ROWS=y
    My question is if all the tables with raw and blob have been exported properly or not.I have done one more thing after taking the export , I have imported to local db and checked the no of rows in the both the envs are same.As I have not tested with the application to confirm.
    I am using this version of Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    not able to attach the complete log file but for the schema jbrms which has the blob and raw datatype.
    Please let me know if you find some potential concerns with the export for BLOB and raw
    . about to export JBRMS's tables via Conventional Path ...
    . . exporting table FS_FSENTRY 8 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table FS_WS_DEFAULT_FSENTRY 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BINVAL 60 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BUNDLE 751 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_REFS 4 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_FS_FSENTRY 1 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BINVAL 300 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BUNDLE 11654 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_REFS 1370 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.

    You could see the 'QUESTIONABLE STATISTICS' warning for a couple of reasons. I don't remember them all but.
    1. If the target and source character set is different.
    2. system generated names (I think?)
    the best solution if you don't need the exact statistics that are on your source database would be to add
    statistics=none
    to your imp command and then regather statistics when the imp command is done.
    Dean

  • Blobs and bfiles

    i hav tried many examples of blobs and bfiles but without any success.
    when i used bfiles it creates a directory but i cant see the directory in the drive.
    even with blobs i have never been able to insert rows into it. i cannot even use Select * from tablename if it has a blob column
    can somebody help

    The directory is created in the DB and not on your disk
    You should be able to see it with a "select * from all_directories" ( if you have enough
    permisson )
    Then when you try to select all the data of the table that contains BLOB, you can't obtain the result. But you can do :
    select DBMS_LOB.GETLENGTH(name of the column that contains BFILE or BLOBS) from tabel
    You will obtain the size of the file inserted ...
    To see the images, you have to use Dev2k for instance.
    null

  • Retrieve image file from FORMS 10G using BLOB

    Dear all,
    i inserted one record in a table for the following procedure.
    Create Or Replace Procedure Blob_Xl Is
    l_blob Blob;
    l_bfile Bfile;
    Begin
    Insert Into LOB_TABLE Values ( 'TEST1', Empty_Blob() )
    Returning BLOBDATA Into l_blob;
    l_bfile := Bfilename( 'TEST1', 'I.JPG');
    dbms_lob.fileopen( l_bfile,dbms_lob.file_readonly );
    dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile ) );
    dbms_lob.fileclose( l_bfile );
    Commit;
    End Blob_Xl;
    after that
    record also inserted, i check thro count.
    i try to retrieve that image from that table for using following procedure, in that procedure i called from one button in forms 10g and wrote in when button pressed , when i clicked it wont show any images.
    where i am wrong?
    Create Or Replace Procedure get_img As
    vblob Blob;
    buffer Raw(32000);
    buffer_size Integer := 32000;
    offset Integer := 1;
    Length Number;
    Begin
    owa_util.mime_header('image/JPG');
    Select BLOBDATA Into vblob From LOB_TABLE Where No = 'TEST1';
    Length := dbms_lob.getlength(vblob);
    While offset < Length Loop
    dbms_lob.Read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    End Loop;
    Exception
    When Others Then
    htp.p(Sqlerrm);
    End;
    /

    hi
    try something like this for retrieve.May it helps u.
    DECLARE
    directions CLOB;
    directions_1 VARCHAR2(300);
    directions_2 VARCHAR2(300);
    chars_read_1 BINARY_INTEGER;
    chars_read_2 BINARY_INTEGER;
    offset INTEGER;
    BEGIN
    --Retrieve the LOB locator inserted previously
    SELECT falls_directions
    INTO directions
    FROM waterfalls
    WHERE falls_name='Munising Falls';
    --Begin reading with the first character
    offset := 1;
    --Attempt to read 229 characters of directions, chars_read_1 will
    --be updated with the actual number of characters read
    chars_read_1 := 229;
    DBMS_LOB.READ(directions, chars_read_1, offset, directions_1);
    --If we read 229 characters, update the offset and try to
    --read 255 more.
    IF chars_read_1 = 229 THEN
    offset := offset + chars_read_1;
    chars_read_2 := 255;
    DBMS_LOB.READ(directions, chars_read_2, offset, directions_2);
    ELSE
    chars_read_2 := 0;
    directions_2 := '';
    END IF;
    --Display the total number of characters read
    DBMS_OUTPUT.PUT_LINE('Characters read = ' ||
    TO_CHAR(chars_read_1+chars_read_2));
    --Display the directions
    DBMS_OUTPUT.PUT_LINE(directions_1);
    DBMS_OUTPUT.PUT_LINE(directions_2);
    END;
    sarah
    Edited by: S@R@h on Oct 7, 2009 11:29 PM

  • How to display .doc/.xls file uploaded using blob type of column in table.

    Hi,
    Here
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    I learnt about uploading & viewing file through BLOB in a form or report . It works fine for pictures & notepad file. But when i upload word file (i.e. *.doc) or excel file ( *.xls ) , and try to view it through DOWNLOAD
    it gives message box
    ' Do you want to save this file, or find program online to open it?'
    I searched lot but enable to find proper & easy to understand solution.
    Hope understand my problem.
    Thanks in advance.

    Hi,
    I am using table emp having fields id,name,,,,,,,,,photo,mimetype,filename,last_update_date.
    photo is of type BLOB. I updated photo (text item) on form.
    I Used BLOB DOWNLOAD Format Mask with appropriate entries & selected display as Attachment.
    So my problem is partially solved. Now if DOWNLOAD link on Form is clicked it displays Excel sheet
    in different window. But still, DOWNLOAD link on my Interactive report not working properly.
    DOWLOAD on interactive if it is clicked it has two problems
    1) It opens image or notepad file in same window.
    2) Not able to open Excel sheet.
    thanks for reply.

  • Upload Images onto oracle using BLOB

    Hi,
    I'm attempting to insert an image on to Oracle10g using BLOB.
    Does anyone hv any idea how to do that with Java?
    Any help will be great.
    Andrea.

    Here you can find a possible solution.

  • Using BLOB for storing OLE Item and Concadinating

    Hi,
    We are using BLOB data type to store Word document using OLE
    interface in forms 6i. It is working fine.
    Now we want to merge two or more BLOB items to one item to make
    the document as a single document. We tried to use
    DBMS_LOB.APPEND package to do the same but we could see only the
    first document that is appended and the remaining documents are
    not visible. When we analyzed the size of the BLOB item, it is
    getting increased whenever we append another document.
    Looking for the solution urgently. It would be better to have
    the code that is used for doing this.
    Thanks in Advance,
    Ganesan

    What you say seems quite normal.
    You should not use dbms_lob.append, but rather call Word and
    copy the text & other objects from one of the LOBs to the end of
    the other one.
    I wish I could tell you more about how to do that, but I don't
    know. I'm still looking for more doco on the methods &
    properties for Word & XL to be invoked when using OLE2.

  • Show photoes using blob field in Oracle DB

    When create Crystal report using Blob field in Oracle 10g DB, the photoes are tif format stored in blod and there are multipages for every record. However in the Crystal Report,it just show the first page of the photo.
    Are there some ways to display all the pages? Or is it necessary to programming using java or .net to display?

    Not capable. CR will only show the first picture and not an album.

  • Using blob or clob from db as document

    I'm changing a working process to fetch an XDP document from a database rather than fetch from resources:// on the Adobe server. The DB2 database field containing the XDP is a clob data type. We were using blob. The services operations are:
    - Foundation/JdbcService/Query Single Row   this fetches the XDP
    - Foundation/SetValue/Execute   this converts whatever was fetched into a document variable
    - Forms/FormsService/renderPDFForm   this merges the document with XML and produces PDF output
    I'm unable to write the database field into a variable due to lack of choices. For instance there is no BLOB or CLOB variable type in the list of available types. When using STRING I get the following error:
    Caused by: java.io.NotSerializableException: com.ibm.db2.jcc.b.ub
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
        at com.adobe.idp.dsc.util.CoercionUtil.toString(CoercionUtil.java:498)
    When using XML I get the following error:
    Caused by: com.adobe.workflow.WorkflowRuntimeException: Invalid location: /process_data/@clob_XDP_string cannot be stored for action instance: -1
        at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionCo ntextImpl.java:701)
    When using OBJECT I get the following error:
    Caused by: com.adobe.workflow.WorkflowRuntimeException: Invalid location: /process_data/@clob_XDP_string cannot be stored for action instance: -1
        at com.adobe.workflow.pat.service.PATExecutionContextImpl.setProcessDataValue(PATExecutionCo ntextImpl.java:701)

    Steve,
    Going against DB2 doesn't work for me with a document variable type. It gives a coercion error.
    I did solve my problem though from the following URL: http://groups.google.com/group/livecycle/browse_thread/thread/6c4b9156b52b71a7
    JYates:
    You can do this, but you have to  use the Execute Script service -- at this time there isn't a deployable component for it.
    Use this sort of script in the Execute Script service to read  the PDF blob from the database and populate a Document variable.
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.sql.DataSource;
    import javax.naming.InitialContext; 
    int processId =  patExecContext.getProcessDataIntValue("/process_data/@id"); 
    InitialContext context = new InitialContext();
    Connection connection = ((DataSource)context.lookup("java:/IDP_DS")).getConnection(); 
    String queryQuery = "select bigdocument, bigstring from tb_pt_workwithxlobs where process_instance_id = ?";
    PreparedStatement queryStatement = connection.prepareStatement(queryQuery); 
    try {
       queryStatement.setInt(1, processId);
       ResultSet results = queryStatement.executeQuery();
       results.next();
       java.sql.Blob documentBlob = results.getBlob(1);
       com.adobe.idp.Document document = new com.adobe.idp.Document(documentBlob.getBinaryStream());
       patExecContext.setProcessDataValue("/process_data/@NewBigDocument",document);
       java.sql.Clob stringClob = results.getClob(2);
       patExecContext.setProcessDataValue("/process_data/@NewBigString",stringClob.getSubString( 1L,(int)stringClob.length()));
    catch(Exception ex) {
       ex.printStackTrace();
    queryStatement.close();
    connection.close();

  • Invoking a service using BLOB data syntax

    Hi All,
    When invoking LC using BLOB the syntax is:
    //Create a BLOB object
    BLOB inDoc = new BLOB();
    //Populate the BLOB objects remoteURL data member
    inDoc.remoteURL = urlData;
    //Invoke the EncryptDocument process
    BLOB outDoc = encryptClient.invoke(inDoc);
    How the syntax goes when my service has also an input string variable,
    and how to handle the result if it also returns output string
    variable?
    Thanks in advance!

    Hi Jasmin,<br /><br />I've copied this code from "Invocation API quick starts" document,<br />see the full code:<br /><br />import com.adobe.idp.services.*;<br />import java.io.File;<br />import java.io.FileOutputStream;<br />import java.io.InputStream;<br />import java.net.URL;<br />import javax.activation.DataHandler;<br />import javax.activation.FileDataSource;<br />import org.apache.axis.attachments.AttachmentPart;<br />public class InvokeDocumentEncryptDime {<br />public static void main(String[] args) {<br />try{<br />//create a service locator<br />EncryptDocumentServiceLocator locate = new<br />EncryptDocumentServiceLocator();<br />  //specify the service target URL and object type<br />URL serviceURL = new<br />URL("http://localhost:8080/soap/services/EncryptDocument?blob=dime");<br />//Use the binding stub with the locator<br />EncryptDocumentSoapBindingStub encryptionClientStub = new<br />EncryptDocumentSoapBindingStub(serviceURL,locate);<br />encryptionClientStub.setUsername("administrator");<br />encryptionClientStub.setPassword("password");<br />//Get the DIME Attachments - which is the PDF document to encrypt<br />java.io.File file = new java.io.File("C:\\Adobe\\Loan.pdf");<br />//Create a DataHandler object<br />DataHandler buildFile = new DataHandler(new FileDataSource(file));<br />//Use the DataHandler object to create an AttachmentPart object<br />AttachmentPart part = new AttachmentPart(buildFile);<br />//get the attachment ID<br />String attachmentID = part.getContentId();<br />//Add the attachment to the encryption service stub<br />encryptionClientStub.addAttachment(part);<br />//Inform ES where the attachment is stored by providing the attachment id<br />BLOB inDoc = new BLOB();<br />inDoc.setAttachmentID(attachmentID);<br />BLOB outDoc = encryptionClientStub.invoke(inDoc);<br />//Go through the returned attachments and get the encrypted PDF document<br />byte[] resultByte = null;<br />attachmentID = outDoc.getAttachmentID();<br />//Find the proper attachment<br />Object[] parts = encryptionClientStub.getAttachments();<br />for (int i=0;i<parts.length;i++){<br />AttachmentPart attPart = (AttachmentPart) parts[i];<br />if (attPart.getContentId().equals(attachmentID)) {<br />//DataHandler<br />buildFile = attPart.getDataHandler();<br />InputStream stream = buildFile.getInputStream();<br />byte[] pdfStream = new byte[stream.available()];<br />stream.read(pdfStream);<br />//Create a File object<br />File outFile = new File("C:\\Adobe\\EncryptLoan.pdf");<br />//Create a FileOutputStream object.<br />FileOutputStream myFileW = new FileOutputStream(outFile);<br />//Call the FileOutputStream objects write method and pass the pdf<br />data<br />myFileW.write(pdfStream);<br />//Close the FileOutputStream object<br />myFileW.close();}}}<br /><br />The process I wish to invoke has 2 input parameters:<br />string variable  and a document,also this process returns a string and document as output.<br /><br />Do you have any example how to invoke it and handle its result?<br /><br />Thanks!

Maybe you are looking for

  • Bean: define problem in tomcat.But it is working fine in Jdeveloper. Why?

    I am use a logic iterator tag for a dropdown list and bean :define for the show the values of the drop down list in jdeveloper. But in tomcat when i use this same code i got the following errors. org.apache.jasper.JasperException: Unable to compile c

  • Issues With Permissions With iTunes/iMac

    Hey there - I hope someone out there can help me. I have all my media files (music, movies etc) on the MacHD. There are two profiles on the iMac...for myself and my partner. I have over 200 gigs of stuff that we both pull from. Lately, my partner is

  • [SOLVED] Econnman fails during build

    Trying to install econnman for E17 on a new system but it fails saying 400: bad request. I'm not sure what to do here. All the dependencies have been met. makepkg -s ==> Making package: econnman-svn 79483-1 (Wed Jan 23 11:10:52 EST 2013) ==> Checking

  • LIVE BAND RECORDING

    I finally figured out how to use my Alesis Firewire 12 Mixer, designating 8 tracks to record my live band. After configuring each track, recordings came out very well. I record our rehearsals many songs at a time, pausing between each song. On the sa

  • Material Base unit

    Dear Gurus, I created material XYZ which have base unit (Drum= DR) and "unit of measure 209 Liter = 1 DR". Issue unit is Liter= L. While creating automatic reservation though maintenance order (Required quantity is 50 Liters). The following problems