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.

Similar Messages

  • 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

  • BLOB, BFILE problems

    We have tried different methods to get these data types to work in a PO8 environment. If we use the Oracle Navigator we can store and read blob data. When we try the same using JDBC 2.0 driver we can not get even the insert to work correctly. Has anyone ever been successful in getting it work. The samples of codes in many books don't seem to have been tested either because they don't work either!
    For example, using the BFILE option (example given by Steve Bobowski)gave us a FILEOPEN exception ORA error 22285 (No directory exists or cannot open file). The directory and the file does exist and the user has the required permissions!
    Any help?

    Chapter 7 in the Oracle Call Interface Programmer's Guide discusses [LOB and BFILE operations|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci07lob.htm#g452677]. Given that you are posting here, I assume you are interested in using the OCI interface and that you are familiar with the basics of OCI programming. If not, you'll want to read the other chapters in the OCI Programmer's Guide.
    Justin

  • Blob (bfile)+ ole2

    hello gurus
    i would like to know how is possible within Oracle Forms (i am still using 6i) to retrieve a MS office document stored in an oracle DB and showing it using ole2 automation.
    I miss just the step of retrieving from DB and loading it into memory or somewhere on the client filesystem, so let it be opened with the right MS office application (chosen with ole2)
    My actual idea is to create a block based on the table that stores the blob (bfile) column, but i don't know how to store the blob (bfile) object in the forms application.. there is a particular object to use? or i must just load the key (or rowid) and then requering the table using it? and after loading the blob (bfile) from table, how can i convert it to be usable for ole2?
    thanks in advance!
    claudio

    Chapter 7 in the Oracle Call Interface Programmer's Guide discusses [LOB and BFILE operations|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci07lob.htm#g452677]. Given that you are posting here, I assume you are interested in using the OCI interface and that you are familiar with the basics of OCI programming. If not, you'll want to read the other chapters in the OCI Programmer's Guide.
    Justin

  • I wonder why it could be useful for bfile datatype

    may be i do know understand exactly,
    i always wonder, why we need a bfile for storage?
    we also can store the path/filename as a string in any char datatype, so as to get the feaures of bfile more easily, then why oracle make up a datatype as bfile.
    what is its special advantages?
    thanks for your tips
    null

    Hi,
    Following is a very brief explanation of the BFILE data type. See the Oracle8i documentation for more information. Oracle8i Application Developer's Guide - Large Objects (LOBs) can be found at: http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76940/toc.htm
    The BFILE data type is one of the Oracle data types used to access Large OBjects or LOBs. A BFILE is an external LOB type (that is to say, the data is stored externally to the database), while BLOBs and CLOBs are internal LOB types (that is to say, the data is stored internally in the database). All the LOB types share a common API, with the methods such as open and close, read and write (write support for internal LOBs only), and others such as methods to get the LOB length. The LOB interface is the only way to access LOB data from within the database, whether the data is stored internally, as BLOBs or CLOBs, or externally, as BFILEs. (Actually, it is possible to access files on the database server using Java Stored Procedures in the database, given the right access permissions. But that's a different story and doesn't have anything to do with LOBs as such.)
    An application can choose whether to store a 'reference' to an external LOB as a BFILE, or as a database directory name plus the file name. If the reference is stored as a BFILE, then the application can access the LOB data directly. If the reference is stored as a database directory name plus file name, then, before accessing the LOB data, the application must first create a BFILE LOB locator using the BFILENAME SQL function.
    To sum up:
    1) The Oracle BFILE LOB data type is used to specify a LOB locator using which applications access the LOB data.
    2) Do applications have to use the BFILE data type to reference external LOB data? No, an application can store the database directory name plus the file name, and create a BFILE data type only when the application needs to read the LOB data.
    Hope that helps,
    Simon
    null

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

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

  • Using Blobs - possible performance issues

    Hello,
    We are considering using BLOBs in our Oracle 9i database( supposed to be migrated to 10g soon)
    Here is the scenario
    ·     20 000 BLOB/year keeping during 5 years
    ·     100 inserts per day
    ·     200 reads per day
    ·     Maximum BLOB size is 150 Kb
    What will be performance impact of using Blobs on INSERT/SELECT ?
    Would it be better to separate BLOBs on the different tablespace ?
    Thanks in advance
    Alexander

    Hello,
    We are considering using BLOBs in our Oracle 9i
    database( supposed to be migrated to 10g soon)
    Here is the scenario
    ·     20 000 BLOB/year keeping during 5 years
    ·     100 inserts per day
    ·     200 reads per day
    ·     Maximum BLOB size is 150 Kb
    What will be performance impact of using Blobs on
    INSERT/SELECT ?Are these stored in the tables or outside the tables using locators?
    Would it be better to separate BLOBs on the different
    tablespace ?
    Yes. It is better to store on different Tablespace.

  • Using BLOB's

    I am attempting to use SQL Plus to create a database that contains images using BLOBs. Here is the table:
    Create table TEST
    (REFERENCE Number(1),
    TEST_IMAGE Blob);
    I have used the empty_blob() function:
    Insert INTO TEST
    VALUES(1, empty_blob());
    But I am now unsure how to get the locator of the blob into the table. Is this just a simple insert or is there a procedure that is needed? Any help would be greatly appreciated.
    null

    declare
    VBLOB_TESTIMAGE BLOB;
    BEGIN
    SELECT TEST_IMAGE INTO VBLOB_TESTIMAGE
    WHERE REFERENCE = 1;
    --now VBLOB_TESTIMAGE consist of BLOB locator
    END;
    TRY THIS AND LET ME KNOW IF U FIND ANY DIFFICULTY.
    [email protected]

Maybe you are looking for

  • Anyone else having problems with bluetooth on iPhone 6 or is it just me?

    I have an iPhone 6 Plus, 128 GB, iOS 8.1 and the hands free is driving me crazy. It does connect to the car bluetooth, but sometimes the call goes to the phone and then comes back to the car, or the call starts on the phone and takes too long to go t

  • Sony a6000 raw files: Green shadows

    Please look at this discussion: Re: Raw file: Sony Alpha/NEX E-mount Talk Forum: Digital Photography Review LR produces green shadows, Capture One and DXO do not. The explanation is a wrong value of the Black Levels in the Sony ARW (312 instead of 30

  • Does the ipad 3 have temperature limits?

    Just wanted to inquire about the ipad 3 and if it has any temperature limits?

  • How to upgrade Satellite M100 to Win8?

    I have downloaded W8 and tried to upgrade over Vista home premium. At the end of the installation there was an error message that Windows installation was not successful, and that the previous version of Windows was being restored. The machine is a S

  • OLD ALV function module

    Hi All, The new type of alv using OO can be used with fm <b>REUSE_ALV_GRID_DISPLAY</b> But what is the fm for the old type of alv? regards,