Bfile in Oracle 8i

Hello
Myself Rakesh Jaitly, i am facing a problem in Binary file usage in 8i through Visual Basic. Please guide me if i have stored a picture image in Oracle 8i and i want to recall it using Visual Basic doing the connectivity. How can i do it. What references i have to use in Visual Basic so that I can get the image stored at the backend i.e Oracle 8i in Frontend i.e. Visual basic 6.0. If have the solution please mail the syntax and the coding to [email protected] I will be highly thankful to you.

Hi Rakesh
i am also facing the same problem if u have find the solution so please mail it to
[email protected]
thanx

Similar Messages

  • BFILE in Oracle XE.

    I developed an application based on Oracle Database Express Edition which stores data about Word documents about scripts that generates the client to use this kind of a field BFILE.
    Each file generated by the customer, has an average size of 50KB, generated an average of 20 files per day (Monday through Friday).
    My question is: If the use BFILES consumes much storage space in the Oracle database XE?, I am concerned about this situation by limiting 4GB for storage of user data.
    Roberto

    Hi,
    I don't know much about BLOB/CLOB, or BFILE, but I know that if you use BIFLE, you are not actually storing the unsctructured file itself, i.e, word doc , in the database, but only a pointer(comparing the file itself, in your case, 50kb, the pointer itself should be very tiny) indicating where it is at the local OS file system.
    So, I think you can store a lot of file, much more than 4 GB, it should be Ok, because that files are within the filesystem of the OS, not the db itself.
    As from the documentation- Concept:
    BFILE Datatype
    The BFILE datatype stores unstructured binary data in operating-system files outside the database. A BFILE column or attribute stores a file locator that points to an external file containing the data. BFILEs can store up to 8 terabytes of data.
    BFILEs are read only; you cannot modify them. They support only random (not sequential) reads, and they do not participate in transactions. The underlying operating system must maintain the file integrity, security, and durability for BFILEs. The database administrator must ensure that the file exists and that Oracle processes have operating-system read permissions on the file.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3873
    Peter

  • What is BFILE in oracle.

    I have one code and in that someone used BFILE,
    What exactly this BFILE means, and whats the use of this.
    Please explain in detail
    Regards
    Agrawal's

    The BFILE datatype enables access to binary file LOBs that are stored in file systems outside the Oracle database. A BFILE column or attribute stores a BFILE locator, which serves as a pointer to a binary file on the server's file system. The locator maintains the directory alias and the filename.
    You can change the filename and path of a BFILE without affecting the base table by using the BFILENAME function.Binary file LOBs do not participate in transactions and are not recoverable. Rather, the underlying operating system provides file integrity and durability. The maximum file size supported is 4 gigabytes.
    The database administrator must ensure that the file exists and that Oracle processes have operating system read permissions on the file.
    The BFILE datatype enables read-only support of large binary files. You cannot modify or replicate such a file. Oracle provides APIs to access file data. The primary interfaces that you use to access file data are the DBMS_LOB package and the OCI.
    For more information please refer oracle documentation.
    Cheers

  • EXTERNAL LOB (BFILE) 처리 예제 프로그램

    제품 : PRECOMPILERS
    작성날짜 : 1998-09-15
    EXTERNAL LOB (BFILE) 처리 예제 프로그램
    ======================================
    BFILE type은 화일시스템에 존재하는 FILE을 가리키는 LOCATOR를 저장하는 데이타
    타입이다. 이 LOCATOR는 디렉토리 ALIAS, FILENAME, 기타 상태 정보를 포함하고
    있다. BFILE은 Directory를 통해 access될 수 있다.
    디렉토리란 시스템 상의 물리적 디렉토리를 논리적으로 매핑한 alias명을 말한다.
    이 오브젝트는 시스템 소유로서, 디렉토리를 생성/삭제하기 위해서는 create[drop]
    any directory 권한이 있어야 한다. sys로 connect하여 grant를 실행한다.
    SQL> grant create any directory to scott;
    디렉토리 생성 시는 실제 디렉토리가 있는지 여부는 확인하지 않는다는 점을 주의
    해야 한다. 현재 생성된 디렉토리와 관련된 정보는 all_directories,
    dba_directories를 조회하면 확인 가능하다.
    Bfile은 pointer 형태로 저장하기 때문에, 여러 record에서 동일한 file을 value
    로 가질 수 있다. file에 대한 처리는 Read만 가능하고, 디렉토리와 마찬가지로
    BFILE 컬럼에 insert 시 oracle process가 read 권한이 있는지 여부는 확인하지
    않는다.
    이는 insert하는 user가 미리 확인해야 한다. 하나의 세션에서 동시에 열 수 있는
    file 개수는 session_max_open_files parameter에 의해 제한받는다.
    1) 사전 수행 SQL 문
    SQL> connect sys/manager
    SQL> grant create any directory to scott;
    SQL> connect scott/tiger
    SQL> create or replace directory bfile_dir as '/mnt3/rctest80/';
    SQL> create table image_file
    2 (a varchar2(10),
    3 b bfile);
    SQL> desc blobs
    Name Null? Type
    ID VARCHAR2(255)
    BLOB_COL BLOB
    2) 프로그램 예제
    #include <stdio.h>
    #include <sqlca.h>
    char username[10] ="ejpark";
    char password[10] ="ejpark";
    char i_rep_file_dir[20];
    char i_rep_file_name[20];
    void sql_error();
    main()
    EXEC SQL WHENEVER SQLERROR DO sql_error("oracle error --");
    EXEC SQL CONNECT :username IDENTIFIED BY :password;
    printf(" DB connected \n");
    /* bfile 컬럼을 insert */
    EXEC SQL INSERT INTO image_file VALUES
    ('abc' , bfilename('BFILE_DIR','a30.bmp') );
    printf(" Bfile inserted \n");
    EXEC SQL COMMIT ;
    EXEC SQL EXECUTE
    DECLARE
    i_rep_file BFILE;
    temp_blob BLOB;
    v_rqid NUMBER;
    len NUMBER;
    BEGIN
    /* bfile 컬럼을 select */
    SELECT b INTO i_rep_file FROM image_file WHERE a='abc';
    IF i_rep_file is not null THEN
    IF DBMS_LOB.fileisopen(i_rep_file) = 1 THEN
    DBMS_LOB.fileclose(i_rep_file);
    END IF;
    DBMS_LOB.FILEGETNAME(i_rep_file,:i_rep_file_dir,:i_rep_file_name);
    len := DBMS_LOB.GETLENGTH(i_rep_file);
    /* 해당 데이타 화일을 읽어 lob table에 insert */
    INSERT INTO blobs VALUES ('abc', empty_blob())
    RETURNING blob_col INTO temp_blob;
    DBMS_LOB.FILEOPEN(i_rep_file, dbms_lob.file_readonly);
    DBMS_LOB.LOADFROMFILE(temp_blob,i_rep_file,len);
    DBMS_LOB.FILECLOSE(i_rep_file);
    END IF;
    COMMIT;
    END;
    END-EXEC;
    printf("name %s %s", i_rep_file_dir,i_rep_file_name);
    void sql_error(msg)
    char* msg;
    char err_msg[130];
    int buf_len, msg_len;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    printf("\n%s\n",msg);
    buf_len = sizeof(err_msg);
    sqlglm(err_msg, &buf_len, &msg_len);
    printf("%.*s\n", msg_len, err_msg);
    EXEC SQL ROLLBACK RELEASE;
    exit(1);
    }

  • BFILE Problem

    Hello,
    The problem that i have is that i want to insert a file residing in the network into the oracle database into a blob field and again read it from the database and show it ie either insert it into a file directly and then open it using the correct editor or open it directly. I am using java along with it but i am basically stuck on the database side.
    I am sending the code which i have written till date
    i basically need to know
    1)the syntax i am using to interact with the database is right ie where is the error in the code
    2)provided that is ok whether my overall code is on the right track.
    After line control 10
    The error message i am getting:
    java.sql.SQL Exception:ORA-22288:file operation fileopen failed
    LFI:00108:open expect the file[map][gif] to exist
    ORA-0615:at"SYS.DBMS_LOB",line 370
    ORA-0615:at line 1
    My developopment enviornment is JDeveloper3.0 as this code is having problems compiling in JDK as Jdeveloper overides a few of the jdk classes.
    =========================================================================
    My table structure
    CREATE TABLE DOC_MAS(
    DOC_MAS_SR_NO NUMBER(10),
    PROJECT_NAME VARCHAR2(30),
    MODULE_NO NUMBER(10),
    DOC_NAME VARCHAR2(10),
    DOC_TYPE VARCHAR2(10),
    VERSION NUMBER(10));
    CREATE SEQUENCE SEQ_DOC_MAS START WITH 1 INCREMENT BY 1;
    CREATE SEQUENCE SEQ_DOC_DETAIL START WITH 1 INCREMENT BY 1;
    CREATE TABLE DOC_DETAIL(
    DOC_DETAIL_SR_NO NUMBER(10),
    DOC_MAS_SR_NO NUMBER(10),
    DATE_OF_INSERT DATE,
    ACTUAL_DOC BFILE,
    COMMENTS VARCHAR2(500));
    ===============================================================================
    My connection code:
    public class ConnectionParams {
    // The machine on which the database resides
    //public final static String s_hostName = "insn110a.in.oracle.com";
    public final static String s_hostName = "192.168.1.1";
    // The TNS listener port
    public final static String s_portNumber = "1521";
    // The database name (SID)
    //public final static String s_databaseSID = "otndb";
    public final static String s_databaseSID = "orcl";
    // The database User ID
    public final static String s_userName = "scott";
    // The database user password
    public final static String s_password = "tiger";
    ========================================================================================
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.util.*;
    import java.util.Date;
    //import java.math.BigDecimal;
    public class Sample3
    int size;
    Connection m_connection; //Database Connection Object
    String p_doc_name=null;
    String s_blobvariable = p_doc_name;
    String file_path = null;
    byte b[];
    String l_dirPath;
    public Sample3()
    dbConnection();
    public static void main(String[] args)
    Sample3 lobs = new Sample3();
    // lobs.dbConnection();
    lobs.readFileNameExt();
    /*This class is for creation of connection =========================================*/
    public void dbConnection() {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String l_dbConnectString =
    "(DESCRIPTION=(ADDRESS=(HOST="+ConnectionParams.s_hostName+")"+
    "(PROTOCOL=tcp)(PORT="+ConnectionParams.s_portNumber+"))"+
    "(CONNECT_DATA=(SID="+ConnectionParams.s_databaseSID+")))";
    m_connection = DriverManager.getConnection(
    "jdbc:oracle:thin:@"+l_dbConnectString,
    ConnectionParams.s_userName, ConnectionParams.s_password);
    m_connection.setAutoCommit(false);
    System.out.println("Connection Successful");
    Thread.sleep(3000);
    } catch(Exception ex){ //Trap SQL errors
    System.out.println("Error in Connecting to the Database "+ex.toString());
    /*========================================================================================
    File inserting section of the code
    // THIS class gets the input from the file dialog box it gets the file path,projectName and the module no
    //public void readFileNameExt(String p_doc_path,String p_module_no,String p_project_name)
    public void readFileNameExt()
    String p_doc_path = "c:/warea/Mehul2/map.gif";
    int p_module_no = 10;
    String p_project_name = "Finserve";
    String p_doc_type= null;
    String p_version = null;
    StringTokenizer strtkn = new StringTokenizer(p_doc_path,"/");
    while(strtkn.hasMoreTokens())
    p_doc_name =strtkn.nextToken();
    System.out.println("The file name is" +p_doc_name);
    s_blobvariable = p_doc_path;
    StringTokenizer strtoken = new StringTokenizer(p_doc_name,".");
    while(strtoken.hasMoreTokens())
    p_doc_type =strtoken.nextToken();
    try{
    System.out.println("The file Type is"+p_doc_type);
    insertDocMas(p_doc_path,p_doc_name,p_doc_type,p_project_name,p_module_no);
    Thread.sleep(10000);
    }catch (Exception e){}
    }//end of method
    //============================================== this class is for inserting the doc_mas details in teh table along with version checking
    public void insertDocMas(String p_doc_path,String p_doc_name,String p_doc_type,String p_project_name,int p_module_no){
    int p_version = -1;
    int p_doc_mas_sr_no = -1;
    // String verision=null;
    int verision;
    String s = null;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_version_details = l_stmt.executeQuery("SELECT MAX(VERSION) FROM DOC_MAS WHERE DOC_NAME = '"+p_doc_name+"'");
    if (l_version_details.next())
    { System.out.println("The Control 1");
    verision = l_version_details.getInt(1);
    System.out.println("The Control 2 : "+verision);
    verision = verision +1;
    else {
    verision = 1;
    System.out.println("The Control 3");
    p_version = verision;
    // System.out.println("The value of p_version" + p_version);
    l_version_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert"+e);
    System.out.println("The value of p_version" + p_version);
    /* try{
    Statement stmt = m_connection.createStatement();
    ResultSet rset = stmt.executeQuery("select DEPTNO,DNAME,LOC from DEPT");
    while(rset.next()){
    BigDecimal deptno = rset.getBigDecimal(1,2);
    String dname = rset.getString(2);
    // Timestamp hiredate = rset.getTimestamp(3);
    String loc = rset.getString(3);
    System.out.println(deptno+" "+dname+" "+loc);
    Thread.sleep(50000);
    }catch(Exception e){System.out.println(e);}
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_details = l_stmt.executeQuery("SELECT SEQ_DOC_MAS.NEXTVAL FROM DUAL");
    if (l_seq_details.next())
    p_doc_mas_sr_no = l_seq_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_mas_sr_no" + p_doc_mas_sr_no);
    l_seq_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try {
    System.out.println("Creating rows in DOC_MAS.. ");
    System.out.println("The Control VV");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_MAS(DOC_MAS_SR_NO,PROJECT_NAME,MODULE_NO,DOC_NAME,DOC_TYPE,VERSION) values(?,?,?,?,?,?)");//SEQ_DOC_MAS.nextval
    l_pstmt.setInt(1,p_doc_mas_sr_no);//"SEQ_DOC_DETAIL.NEXTVAL"
    l_pstmt.setString(2,p_project_name);
    l_pstmt.setInt(3,p_module_no);
    l_pstmt.setString(4,p_doc_name);
    l_pstmt.setString(5,p_doc_type);
    l_pstmt.setInt(6,p_version);
    l_pstmt.executeUpdate(); // Execute SQL statement
    l_pstmt.close();
    System.out.println("The Control 3");
    // Close statement
    //Thread.sleep(20000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert11"+e);
    try{System.out.println("The Control 4");
    Statement l_statement = m_connection.createStatement();
    ResultSet l_doc_mas_sr_no = l_statement.executeQuery(
    "SELECT max(DOC_MAS_SR_NO) FROM DOC_MAS "+
    "WHERE DOC_NAME = '"+p_doc_name+"' ");//FOR UPDATE
    if (l_doc_mas_sr_no.next())
    p_doc_mas_sr_no = l_doc_mas_sr_no.getInt(1);
    l_doc_mas_sr_no.close();
    l_statement.close();
    System.out.println("The Control 5");
    //Thread.sleep(10000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert");
    loadSamples(p_version,p_doc_path,p_project_name,p_doc_mas_sr_no,p_doc_name,p_doc_type);
    }//Method insertDocMas() closing here
    /*This class is for loading the data into the database==================================*/
    public void loadSamples(int p_version, String p_doc_path,String p_project_name,int p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    int p_doc_detail_sr_no = -1;
    //Date p_sysdate = new Date() ;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_doc_details = l_stmt.executeQuery("SELECT SEQ_DOC_DETAIL.NEXTVAL FROM DUAL");
    if (l_seq_doc_details.next())
    p_doc_detail_sr_no = l_seq_doc_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_detail_sr_no" + p_doc_detail_sr_no);
    l_seq_doc_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try {System.out.println("The Control 6");
    java.sql.Date current_date = new java.sql.Date(System.currentTimeMillis());
    System.out.println("Creating row for actual-doc in DOC_DETAILS.. ");
    //PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_DETAIL(DOC_DETAIL_SR_NO,DOC_MAS_SR_NO,DATE_OF_INSERT,ACTUAL_DOC)values(?,?,'"+current_date+"', empty_blob() )");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_DETAIL(DOC_DETAIL_SR_NO,DOC_MAS_SR_NO,DATE_OF_INSERT)values(?,?,?)");
    l_pstmt.setInt(1,p_doc_detail_sr_no);
    l_pstmt.setInt(2,p_doc_mas_sr_no);
    l_pstmt.setDate(3,current_date);
    System.out.println("The Control 6AA");
    l_pstmt.execute(); // Execute SQL statement
    l_pstmt.close(); // Close statement
    System.out.println("Created.\nLoading <map.gif> into BLOB column for doc_detail...");
    System.out.println("The Control 7");
    // Retrieve the row just inserted, and lock it for insertion of the
    }catch(Exception e){
    System.out.println("Exception has occured at the time of inserting blob locators"+e);
    try {
    System.out.println("The Control 8");
    l_dirPath = p_doc_path ;
    PreparedStatement l_pstmt = m_connection.prepareStatement(
    "CREATE OR REPLACE DIRECTORY BFILEDIR AS '" + l_dirPath + "' ");
    l_pstmt.execute();
    l_pstmt.close();
    // Execute the prepared SQL Statement
    } catch (Exception ex)
    { // Trap SQL errors
    System.out.println("Error loading sample files ");
    System.out.println("\n"+ex.toString());
    System.out.println("The Control 8AA");
    try{
    // Insert the Image as a BFILE Column
    // String abc = new String("INSERT INTO DOC_DETAIL(ACTUAL_DOC)VALUES(BFILENAME('BFILEDIR2','" + p_doc_name + "')) WHERE D0C_MAS_SR_NO = '" + p_doc_mas_sr_no + "';");
    //System.out.println(abc);
    //l_pstmt.executeQuery("insert into DOC_DETAIL(ACTUAL_DOC)values(BFILENAME('BFILEDIR','" + p_doc_name + "')) where D0C_MAS_SR_NO = '" + p_doc_mas_sr_no + "';");
    String abc = new String("update DOC_DETAIL SET ACTUAL_DOC = BFILENAME('BFILEDIR','" + p_doc_name + "') where D0C_MAS_SR_NO = '"+p_doc_mas_sr_no+"' ");
    System.out.println(abc);
    PreparedStatement l_pstmt = m_connection.prepareStatement("update DOC_DETAIL SET ACTUAL_DOC = BFILENAME('BFILEDIR','" + p_doc_name + "') where DOC_MAS_SR_NO = '"+p_doc_mas_sr_no+"' ");
    l_pstmt.executeQuery();
    l_pstmt.close(); // Close the prepared Statement
    drawBLOB(p_version,p_doc_mas_sr_no,p_project_name,p_doc_name, p_doc_type);
    System.out.println("The Control 9");
    } catch (Exception ex)
    { // Trap SQL errors
    System.out.println("Error loading sample files ");
    System.out.println("\n"+ex.toString());
    }//Method closes here
    * Retrieve the BLOB data from input BLOB column into a local file,
    * and draws the image. The file type needs to be added here
    public void drawBLOB(int p_version,int p_doc_mas_sr_no,String p_project_name, String p_doc_name,String p_doc_type) {
    //String fileType this should be passed at some point to ensure that th e file gets the right extension
    try { System.out.println("The Control 10");
    Statement l_stmt = m_connection.createStatement();
    // Execute the Query and get BFILE Locator as a result set
    ResultSet l_rset = l_stmt.executeQuery("Select ACTUAL_DOC from DOC_DETAIL WHERE DOC_MAS_SR_NO= '"+p_doc_mas_sr_no+"' ");
    //Note : Using Oracle Extension oracle.sql.BFILE to get BFILE Locator
    oracle.sql.BFILE l_bfile = null;
    // Loop through the Result Set
    while(l_rset.next()) {
    l_bfile = ((OracleResultSet)l_rset).getBFILE(1); // Get the BFILE Locator
    System.out.println("Retrieved BFILE Locator..");
    System.out.println("l_bfile :"+l_bfile);
    l_rset.close(); // Close the ResultSet
    l_stmt.close(); // Close the Statement
    // Open the file with openFile Method of oracle.sql.BFILE class
    l_bfile.openFile();
    // Open the Input Binary Stream with getBinaryStream method of
    // oracle.sql.BFILE class
    InputStream f = l_bfile.getBinaryStream();
    System.out.println("Opened Binary Stream ...");
    size =f.available();
    System.out.println("Actual Size:"+size+"Bytes");
    int n = size;
    int x=0;
    System.out.println("First"+n+"bytes of the file one can read at a time");
    b = new byte[size];
    System.out.println("printing bytes"+b);
    char ch=' ';
    while(x<size)
    ch=(char)f.read();
    b[x]=(byte)ch;
    //str+=ch;
    x++;
    System.out.println("The Control 11");
    // file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_doc_name;
    directoryMap( p_version, p_project_name, p_doc_name);//This method is called here
    OutputStream fout = new FileOutputStream(file_path);
    for(int i=0;i<b.length;i +=2)
    //out.println(b);
    fout.write(b[i]);
    System.out.println("The Control 12");
    drawMap(file_path,p_doc_name,p_doc_type);
    } catch (Exception ex) { // Trap SQL and IO errors
    System.out.println("Error in retrieving and drawing map for selected airport");
    System.out.println("\n"+ex.toString());
    * Create a label from the image filepassed, add the label to the image area
    This part will have to be modified majorly
    public void drawMap(String file_path, String p_doc_name,String p_doc_type)
    //Refer to SIRExtOpen.java
    System.out.println("The Control 13");
    Runtime r = Runtime.getRuntime();
    Process p = null;
    if (p_doc_type.equals("html")&#0124; &#0124;p_doc_type.equals("htm"))
    try{
    p = r.exec( "C:\\Program Files\\Internet Explorer\\Iexplore.EXE " +file_path);
    //repaint();
    p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    if(p_doc_type.equals("txt")&#0124; &#0124; p_doc_type.equals("sql")&#0124; &#0124; p_doc_type.equals("java"))
    try
    p = r.exec( "C:\\WINDOWS\\notepad.EXE " + p_doc_name); p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of txt , sql , java if
    if(p_doc_type.equals("xls"))
    try
    p = r.exec( "C:\\Program Files\\Microsoft Office\\Office\\excel.EXE " +file_path);
    p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of xls if
    if(p_doc_type.equals("fmb"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of fmb if
    if(p_doc_type.equals("doc"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of doc if
    if(p_doc_type.equals("mpp"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of mpp if
    //Here you can write a statement for deleting the file in the root directory once the file is opened using any editor
    }//end of method
    * This method is called when a row is selected from the combo.
    * It checks if there exists data in DOC_DETAIL for the selected
    * file. If there exists data, it calls drawBLOB and writeCLOB to
    * display the data
    /*public void fileSelected(String p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    try {
    System.out.println("Retrieving LOB details for selected file..");
    // Create a SQL statement
    Statement l_stmt = m_connection.createStatement();
    // Query DOC_DETAILS for the selected file
    java.sql.ResultSet l_lobDetails = l_stmt.executeQuery(
    "SELECT ACTUAL_DOC FROM DOC_DETAILS "+
    "WHERE DOC_MAS_SR_NO='"+p_doc_mas_sr_no+"'");
    // Check if LOB columns exist
    if (l_lobDetails.next()) {
    // LOB details exist
    // Display airport map and suggestion book (LOB details)
    drawBLOB(l_lobDetails.getBlob(1),p_doc_name,p_doc_type);
    //lobs.drawBLOB(((OracleResultSet)l_lobDetails).getBLOB(1),p_doc_name,p_doc_type);
    //Should this be like this
    System.out.println("Done retrieving and displaying LOB details");
    } else {
    // No LOB details
    // m_GUI.m_loadButton.setEnabled(true);
    //TO BE CHECKED OUT LATER m_loadButton This is a button in the form
    System.out.println("No airport map and suggestion book exist for selected airport");
    System.out.println("\nPress <Load Sample3 Files> to load LOB details");
    l_lobDetails.close();
    l_stmt.close();
    } catch (Exception ex) { // Trap SQL errors
    System.out.println("Error retrieving LOB Details for the selected airport");
    System.out.println(ex.toString());
    public void directoryMap(int p_version,String p_project_name,String p_doc_name) {//start of the method
    System.out.println("The Control 14");
    if (p_version==1)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of else
    else if(p_version==2)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of else
    else if(p_version==3)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else{
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of outer else
    else
    System.out.println("System has gone into 4th version");
    }//end of method
    }//end of class
    null

    Hi
    Have you found a workaround for this problem? im having a similiar problem and am interested in its solution.....

  • Bfile image problem---please ignore this thread

    Hi all,
    I am using Oracle 10.2.0.2.0 on x86_64 GNU/Linux .
    I am using a table with column bfile datatype. Bfile column links to oracle directory "frameroot" which contains image frames. when i check data of link (bfile) in oracle sql developer it shows the below :
    Name : 2009_pre
    Data Length : 55044
    File Exists : true
    Directory aliase : FRAMEROOT
    but when i click image option its is giving the below error :
    "Image could not be decoded from the binary stream".
    As i think sql developer should show the image of the bfile datatype.
    I am using oracle sql developer version 1.2.1
    Please suggest.
    Thanks
    Vipin
    Edited by: VipinK on Jun 8, 2010 10:07 PM

    Duplicate post. Please change the subject to "Please Ignore"
    Please never do this.
    thank you.
    PS: There is a SQL*Developer forum and that is the only place to post questions about SQL*Developer.

  • Recommended Structure for Large Files

    I am working at re-familiarizing myself with Oracle development and management so please forgive my ignorance on some of these topics or questions. I will be working with a client who is planning a large-scale database for what is called "Flow Cytometry" data which will be linked to research publications. The actual data files (FCS) and various text, tab-delimited and XML files will all be provided by researchers in a wrapper or zip-container which will be parsed by some as-yet-to-be-developed tools. For the most part, data will consist of a large FCS file containing the actual Flow Cytometry Data, along with various/accompanying text/XML files containing the metadata (experiment details, equipment, reagents etc). What is most important is the metadata which will be used to search for experiments etc. For the most part the actual FCS data files (up to 100-300 mb), will only need to be linked (stored as BLOB's?) to the metadata and their content will be used at a later time for actual analysis.
    1: Since the actual FCs files are large, and may not initially be parsed and imported into the DB for later analysis, how best can/should Oracle be configured/partitioned so that a larger/direct attached storage drive/partition can be used for the large files so as not to take up space where the actual running instance of Oracle is installed? We are expecting around 1TB of data files initially
    2: Are there any on-line resources which might be of value to such an implementation?

    Large files can be stored as BFILE datatypes. The data need not be transferred to Oracle tablespaces and the files will reside in OS.
    It is also possible to index bfiles using Oracle text indexing.
    http://www.oracle-base.com/articles/9i/FullTextIndexingUsingOracleText9i.php
    http://www.stanford.edu/dept/itss/docs/oracle/10g/text.101/b10730/cdatadic.htm
    http://www.idevelopment.info/data/Oracle/DBA_tips/Oracle_Text/TEXT_3.shtml
    Mohan
    http://www.myoracleguide.com/

  • BFILE use in Oracle Forms

    Can anyone tell me how to get BFILE Datatypes to work in Oracle Forms 6i? I am able to create and build my table with BFILE datatypes and create and build my directories. However, when I build my form in runtime, I execute my query and it bring up an error message "Can not execute query".
    Could someone please tell me how to build forms in Oracle Forms 6i so that it can use BFILE Datayes?
    Thanks!

    JavaBean does d othe job for you but it requires signing process; I used it when I was working on forms6i for our project.
    I could use another approach that is the file type command executable which it stays in client's PC to do it and it does not requires signing at all since I am now working on the Java EE project for downloading and launching the third party tool in client's PC.
    I plan to write a article for forms use, which could do all the heavy WebUtil can do, but not need to go thru the signing process.

  • Bfile functionality with oracle lite for Synchronization

    Hi there,
    In my project requirement, We need to design a standalone version of the applciation which will be used by the marketing people around the globe.
    Plan is to use oracle Lite database with this application, as it synchronises with the main server on demand. During our testing we found that Oracle lite do the data transfer /synchronization perfectly but have problem with bfile type data. Precisely, the only problem we are facing is how to synchronize the file which are there on the server as bfile type. As per my info Bfile is not supported by the oracle Lite.
    Any clue will be appreciated.
    Regards,
    Sunil Dua

    Junius,
    Greetings,
    Thanks for the reply speedy reply... I took more time in replying as we busy in evaluating the Oracle Lite version 10g.
    Well Yeah! you are right and thru packaging, we can have the files downloaded but for me its a work around. Let em explain my situation again.
    I have user specific set of files for each of its client which again gets updated quarterly. If I keep this data in the package I'll have to keep 'n' number of files in the package as about 300 odd user will be on field maintaining number of user. Another problem would be to publish and package every quarter. Thired problem would be of downloading this application as size will be too high and relevant data for each of the user would be hardly 10% of the size of the application for each user.
    I hope I have clarified the situation. Pl. let me know if you need any more info.
    Regards,
    Sunil Dua

  • Performance impact in Oracle 8i - BLOB vs BFILE

    Hi Guys,
    We are evaluting intermedia to store multimedia objects.
    Does any know if storing and retreiving documents in Oracle database has impact on standard data stored in the database?
    Is it worth having a seperate database instance for storing tables with intermedia objects?
    Pal

    Part 2:
    Example 1: Let us estimate the storage requirements for a data set consisting of 500 video clips comprising a total size of 250MB (average size 512K bytes). Assume a LOB chunk size of 32768 bytes. Our model estimates that we need (8000 * 32) bytes or 250 k bytes for the index and 266 MB to hold the media data. Since the original media size is 250 MB, this represents about a 6.5% storage overhead for storing the media data in the database. The following table definition could be used to store this amount of data.
    create table video_items
    video_id number ,
    video_clip ordsys.ordvideo
    -- storage parameters for table in general
    tablespace video1 storage (initial 1M next 10M )
    -- special storage parameters for the video content
    lob (video_clip.source.localdata) store as
    (tablespace video2 storage (initial 260k next 270M )
    disable storage in row nocache nologging chunk 32768);
    Example 2: Let us estimate the storage requirements for a data set consisting of 5000 images with an average size of 56K bytes. The total amount of media data is 274 MB. Since the average image size is smaller, it is more space efficient to choose a smaller chunk size, say 8K, to store the data in the lob. Our model estimates that we will need about 313 MB to store the data and a little over 1 MB to store the index. In this case the 40 MB of storage required beyond the raw media content size represents a 15% overhead.
    Estimating retrieval costs
    Performance testing has shown that Oracle can achieve equivalent and even higher throughput performance for media content retrieval than a file system. The test was configured to retrieve media data from a server system to a requesting client system. In the database case, simple C client programs used OCI with LOB read callbacks to retrieve the data from the database. For the file system case, the client program used the standard C library functions to read data from the file system. Note that in this client server configuration, files are served remotely by the file server system. In essence, we are comparing distributed file system performance with Oracle database and SQLNet performance. These tests were performed on Windows NT 4 SP5.
    Although Oracle achieved higher absolute performance, the relative CPU cost per unit of throughput ranged from 1.7 to 3 times the file system cost. (For these tests, database performance ranged from 3.4 million to 9 million bytes/sec while file system performance ranged from 2.6 million bytes/sec to 7 million bytes/sec as the number of clients ranged from 1 to 5) One reason for the very high relative CPU cost at the higher end of performance is that as the 100 Mbs network approaches saturation, the system used more CPU to achieve the next increment of throughput. If we restrict ourselves to not exceeding 70% of network utilization, then the database can use up to 2.5 times as much CPU as the file system per unit of throughput.
    NOTE WELL: The extra CPU cost factors pertain only to media retrieval aspect of the workload. They do not apply to the entire system workload. See example.
    Example: A file based media asset system uses 10% of a single CPU simply to serve media data to requesting clients. If we were to store the media in an Oracle database and retrieve content from the database then we could expect to need 20-25% of a single CPU to serve content at the same throughput rate.

  • How to insert image into table and to in Oracle 9i intermedia?

    Mr Lawrence,
    I want to ask something:
    I use Oracle 9i intermedia
    If i use this script:
    CREATE TABLE images (
    file_name VARCHAR2(100) NOT NULL,
    image ORDSYS.OrdImage
    then
    CREATE OR REPLACE DIRECTORY imgdir AS 'd:/data';
    then
    INSERT INTO images (file_name, image)
    VALUES ('tree', ORDSYS.ORDImage.init('file','imgdir','tree.jpg' ));
    I put tree.jpg in directory d:/data in my hard drive.
    Is my tree.jpg file had already get in to my images table?
    I'm little confuse, because when i check my table with this script:
    select file_name, i.image.getWidth() from images i;
    it's show that my i.image.getWidth() for file_name tree is empty.. that mean my tree.jpg doesn't get in to my table.. am i correct?
    N also i want to ask how to display to screen all of my image from images table?
    Is it posible Oracle 9i intermedia to support display image from table?
    How?
    thanks Mr Lawrence

    -- First step would be to create a directory in oracle and map it to the folder where your image resides.
    create directory image_dir as *'c:\image_dir';*
    Then you would have to use a procedure to insert the image in your table. SO first create a table to hold the image. Note that you have to use a BLOB to insert the image.
    CREATE TABLE test_image
    ID NUMBER,
    image_filename VARCHAR2(50),
    image BLOB
    Now let's write the procedure to insert the image in the table above.
    CREATE OR REPLACE PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)
    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := BFILENAME ('image_DIR', p_image_name);
    -- insert a NULL record to lock
    INSERT INTO temp_image
    (ID, image_name, image
    VALUES (p_id, p_image_name, EMPTY_BLOB ()
    RETURNING image
    INTO dst_file;
    -- lock record
    SELECT image
    INTO dst_file
    FROM temp_image
    WHERE ID = p_id AND image_name = p_image_name
    FOR UPDATE;
    -- open the file
    DBMS_LOB.fileopen (src_file, DBMS_LOB.file_readonly);
    -- determine length
    lgh_file := DBMS_LOB.getlength (src_file);
    -- read the file
    DBMS_LOB.loadfromfile (dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE temp_image
    SET image = dst_file
    WHERE ID = p_id AND image_name = p_image_name;
    -- close file
    DBMS_LOB.fileclose (src_file);
    END insert_image_file;
    Now execute the procedure to insert the image.
    EXECUTE insert_image_file(1,'test_image.jpg');
    Thanks,
    Aparna

  • How to insert a JPG file from file system to Oracle 10g?

    I have developed a schema to store photos as BLOB which store the text description as CLOB original filename, file size.
    I also use ctxsys.context to index TEXT_DESCRIPTION in order to perform Oracle Text Search and it works.
    I would like to insert some JPG file from say C:\MYPHOTO\Photo1.jpg as a new record. How can I do this in SQL PLus and/or Loader?
    How can I retrieve the PHOTO_IMAGE back to the file system using SQL Plus and/or command line in DOS?
    See the following script:
    create user myphoto identified by myphoto;
    grant connect, resource, ctxapp to myphoto;
    connect myphoto/myphoto@orcl;
    PROMPT Creating Table PHOTOS
    CREATE TABLE PHOTOS
    (PHOTO_ID VARCHAR2(15) NOT NULL,
    PHOTO_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(50),
    FILE_SIZE NUMBER NOT NULL,
    CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
    create index idx_photos_text_desc on
    PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
    INSERT INTO PHOTOS VALUES
    ('P00000000000001', empty_blob(), empty_clob(),
    'SCGP1.JPG',100);
    INSERT INTO PHOTOS VALUES
    ('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
    'COLDPLAY1.JPG',200);
    INSERT INTO PHOTOS VALUES
    ('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
    'COLDPLAY1.JPG',200);
    EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
    SELECT PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'parents',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'cold play',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),score(2), PHOTO_ID ,TEXT_DESCRIPTION
    FROM photos
    WHERE CONTAINS(TEXT_DESCRIPTION,'Melbourne',1)> 0
    AND CONTAINS(TEXT_DESCRIPTION,'2005',2)> 0
    ORDER BY score(1) DESC;

    Hi
    You can use the following to insert an image:
    create table imagetab(id number primary key,imagfile blob, fcol varchar2(10));
    create or replace directory imagefiles as 'c:\'
    declare
        v_bfile BFILE;
        v_blob  BLOB;
      begin
        insert into imagetab (id,imagfile,fcol)
        values (3,empty_blob(),'BINARY')
        return imagfile into v_blob;
        v_bfile := BFILENAME ('IMAGEFILES', 'MyImage.JPG');
        Dbms_Lob.fileopen (v_bfile, Dbms_Lob.File_Readonly);
        Dbms_Lob.Loadfromfile (v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
        Dbms_Lob.Fileclose(v_bfile);
        commit;
      end;
    /

  • How to insert an image file in Oracle database

    hi
    can you please tell me how to insert an image file into oracle database????
    suppose there is one image file in c:\pictures\rose.jpg. how to insert that file into database? theoretically i know that will be BFILE type but i dont know how to insert that.
    will be waiting for your reply........
    thanks & regards,
    Priyatosh

    Hello,
    The easiest way to load a blob is to use SQL loader.
    This example comes from the utilities guide:
    LOAD DATA
    INFILE 'sample.dat'
    INTO TABLE person_table
    FIELDS TERMINATED BY ','
    (name CHAR(20),
    1 ext_fname FILLER CHAR(40),
    2 "RESUME" LOBFILE(ext_fname) TERMINATED BY EOF)
    Datafile (sample.dat)
    Johny Quest,jqresume.txt,
    Speed Racer,'/private/sracer/srresume.txt',
    Secondary Datafile (jqresume.txt)
    Johny Quest
    500 Oracle Parkway
    Secondary Datafile (srresume.txt)
    Loading LOBs
    10-18 Oracle Database Utilities
    Speed Racer
    400 Oracle Parkway
    regards,
    Ivo

  • Error While Loading XMl Doc into Oracle Database 10g

    Hi all,
    I have a task that , I have to make a utillity by which we can load XML Doc into a Table. While searching on Internet i found following Procedure on ASK Tom
    CREATE OR REPLACE
    procedure insert_xml_emps(
    p_directory in varchar2, p_filename in varchar2, vtableName in varchar2 )
    as
    v_filelocator bfile;
    v_cloblocator clob;
    l_ctx dbms_xmlsave.ctxType;
    l_rows number;
    begin
    dbms_lob.createtemporary(v_cloblocator,true);
    v_filelocator := bfilename(p_directory, p_filename);
    dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
    DBMS_LOB.LOADFROMFILE(v_cloblocator, v_filelocator,
    dbms_lob.getlength(v_filelocator));
    l_ctx := dbms_xmlsave.newContext(vTableName);
    l_rows := dbms_xmlsave.insertxml(l_ctx,v_cloblocator);
    dbms_xmlsave.closeContext(l_ctx);
    dbms_output.put_line(l_rows || ' rows inserted...');
    dbms_lob.close(v_filelocator);
    DBMS_LOB.FREETEMPORARY(v_cloblocator);
    end ;
    when i try to run this procedure
    BEGIN
    insert_xml_emps('XML_LOAD','load.xml','IBSCOLYTD');
    END;
    it gaves me following Error
    ORA-29532: java call terminated by uncaught java exception : Oracle.xml.sql.OracleXMLSQLException:No
    rows to modify-- the row enclosing tag missing. Specify the correct row enclosing tag.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 115
    ORA-06512: at "EXT_TEST.INSERT_XML_EMPS", line 18
    ORA-06512: at line 2
    Can anyone describe me this error
    Thanks.
    Best Regards.

    SQL> /* Creating Your table */
    SQL> CREATE TABLE IBSCOLYTD
      2  (
      3  ACTNOI VARCHAR2 (8),
      4  MEMONOI NUMBER (7,0),
      5  MEMODTEI DATE,
      6  AMOUNTI NUMBER (8,0),
      7  BRCDSI NUMBER (4,0),
      8  TYPEI NUMBER (4,0),
      9  TRANSMONI NUMBER (6,0)
    10  );
    Table created.
    SQL> CREATE OR REPLACE PROCEDURE insert_xml_emps(p_directory in varchar2,
      2                                              p_filename  in varchar2,
      3                                              vtableName  in varchar2) as
      4    v_filelocator    BFILE;
      5    v_cloblocator    CLOB;
      6    l_ctx            DBMS_XMLSTORE.CTXTYPE;
      7    l_rows           NUMBER;
      8    v_amount_to_load NUMBER;
      9    dest_offset      NUMBER := 1;
    10    src_offset       NUMBER := 1;
    11    lang_context     NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
    12    warning          NUMBER;
    13  BEGIN
    14    dbms_lob.createtemporary(v_cloblocator, true);
    15    v_filelocator := bfilename(p_directory, p_filename);
    16    dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
    17    v_amount_to_load := DBMS_LOB.getlength(v_filelocator);
    18    ---  ***This line is changed*** ---
    19    DBMS_LOB.LOADCLOBFROMFILE(v_cloblocator,
    20                              v_filelocator,
    21                              v_amount_to_load,
    22                              dest_offset,
    23                              src_offset,
    24                              0,
    25                              lang_context,
    26                              warning);
    27 
    28    l_ctx := DBMS_XMLSTORE.newContext(vTableName);
    29    DBMS_XMLSTORE.setRowTag(l_ctx, 'ROWSET');
    30    DBMS_XMLSTORE.setRowTag(l_ctx, 'IBSCOLYTD');
    31    -- clear the update settings
    32    DBMS_XMLStore.clearUpdateColumnList(l_ctx);
    33    -- set the columns to be updated as a list of values
    34    DBMS_XMLStore.setUpdateColumn(l_ctx, 'ACTNOI');
    35    DBMS_XMLStore.setUpdateColumn(l_ctx, 'MEMONOI');
    36    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'MEMODTEI');
    37    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'AMOUNTI');
    38    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'BRCDSI');
    39    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TYPEI');
    40    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TRANSMONI');
    41    -- Now insert the doc.
    42    l_rows := DBMS_XMLSTORE.insertxml(l_ctx, v_cloblocator);
    43    DBMS_XMLSTORE.closeContext(l_ctx);
    44    dbms_output.put_line(l_rows || ' rows inserted...');
    45    dbms_lob.close(v_filelocator);
    46    DBMS_LOB.FREETEMPORARY(v_cloblocator);
    47  END;
    48  /
    Procedure created.
    SQL> BEGIN
      2  insert_xml_emps('TEST_DIR','load.xml','IBSCOLYTD');
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM ibscolytd;
    ACTNOI      MEMONOI MEMODTEI     AMOUNTI     BRCDSI      TYPEI  TRANSMONI
    28004125     251942 05-SEP-92        400        513          1          0
    28004125     251943 04-OCT-92        400        513          1          0
    SQL>

  • Error while trying to index a bfile

    hi,
    I have encountered the following error will trying to index a bfile . Following are the error messages, the listener.ora and creation script. I'm using a AIX Ver 4.3.3 J50 machine and my oracle version is 8.1.7 Thanks
    Creation Script
    SQL> create or replace directory DOC_DIR as '/u01/oradata/vs/documents/';
    Directory created.
    SQL> grant read on directory DOC_DIR to ctxsys;
    Grant succeeded.
    SQL> create table per_doc
    2 (per_id number primary key,
    3 doc1 bfile);
    SQL> insert into per_doc
    2 values
    3 (1,
    4 bfilename('DOC_DIR','816.doc'));
    ERROR ENCOUNTER
    create index doc_index on per_doc(doc1) indextype is ctxsys.context;
    exec(): 0509-036 Cannot load program /u05/app/oracle/product/8.1.7/ctx/bin/ctxhx because of the following errors:
    0509-150 Dependent module libsc_da.a(sc_da.o) could not be loaded.
    0509-022 Cannot load module libsc_da.a(sc_da.o).
    0509-026 System error: A file or directory in the path name does not exist.
    Index created.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u05/app/oracle/product/8.1.7)
    (ENVS =LD_LIBRARY_PATH=/u05/app/oracle/product/8.1.7/lib:/u05/app/oracle/product/8.1.7/ctx/lib)
    (PROGRAM = extproc)
    null

    Below is the .profile setting for Oracle
    ORACLE_BASE=/u05/app/oracle
    export ORACLE_BASE
    ORACLE_HOME=/u05/app/oracle/product/8.1.7
    export ORACLE_HOME
    LIBPATH=$ORACLE_HOME/lib:ORACLE_HOME/ctx/lib:/usr/lib:/lib
    export LIBPATH
    ORACLE_SID=vs
    export ORACLE_SID
    CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/product/jlib
    export CLASSPATH
    I have also granted the read access right to ctxsys as reflected below. Is there any other directories that I need to grant ctxsys access to?
    Thanks
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by aw choon hock ([email protected]):
    hi,
    I have encountered the following error will trying to index a bfile . Following are the error messages, the listener.ora and creation script. I'm using a AIX Ver 4.3.3 J50 machine and my oracle version is 8.1.7 Thanks
    Creation Script
    SQL> create or replace directory DOC_DIR as '/u01/oradata/vs/documents/';
    Directory created.
    SQL> grant read on directory DOC_DIR to ctxsys;
    Grant succeeded.
    SQL> create table per_doc
    2 (per_id number primary key,
    3 doc1 bfile);
    SQL> insert into per_doc
    2 values
    3 (1,
    4 bfilename('DOC_DIR','816.doc'));
    ERROR ENCOUNTER
    create index doc_index on per_doc(doc1) indextype is ctxsys.context;
    exec(): 0509-036 Cannot load program /u05/app/oracle/product/8.1.7/ctx/bin/ctxhx because of the following errors:
    0509-150 Dependent module libsc_da.a(sc_da.o) could not be loaded.
    0509-022 Cannot load module libsc_da.a(sc_da.o).
    0509-026 System error: A file or directory in the path name does not exist.
    Index created.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u05/app/oracle/product/8.1.7)
    (ENVS =LD_LIBRARY_PATH=/u05/app/oracle/product/8.1.7/lib:/u05/app/oracle/product/8.1.7/ctx/lib)
    (PROGRAM = extproc)
    )<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • How to embed images in long text of PM Notifications/Orders

    Dear Sir, How to embed images in long text of PM Notifications/Orders? Kindly help. Thanks & Regards PM Team.

  • 3 topics in  Dev Cons SAP Netweaver 2004 u0096 Enterprise Portal

    Hi All, I read that the following topics form a part of the devlopment consultant EP certy exam. Please take a look at them below and let me know: <i>Are these just theoritical concepts for the exam? In KM you can do stuff through wizards as well as

  • Business component browsing may be unavaliable

    Hey there guys, Learning the basics of ADF here. Tried running my application module so I could take a look at my VOs and no data was showing up... I'm seeing "Business Object Browsing may be unavailable" and am struggling to figure out why... my goo

  • Print a form's content that is designed by swings component?

    ive 2 questions to ask which ive asked one of them tow days before but i havent got a usefull solution for it!!! 1) im trying to print a simple document by these codes:     try             FileInputStream textStream;             textStream = new File

  • Themes for curve 9300

    helloo all, am searching for themes for my curve 9300 , i have already google it so many times but no result , please help with this ...