Oracle 8i database data recover problem

Hi hi,
I've recently encountered a problem on how to restoring data from old oracle folders to a new oracle 8i database.
Originally, my oracle 8i was installed in windows 2000 server on a harddisk (J:\oracle old) separated from that the OS (windows 2000 server) resided. Recently, the harddisk with the OS has been permanantly demaged and I've installed windows 2000 server on a new harddisk (C:\winnt), reinstalled the oracle database (J:\oracle).
However, is there any way to recover the data from an instance of the original database to the newly created database.
I will be grateful for any suggestion? Thanks a lot.

CREATE CONTROLFILE
Caution:
Oracle recommends that you perform a full backup of all files in the database before using this statement. For more information, see Oracle9i User-Managed Backup and Recovery Guide.
Purpose
Use the CREATE CONTROLFILE statement to re-create a control file in one of the following cases:
All copies of your existing control files have been lost through media failure.
You want to change the name of the database.
You want to change the maximum number of redo log file groups, redo log file members, archived redo log files, datafiles, or instances that can concurrently have the database mounted and open.
Note:
If it is necessary to use the CREATE CONTROLFILE statement, do not include in the DATAFILE clause any datafiles in temporary or read-only tablespaces. You can add these types of files to the database later.
An alternative to the CREATE CONTROLFILE statement is ALTER DATABASE BACKUP CONTROLFILE TO TRACE, which generates a SQL script in the trace file to re-create the controlfile. If your database contains any read-only or temporary tablespaces, that SQL script will also contain all the necessary SQL statements to add those files back into the database.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_54a.htm#SQLRF01203
Joel P�rez

Similar Messages

  • Win32 Oracle 10g Database Server Installation problems

    Hello,
    I have recently installed the Oracle 10g Database Server for Win32. The installation seemed to be successful. I used the Enterprise option and all the suggested defaults. Ihave the following services installed and started after the installation:
    o OracleDBConsoleORCL [started]
    o OracleOraDb10g_home1iSQL*Plus [started]
    o OracleOraDb10g_home1SNMPPeerEncapsulator [manual]
    o OracleOraDb10g_home1SNMPPeerMasterAgent [manual]
    o OracleOraDb10g_home1TNSListener [started]
    o OracleServiceORCL [started]
    I have created the following files:
    # LISTENER.ORA Network Configuration File: d:\oracle10gServer\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = asparuh)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\oracle10gServer)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORCL)
    (ORACLE_HOME = d:\oracle10gServer)
    (SID_NAME = ORCL)
    # TNSNAMES.ORA Network Configuration File: d:\oracle10gServer\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = asparuh)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORCL)
    INST1_HTTP =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = asparuh)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = SHARED)
    (SERVICE_NAME = MODOSE)
    (PRESENTATION = http://HRService)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    I go to the DOS console and type:
    c:> sqlplus scott/tiger@ORCL
    and I get:
    ERROR: ORA-28000: the account is locked
    I did this right after I restarted my computer.
    When I use the Enterprise Manager at:
    http://localhost:5500/em/
    I get for ORCL:
    Status: Status Pending
    Status Pending Since: Unavailable
    Seems that I can never get the database started properly?! When I press the Startup/Shutdown button I get:
    Current Status: open
    This is the correct current database status, although it doesnot match the current status in the sitemap page
    What does this mean? Do you think this may contain the clue to the answer to this problem?
    When I restart the Database I get the same status: unavailable.
    I need your help to resolve this problem. The alternative is to revert back to Oracle 9i DB Server. Thank you in advance.
    gkk

    I can help you with the SCOTT account being locked. Try:
    sqlplus /nolog
    connect / as sysdba
    alter user scott identified by tiger account unlock;

  • ORACLE 9I DATABASE - CRASH & RECOVER

    I AM USING ORACLE 9I FOR LINUX IN A DUAL XEON PROCESSOR SERVER. NOW DATABASE DOES NOT OPEN PROPERLY AND SHOW FOLLOWING MESSAGES:-
    1) for SYSDBA user message for startup database
    SQL*Plus: Release 9.2.0.1.0 - Production on Thu Aug 21 18:49:14 2003
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Enter user-name: sys as sysdba
    Enter password:
    Connected to an idle instance.
    SQL> startup
    ORACLE instance started.
    Total System Global Area 621875780 bytes
    Fixed Size 451140 bytes
    Variable Size 335544320 bytes
    Database Buffers 285212672 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
    SQL>
    2) Then we reset the logs the message is:
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1: '/C/app/oracle9ir2/oradata/tepiapp/system01.dbf'
    SQL>
    3) When connecting with different user the message is :
    Enter user-name: mis-dba
    Enter password:
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    0;oracle@tepiapp:~[oracle@tepiapp oracle]$
    Please guide me for detail solutions for this problem
    Regards,
    FSL

    hmmm ok, so it seems that you dont use RMAN to backup your database...
    It seems there that your have a controlfile problem after a disk crash. I hope your database is on ARCHIVELOG mode.
    Does your database crashed during activity or was idle ?
    1. Mount the database
    2. set autorecovery on ;
    recover database using backup controlfile ;
    media recovery complete <= this means that all is ok now
    3. alter database open resetlogs ;
    if #2 doesnt work cause of redo log problem such as corrupted redo log, or some transactions "blocked" in theses redo log cause of a big crash during the database activity, Oracle will tell you that a redo log is corrupted and will give you the hour of the redo log log entry that Oracle need to recover.
    So you will have to make an incomplete recovery (that means you will lose some datas, no much but some) until time.
    For example, your redo entry has been corrupted at 12:00:50
    1. recover database until time '2003-08-25:12:00:00' ;
    2. alter database open resetlogs ;
    3. Make a full backup of your database !
    Fred

  • Oracle 8i database-Date format

    hello
    i got my database in mssql server, now we want to shift to Oracle8i, while accomplishing above task, i am not able to export date type data from mssql to oracle8i, because of date format
    mssql date format is "07/21/2001" and oracle8i, format is "21-jul-2001" .
    please help me to solve above problem as early as possible.
    Regards,
    Aarti

    I think you're off-topic here.
    Anyway: Oracle doesn't have "a" date format, it just has a default one. (The client (e.g. SQL*Plus) often has a different default one, come to think of it.)
    You don't say how you're doing your data loading. If you're using SQL*loader then I think you get to specify a date format using "DATE 'mm/dd/yyyy'". If you're using a different client or tool then you can always alter the default for this session using " ALTER SESSION SET nls_date_format = 'mm/dd/yyyy'; ".
    This is all fairly evident from R-ing-TFM, though. (Hope I haven't annoyed anyone by replying?) But I'd be very surprised if SQLServer doesn't let you "export" the date in another format, anyway....
    (So where do your skills lie exactly, Aarti? :-))

  • Oracle 9i Database Download Problem

    I have been trying to download a Personal Edition of Oracle 9i database.This fails with a page not found error.
    - Server name : UK
    - Filename : Oracle 9i database
    - Date/Time : 14:20 pm (GMT)
    - Browser + Version : IE 5
    - O/S + Version : Windows 2000
    - Error Msg : Page not found

    Hello,
    Due to the popularity of OTN's software downloads, we sometimes experience periods of high load on our systems. We apologize for any inconvenience this may cause.
    If you have downloaded a file and it appears to be corrupt, it is most likely that your connection is being dropped or lost during the transfer process.
    Here are a few suggestions:
    1) Please make sure that your proxy server settings are correct before attempting to download again and try alternating between browsers.
    2) There is download management software available that you can try at http://www.getright.com that provides the "resume" feature. Please try using this software and let us know if it has any effect on your download.
    3) Please try changing the URL of the software you would like to download from
    http://download.oracle.com/xxx/xxx.zip to:
    a) http://download-west.oracle.com/
    b) http://download-east.oracle.com/
    c) http://download-uk.oracle.com/
    4) Try an alternate internet browser
    Regards,
    OTN

  • Problem in recover physical standby database(Data Guard) by rman

    Hello to all
    I have created a physical standby database ,I want make backup of it by rman and when I lose it's datafile I can restore it ,making backup and restore is fine but in recovery I encounter some problem
    scenarios is follow
    1- In rman I create a backup of standby database by this command:
    backup database plus archivelog delete all input;
    2- I run this comman in rman for recover standby database
    run{
    2> set until scn 1392701;
    3> restore database;
    4> recover database;
    5> }
    (1392701 is extracted from this query "SELECT MAX(NEXT_CHANGE#)+1 UNTIL_SCN FROM V$LOG_HISTORY LH,
    V$DATABASE DB WHERE LH.RESETLOGS_CHANGE#=DB.RESETLOGS_CHANGE# AND LH.RESETLOGS_TIME =
    DB.RESETLOGS_TIME;" "http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/rman.htm")
    but RMAN result is like this:
    executing command: SET until clause
    Starting restore at 13-DEC-08
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from
    backup set
    restoring datafile 00001 to /u01/app/oracle/oradata/sari/system01.dbf
    restoring datafile 00002 to /u01/app/oracle/oradata/sari/undotbs01.dbf
    restoring datafile 00003 to /u01/app/oracle/oradata/sari/sysaux01.dbf
    restoring datafile 00004 to /u01/app/oracle/oradata/sari/users01.dbf
    restoring datafile 00005 to /u01/app/oracle/oradata/sari/example01.dbf
    restoring datafile 00006 to /u01/app/oracle/oradata/sari/users02.dbf
    channel ORA_DISK_1: reading from backup piece /home/oracle/backup/0ek24dt4_1_1
    channel ORA_DISK_1: restored backup piece 1
    piece handle=/home/oracle/backup/0ek24dt4_1_1
    tag=TAG20081213T042506
    channel ORA_DISK_1: restore complete, elapsed time: 00:01:07
    Finished restore at 13-DEC-08
    Starting recover at 13-DEC-08
    using channel ORA_DISK_1
    starting media recovery
    archive log thread 1 sequence 116 is already on disk as file /u01/app/oracle/oradata/archive/1_116_666786084.arc
    archive log thread 1 sequence 117 is already on disk as file /u01/app/oracle/oradata/archive/1_117_666786084.arc
    archive log filename=/u01/app/oracle/oradata/archive/1_116_666786084.arc thread=1 sequence=116
    archive log filename=/u01/app/oracle/oradata/archive/1_117_666786084.arc thread=1 sequence=117
    unable to find archive log
    archive log thread=1 sequence=118
    RMAN-03002: failure of recover command at 12/13/2008 05:14:13
    RMAN-06054: media recovery requesting unknown log: thread 1
    seq 118 lowscn 1392700
    3- then I decline 1392701 to 1392700 and i run this command
    run{
    2> set until scn 1392700;
    3> restore database ;
    4> recover database;
    5> }
    executing command: SET until clause
    Starting restore at 13-DEC-08
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from
    backup set
    restoring datafile 00001 to /u01/app/oracle/oradata/sari/system01.dbf
    restoring datafile 00002 to /u01/app/oracle/oradata/sari/undotbs01.dbf
    restoring datafile 00003 to /u01/app/oracle/oradata/sari/sysaux01.dbf
    restoring datafile 00004 to /u01/app/oracle/oradata/sari/users01.dbf
    restoring datafile 00005 to /u01/app/oracle/oradata/sari/example01.dbf
    restoring datafile 00006 to /u01/app/oracle/oradata/sari/users02.dbf
    channel ORA_DISK_1: reading from backup piece /home/oracle/backup/0ek24dt4_1_1
    channel ORA_DISK_1: restored backup piece 1
    piece handle=/home/oracle/backup/0ek24dt4_1_1 tag=TAG20081213T042506
    channel ORA_DISK_1: restore complete, elapsed time: 00:01:08
    Finished restore at 13-DEC-08
    Starting recover at 13-DEC-08
    using channel ORA_DISK_1
    starting media recovery
    archive log thread 1 sequence 116 is already on disk as
    file /u01/app/oracle/oradata/archive/1_116_666786084.arc
    archive log thread 1 sequence 117 is already on disk as
    file /u01/app/oracle/oradata/archive/1_117_666786084.arc
    archive log filename=/u01/app/oracle/oradata/archive/1_116_666786084.arc thread=1
    sequence=116archive log
    filename=/u01/app/oracle/oradata/archive/1_117_666786084.arc
    thread=1 sequence=117Oracle Error:
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS
    would get error below
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/u01/app/oracle/oradata/sari/system01.dbf'
    media recovery complete, elapsed time: 00:00:10
    Finished recover at 13-DEC-08
    4- if I run
    run{
    restore database;
    recover database;
    I will recieve that error of step 2 (RMAN-06054: media recovery requesting unknown log: thread 1
    seq 118 lowscn 1392700)
    5- if I just restore the database and I don't perform recovery by rman and I restart redo apply all thing seem fine
    but in opening database I'll recieve ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/u01/app/oracle/oradata/sari/system01.dbf' error)
    do you know what is problem
    thanks
    Edited by: ARKH on Dec 12, 2008 11:06 PM

    hi
    I myself have found the solution , when I recover the standby database
    it do recovery but at the end of recovery it raise the error(RMAN-06054: media recovery requesting unknown log: thread 1
    seq 118 lowscn 1392700) but if I begain redo apply before open the database
    and I wait till all redo apply process start and communication between the
    standby database and the primary database start, then I can
    open the standby database and no error will raise
    but if befor restarting redo apply I open the database I'll recieve the
    ORA-01152: file 1 was not restored from a sufficiently old backup
    ORA-01110: data file 1: '/u01/app/oracle/oradata/sari/system01.dbf' error
    thanks

  • Problem with oracle.jbo.domain.Date

    Hi there,
    I've a problem with oracle.jbo.domain.Date,
    I'm doing this code (this part of code is used in my Session Attribute Listener):
    * This method is used to add the session id in the database, whenever user login
    public void attributeAdded(HttpSessionBindingEvent hsbe){
    if(!hsbe.getName().equals("user")){
    return;
    AmLogin am = (AmLogin)Configuration.createRootApplicationModule(
    "com.ahm.pdt001.am.AmLogin",
    "AmLoginLocal");
    try{
    hsbe.getSession().setAttribute("login", new Date(new Timestamp(
    System.currentTimeMillis())));
    am.createLogin(hsbe.getValue().toString(), hsbe.getSession().
    getAttribute("login").toString());
    } catch(Exception e){
    e.printStackTrace();
    System.out.println("Error insert data user: " + hsbe.getValue());
    } finally{
    Configuration.releaseRootApplicationModule(am, true);
    Everything is running well in Jdev 10.1.3 (I'm using ADF Faces technology), and I'm trying to deploy it on OC4J 10.1.2 and it works. But it raised an error when this part of code is runned.
    --------------caused and error------------------------
    hsbe.getSession().setAttribute("login", new Date(new Timestamp(
    System.currentTimeMillis())));
    And this is an error:
    javax.faces.FacesException: #{pdt001.loginAction}: javax.faces.el.EvaluationException: java.lang.NoSuchMethodError: oracle.jbo.domain.Date.<init>(Ljava/sql/Timestamp;)V     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)     at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)     at com.ahm.filter.AhmFilterSession.doFilter(AhmFilterSession.java:45)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:645)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)     at java.lang.Thread.run(Thread.java:534)Caused by: javax.faces.el.EvaluationException: java.lang.NoSuchMethodError: oracle.jbo.domain.Date.<init>(Ljava/sql/Timestamp;)V     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)     ... 23 moreCaused by: java.lang.NoSuchMethodError: oracle.jbo.domain.Date.<init>(Ljava/sql/Timestamp;)V     at com.ahm.pdt001.listener.Pdt001AttributeSessionListener.attributeAdded(Pdt001AttributeSessionListener.java:27)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)].server.http.EvermindHttpSession.setAttribute(EvermindHttpSession.java:128)     at com.ahm.pdt001.bean.Pdt001Bean.loginAction(Pdt001Bean.java:61)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)     at java.lang.reflect.Method.invoke(Method.java:324)     at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    Does anybody have the same problem like this? I've used the same method in my previous project to create oracle.jbo.domain.Date with current time using java.sql.Timestamp, but I don't know why this error happened.
    Thx,
    Andre

    Re: oracle jbo.domain.Date issues in 10.1.3
    Sascha

  • Security problem in oracle 9i Database Configuration Assistant

    Inside the tool Oracle 9i Database Configuration Assistant there is an option by which you can make a "copy" of your Database. This "copy" is called a template and you don4t need any password or aunthentication to do it, you just need the tool to be installed in your server. Once you have a template, you can bring it anywhere and recreate the original database (including data). Again, you don't need any password or aunthentication to do it, further more, in the last step of this process you can change the password of any user (inluding SYS, SYSTEM or another DBA user). The thing about this is that anyone with access to the computer where the database is can make a template of it, take this template to another computer and recreate my database having FULL access to it (structure, data, code ...). And everything without needing any password!!!. I really thing that it is a big problem. Is there any way of preventing this operation?. How can I safely protect my database?. I thought about unistalling the product, but someone can re-install it and everything would be the same. Can someone give me an answer?
    Thanks for everything.
    Pablo Cuenca

    You must protect your database from casual browsing at the OS level. This is not a security hole, per se, since this is a known issue with any and all software. Database Configuration Assistant is not needed for this since one may copy the database without it.

  • Problem connecting with Oracle 9i Database

    Hi Gurus,
    I'm having problems with connecting to Oracle 9i Database.
    I have a newly installed XML Publisher running on Windows XP SP3.
    I can't get my data source connected to other server running Oracle Database 9i.
    It keep on saying "Could not establish connection"
    Im using jdbc:oracle:thin:@host:port:sid format , username/password are correct.
    What seems to be the problem?
    Hoping for your help.
    Thanks

    Hi Steve,
    Let me clarify. I had an Oracle XML Publisher installed in my laptop (Windows XP SP3). I want to configure my XML Publisher to connect to a server
    where Oracle Database is installed (Oracle 9i DB). I can connect to this database using SQL Plus, SQL Developer. My problem is that after configuring the JDBC connection in XML Publisher, i still can't connect to the said oracle db. The info are correct SID, Hostname etc. and still can't connect.
    Hope this clarifies the situation.
    Thanks

  • Inserting files in to Oracle 8i database through JDBC - Only 4k data file

    Hi,
    I need to insert a files(images or excel files, doc files etc..) in to oracle 8i database through JDBC program. But i am not able to store more than 4k data files in to files. can any body give me solutions regarding this.
    My code is like this...
    String fileName ="Sample.jpg";
                                  String dataSource = "jdbc/oracle";
                   File file=null;
                   FileInputStream fis = null;
                   Context initCtx=null;
                   DataSource ds = null;
                   Connection con = null;
                   try
                        initCtx = new InitialContext();
                        ds = (DataSource)initCtx.lookup(dataSource);
                        con = ds.getConnection();
                      try
                         file = new File(fileName);
                         fis = new FileInputStream(file);
                        catch(FileNotFoundException fe)
                             out.println("File Not Found");
                                            PreparedStatement pstmt = con.prepareStatement("insert into bfiles values(?,?)");
                        pstmt.setString(1, fileName);
                        pstmt.setBinaryStream(2, fis, (int)file.length());
                        pstmt.executeUpdate();
                        out.println("Inserted");
                        fis.close();
                        pstmt.close();
                        con.close();
                        out.println("closed");
                   catch(Exception e)
                        out.println(e);
               }     in Oracle bi i have created a table like this :
    CREATE TABLE BFILES
      FILENAME     VARCHAR2(100)                    DEFAULT NULL,
      FILECONTENT  BLOB                             DEFAULT EMPTY_BLOB()
    )Please help me ourt to solve this problem.
    i got struck in this problem.
    its urgent
    thanks in advance
    djshivu

    Hi Shanu.
    Thanks for your help...
    By Using THIN driver also we can insert any files more than 4k and and retrive same. Fallowing codes worked fine for me using thin Driver .
    Following are the 2 programs to write and read.
    we can insert and retrieve any format of files ( jpg, gif, doc, xsl, exe, etc...)
    =======================================================
    // Program to insert files in to table
    import oracle.jdbc.driver.*;
    import oracle.sql.*;
    import java.sql.*;
    import java.io.*;
    import java.awt.image.*;
    import java.awt.*;
    * @author  Shivakumar D.J
    * @version
    public class WriteBlob{
    public static void main(String[] args){
    String filename = "018-Annexure-A.xls";
    Connection conn = null;
    try{
        Class.forName("oracle.jdbc.driver.OracleDriver");
        conn=DriverManager.getConnection("jdbc:oracle:thin:@test:1521:orcl","modelytics","modelytics");
        conn.setAutoCommit(false);
        Statement st = conn.createStatement();
        int b= st.executeUpdate("insert into bfiles values('"+filename+"', empty_blob())");
        ResultSet rs= st.executeQuery("select * from bfiles for update");
        rs.next();
        BLOB blob=((oracle.jdbc.driver.OracleResultSet)rs).getBLOB(2);
        FileInputStream instream = new FileInputStream(filename);
        OutputStream outstream = blob.getBinaryOutputStream();
        int chunk = blob.getChunkSize();
        byte[] buff = new byte[chunk];
        int le;
        while( (le=instream.read(buff)) !=-1)
            outstream.write(buff,0,le);
        instream.close();
        outstream.close();
        conn.commit();
        conn.close();
        conn = null;
        System.out.println("Inserted.....");
       catch(Exception e){
            System.out.println("exception"+e.getMessage());
            e.printStackTrace();
       }//catch
    }=======================
    // Program to retrieve files from database
    [import java.sql.*;
    import java.io.*;
    import java.awt.*;
    public class ReadImage
    public static void main(String a[])
        String fileName ="018-Annexure-A.xls";
        try
              Driver driver = new oracle.jdbc.driver.OracleDriver();
              DriverManager.registerDriver(driver);
              Connection con = DriverManager.getConnection("jdbc:oracle:thin:@test:1521:orcl", "modelytics", "modelytics");
            File file = new File("C:/Documents and Settings/USERID/Desktop/dump.xls");
              FileOutputStream targetFile=  new FileOutputStream(file); // define the output stream
              PreparedStatement pstmt = con.prepareStatement("select filecontent from bfiles where filename= ?");
              pstmt.setString(1, fileName);
               ResultSet rs = pstmt.executeQuery();
               rs.next();
               InputStream is = rs.getBinaryStream(1);
              byte[] buff = new byte[1024];
               int i = 0;
               while ((i = is.read(buff)) != -1) {
                    targetFile.write(buff, 0, i);
                   System.out.println("Completed...");
            is.close();
            targetFile.close();
            pstmt.close();
           con.close();
        catch(Exception e)
              System.out.println(e);
    }====================
    Table Structure is like this
    CREATE TABLE BFILES
      FILENAME     VARCHAR2(100)                    DEFAULT NULL,
      FILECONTENT  BLOB                             DEFAULT EMPTY_BLOB()
    )========================================================
    i hope above codes will helpful for our future programmers
    thanks shanu...
    regards
    djshivu...(javashivu)

  • Data Migration from MS   Excel Sheet to Oracle 9i Database

    Can anyone please help me to perform a data migration from MS excel sheet to Oracle 9i Database. I have an excel sheet from which i need to move data to the database. One of the columns in the sheet posseses multiple new line characters, and which causes a problem while migrating data with the help of SQL Loader. I would like to know whether any utility is available to migrate data directly from MS Excel sheet to the database, or it would he really helpfull for me , if anyone provide me with an alternate solution.

    I think Christian's suggestion will work for easily and quickly.
    1) create table link of Oracle target table in MS Office's ACCESS thru ODBC;
    2) from Access screen, you may easily dump the excel data into the linked table.
    This is very easy and feasible ways. Don't bother to find other ways. The other ways will need you to clear the unwanted carriage return signs first.

  • Problem Oracle 10g database Installation on Windows 2003 Server

    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad Shoaib

    898118 wrote:
    Hi All,
    I am trying to face some problem to install oracle 10g database on windows 2003 server with service pack 2. Once I start to installation it give me an error "Error in writing to directory 'c:\documents and settings\administrator\local settings\temp\orainstall2004xxx'. Please ensure that this directory is writable and has at least 45MB of disk space. Installation cannot continue"
    I double-insured that there is enough disk-space and I am also in the Administrators-Group.
    Please guide me for the above problem although I have done oracle 9i database installation with the same configuration.
    Regards
    Muhammad ShoaibOracle really doesn't like to be installed into directories with spaces in their names.

  • Problem in installation of Oracle 10g database on RHEL 6

    I am facing the problem when I am trying to install Oracle 10g database on Red Hat 6. When ./runinstaller is run, the message seems to be if I remember correctly is like ‘……………bad ELF interpreter’. But, the same source seems to be installing correctly in Red Hat 5.
    Please, help in solving the doubt.
    Regards

    Hi;
    1. Please make search before posting your issue here. Similar issue mention here million time
    2. Please use certified platform such as *nix 5.x .
    3. For can check certification from metalink or from below note:
    Oracle Database on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2) [ID 169706.1]
    PS:Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
    Regard
    Helios

  • How to migrate data from oracle 9i database to new machine 11gr2 RAC ASM

    Hi Expert
    I need your expertise to advise me what is the best method to move data from oracle 9i database to new machine running oracle 11r2 RAC database with ASM.
    Currently my production server running on HPUX ORACLE 9I database with normal file system. My new server is running SUN SOLARIS SPACR 64 bit ORACLE 11gr2 RAC with ASM. What is best method to move data over so it will be consistent. Any guide can refer.
    Regard
    William

    Hi William,
    See the note in metalink Migration of Oracle Database Instances Across OS Platforms [ID 733205.1] to saw the Endian Format of your OS. If is the same you can use the RMAN to convert the database to another OS, if not the only option is using export/import (Transportable Tablespaces).
    To upgrade from 9i to 11g, see the note 837570.1 - Complete Checklist for Manual Upgrades to 11gR2.
    To migrate your FS to ASM the only way is using RMAN, so see the note - How to move a datafile from a file system to ASM [ID 390274.1].
    Hope this help you.
    Best Regards,
    Ruben Morais

  • Oracle 9i Database -- Performance window in Grid Control not data available

    Hi
    I have Grid Control 10.2.0.4 on Red Hat and i monitoring some Oracle 9i Instances. When i go to any of these instances to the Performance section, at begininig , ever, not data available in all the graphics.
    When i select manual refresh the graphic begin to build information. But if i close the explorer and reopen , all graphics not have any information.
    Is the situation normal for all Oracle 9i databases?
    The explanation is that Oracle 9i not have AWR ?
    Thanks

    You have too few RAM on your machine, even you could successfully create an instance, it's going to slow as hell.
    When you run DBCA to create database, instead of actually creating the database you could choose to dump the SQL scripts and files used for database creation to a directory. This way will give you a chance to modify pfile and reduce the SGA parameter. I believe the default SGA of instance created by DBCA is already beyond your RAM limit.

Maybe you are looking for

  • While inserting values from a xml file into the database.

    Dear Forum Members, While using Samp10.java (given in XSU!2_ver1_2_1/oracleXSU12/Sample)for inserting values from xml file Sampdoc.xml into database table xmltest_tab1,the error shown below appears on the DOS prompt. The code for sam10 is: import ora

  • Time Machine Hard Drive will never enter sleep mode or stop spinning

    Hi, I'm just wondering if anyone could help me. When i recieved my MacBook I took the 80gb hard drive out, and placed it in an external USB drive case to use as my backup device, and placed a 120gb drive into the MacBook. Now when I'm using this driv

  • How to send a mail thru Oracle

    Hello Every one , Can u plz tell me the way to send a mail thru oracle...................

  • Warning message : Maintain the document in language German

    Hi all, I want to release the customizing but there is a message "Maintain the document in language German" and then "Release of tasks without documentation is not allowed" What should i do ?? Thanks & Regards, Saiful arif

  • APEX_LIST.SELECT_ITEM() issue

    Hi all, I'm new to Apex. I'm having a problem when I want to download a CSV report from an interactive report, the thing here is that the interactive report has this SQL query code in its region source: select APEX_ITEM.SELECT_LIST(1,'Y','Yes;Y,No;N'