Oracle recovery by example

Hi,
I want to practice oracle recovery, can someone guide me to links where its given by example.
I wanted a document with simple explanation by example of when to use commands like
alter database recover until cancel;
alter database open resetlogs;
alter database open noresetlogs;
recover database using backup controlfile;
sometimes during recovery we get ORA-00280: change 963279 for thread 1 is in sequence #4
, i want to what happens during recovery and how oracle identifies the log sequence etc,
thank you

start with ORACLE documentation
rman backup and recovery basics online documentation
rman backp and recovery advanced users guide online documentation
RMAN Recipes for Oracle Database 11g : A Problem-Solution Approach(it also covers 10g)
By Sam R. Alapati, Darl Kuhn, Arup Nanda
ISBN13: 978-1-59059-851-1
http://apress.com/book/view/1590598512
also refer:-
http://gavinsoorma.com/recovery-scenarios/
refer the link:-
Oracle 10g DBA book
if you would like buy this book to become expert in RMAN
BACKUP AND RECOVERY ORACLE 8i by RAMA VELPURI
http://www.amazon.com/Oracle8i-Backup-Recovery-Rama-Velpuri/dp/0072127171

Similar Messages

  • Please Help:  A Problem With Oracle-Provided 'Working' Example

    A Problem With Oracle-Provided 'Working' Example Using htp.formcheckbox
    I followed the simple steps in the Oracle-provided example:
    Doc ID: Note:116534.1
    Subject: How to use checkbox in webdb for bulk update using webdb report
    However, when I select a checkbox and click on the Update button, I get a "ORA-01036: illegal variable name/number" error. Please advise. This was a very promising feature.
    Fred
    Below are step-by-step instructions provided by Oracle to create this "working" example:
    How to use a checkbox in WEBDB 2.2 report for bulk update.
    PURPOSE
    This article shows how checkbox can used placed on WEBDB report
    and how to use it.
    SCOPE & APPLICATION
    The following example to guide through the steps to create a working
    example of this.
    In this example, the checkbox is used to select the records. On clicking
    the update button, the pl/sql procedure is called which will update col1 to
    the string 'OK'.
    After the update is done, the PL/SQL procedure calls the report again.
    Since the report only select records where col1 is null, the updated
    records will not be displayed when the report is called again.
    Step 1 - Create Table
    From Sqlplus, log in as scott/tiger and execute the following:
    drop table chkbox_example;
    create table chkbox_example
    (id varchar2(10) not null,
    comments varchar2(20),
    col1 varchar2(10));
    Step 2 - Insert Test Data
    From Sqlplus, still logged in as scott/tiger , execute the following:
    declare
    l_i number;
    begin
    for l_i in 1..50 loop
    insert into chkbox_example values (l_i, 'Comments ' || l_i , NULL);
    end loop;
    commit;
    end;
    Step 3 -Create SQL Query based WEBDB report
    Logon to a WEBDB site which has access to the database the above tables are created.
    Create a SQL based Report.
    Name the report :RPT_CHKBOX
    The select statement for the report is :
    select c.id, c.comments, c.col1,
    htf.formcheckbox('p_qty',c.id) Tick
    from SCOTT.chkbox_example c
    where c.col1 is null
    In Advanced PL/SQL, (REPORT, Before displaying the form), put the following code
    htp.formOpen('scott.chkbox_process');
    htp.formsubmit('p_request','Update');
    htp.br;
    htp.br;
    Step 4 - Create a stored procedure in the database
    Log on to the database as scott/tiger and execute the following to create the
    procedure.
    Note: Replace WEBDB to the appropriate webdb user for your installation.
    In my database, I had installed webdb using WEBDB username, hence user webdb owns
    the packages.
    create or replace procedure chkbox_process
    ( p_request in varchar2 default null,
    p_qty in wwv_utl_api_types.vc_arr ,
    p_arg_names in wwv_utl_api_types.vc_arr ,
    p_arg_values in wwv_utl_api_types.vc_arr
    is
    i number;
    begin
    for i in 1..p_qty.count loop
    if p_qty(i) is not null then
    begin
    update chkbox_example
    set col1 = 'OK'
    where chkbox_example.id = p_qty(i);
    end;
    end if;
    end loop;
    commit;
    /* To Call Report again after updating */
    SCOTT.RPT_CHKBOX.show
    (p_request=>'Run Report',
    p_arg_names=>webdb.wwv_standard_util.string_to_table2(' '),
    p_arg_values=>webdb.wwv_standard_util.string_to_table2(' '));
    end;
    Summary
    There are essentially 2 main modules, The WEBDB report and the pl/sql procedure (chkbox_process)
    A button is created via the advanced pl/sql coding which shows on top of the report. (The
    button cannot be placed at the bottom of the report due to the way WEBDB creates the procedure
    internally)
    When any button is clicked on the report, it calls the pl/sql procedure chkbox_process.
    The procedure is called , WEBDB always passes the parameters p_request,p_arg_names and o_arg_values.
    p_qty is another parameter that we are passing additionally, This comes from the checkbox created
    using the htf.formcheckbox in the report select statement.
    The pl/sql procedure calls the report again after processing. This is done to
    show how to call the report.
    Restrictions:
    -The Next and Prev buttons on the report will not work.
    So it is important that the report can fit in 1 page only.
    (This may mean that you will not select(not ticked) 'Paginate' under
    'Display Option' in the WEBDB report. If you do this,
    then in Step 4, remove p_arg_names and p_arg_values as input parameters
    to the chkbox_process)

    If your not so sure you can use the instanceof
    insurance,
    Object o = evt.getSource();
    if (o instanceof Button) {
    Button source = (Button) o;
    I haven't thoroughly read the thread, but I use something like this:if (evt.getSource() == someObjRef) {
        // do that voodoo
    ]I haven't looked into why you'd be creating a new reference...

  • Oracle BPM 11g Examples

    Where I can download Oracle BPM 11g Examples. Demo applications to study BPM in more details.

    Oracle needs to get it together in regards to BPMN 11g demos. There should be a collection of BPMN demos that can be used to show off the various components to people like worklist, workspace, and fusion middleware control. More than likely we have to wait until OpenWorld when there is likely to be a flood of new material released.

  • Oracle Text -- OBE example

    I have been following the Oracle Text -- OBE example and am running into a problem when Creating a Database Access Descriptor (DAD) in the HTTP Server.
    Environment: W2k on a standalone machine with no network connection, running 9i v2.
    When trying to access <hostname>:80 I get a page not found error.
    The HTTP server is running and I can access OEM throught the web browser (port 3339).
    Any suggestions would be apprecieated.
    thanks

    Try using port number 7778 (http://yourmachinename:7778). You should see the Oracle HTTP server index page.

  • Oracle recovery in noarchivelog mode

    Hello,
    SAP Release : ECC6
    Oracle 10G
    Solaris 10g
    Our SAP system is in noarchivelog mode (formation environnement, with frequent client copies).
    We frequently perform an offline backup.
    The solaris server that is hosting our Sap system, has been brutally shutdown this morning,
    due to a network issue.
    Afterwards, we had to restart the sap system.
    A fisrt error occured ; inconsistency between the control files ...
    ORA-00205: error in identifying control file, check alert log for more info
    In alert log :
    ORA-00202: control file: '/oracle/ZMA/origlogA/cntrl/cntlrZMA.dbf'
    ORA-27037: unable to obtain file status
    We regenerated a new control file and replaced it.
    The error was solved.
    Then a second error occured :
    SQL> startup
    ORACLE instance started.
    Total System Global Area 1660944384 bytes
    Fixed Size                  2268216 bytes
    Variable Size             851207112 bytes
    Database Buffers          805306368 bytes
    Redo Buffers                2162688 bytes
    Database mounted.
    ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
    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: '/oracle/ZMA/sapdata1/system_1/system.data1'
    SQL> recover database using backup controlfile until cancel ;
    ORA-00279: change 647063400 generated at 04/28/2008 11:10:01 needed for thread
    1
    ORA-00289: suggestion : /oracle/ZMA/oraarch/ZMAarch1_76005_618576658.dbf
    ORA-00280: change 647063400 for thread 1 is in sequence #76005
    The redo log #76005 is no more available; I tried to apply the online redo logs, but it didn't help.
    We had to restore the whole database from the offline backup.
    1/ I still have problems understanding why Oracle is asking for a recovery, when we tried to reopen the database ? The database was consistent this morning, how is it that the file '/oracle/ZMA/sapdata1/system_1/system.data1' became inconsistent ?
    2/ In sap note 863417 "If the database operates in NOARCHIVELOG mode, the database can ONLY be completely recovered from instance failure but not from media failure. "
    What is exactly the difference between media failure and instance failure ?
    Does a network problem and then a reboot of the host is considered a media failure ?
    Best Regards.
    thank you for your help .

    > 1/ I still have problems understanding why Oracle is asking for a recovery, when we tried to reopen the database ? The database was consistent this morning, how is it that the file '/oracle/ZMA/sapdata1/system_1/system.data1' became inconsistent ?
    Because the database was not shut down cleanly. An open database is by definition "inconsistent" without the proper logfiles.
    > 2/ In sap note 863417 "If the database operates in NOARCHIVELOG mode, the database can ONLY be completely recovered from instance failure but not from media failure. "
    > What is exactly the difference between media failure and instance failure ?
    Media = File/Raw-Device. If you database is crashing due to a software error it can be recovered, if a file is corrupt it can't be (since you have no redo logs).
    > Does a network problem and then a reboot of the host is considered a media failure ?
    A corrupt control file (e. g.) is a media failure.
    Markus

  • Oracle Recovery Error using Wizard

    Recovery Manager: Release 8.1.6.0.0 - Production
    RMAN-06005: connected to target database: VTST (DBID=4051728604)
    RMAN-06009: using target database controlfile instead of recovery catalog
    RMAN> run {
    2> allocate channel DefaultChannel type disk format 'D:\ORACLE\ORA81\DATABASE\DATA\VORA\b_VORA_3_1';
    3> restore ( database);
    4> recover database ;
    5>
    6> }
    7>
    RMAN-03022: compiling command: allocate
    RMAN-03023: executing command: allocate
    RMAN-08030: allocated channel: DefaultChannel
    RMAN-08500: channel DefaultChannel: sid=10 devtype=DISK
    RMAN-03022: compiling command: restore
    RMAN-03022: compiling command: IRESTORE
    RMAN-03026: error recovery releasing channel resources
    RMAN-08031: released channel: DefaultChannel
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: restore
    RMAN-03002: failure during compilation of command
    RMAN-03013: command type: IRESTORE
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 5 found to restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    RMAN-06023: no backup or copy of datafile 3 found to restore
    RMAN-06023: no backup or copy of datafile 2 found to restore
    RMAN-06023: no backup or copy of datafile 1 found to restore
    Recovery Manager complete.
    child process exited abnormally
    null

    The error that you have is because one of your datafile does not have a correct structure right now regarding the structure of your database. You can fix this problem making a recover of that datafile until this get good condition to work with the database. Conclusion you have to make a recover of that datafile so :
    RECOVER
    RECOVER {general | managed | END BACKUP}
    where the general clause has the following syntax:
    [AUTOMATIC] [FROM location]
    { {full_database_recovery | partial_database_recovery |LOGFILE filename}
    [ {TEST | ALLOW integer CORRUPTION } [TEST | ALLOW integer CORRUPTION ]...]
    |CONTINUE [DEFAULT]|CANCEL}
    where the full_database_recovery clause has the following syntax:
    [STANDBY] DATABASE
    [ {UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE}
    [UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE]...]
    where the partial_database_recovery clause has the following syntax:
    {TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...
    | STANDBY
    {TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...}
    UNTIL [CONSISTENT] [WITH] CONTROLFILE }
    where the managed clause has the following syntax:
    MANAGED STANDBY DATABASE
    [ {NODELAY | [TIMEOUT] integer | CANCEL [IMMEDIATE] [NOWAIT]}
    | [DISCONNECT [FROM SESSION] ] [FINISH [NOWAIT] ] ]
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1010523
    if you do not know how to do it , reply again and I am going to tell you
    Joel P�rez

  • Passing Array of java objects to and from oracle database-Complete Example

    Hi all ,
    I am posting a working example of Passing Array of java objects to and from oracle database . I have struggled a lot to get it working and since finally its working , postinmg it here so that it coudl be helpful to the rest of the folks.
    First thinsg first
    i) Create a Java Value Object which you want to pass .
    create or replace and compile java source named Person as
    import java.sql.*;
    import java.io.*;
    public class Person implements SQLData
    private String sql_type = "PERSON_T";
    public int person_id;
    public String person_name;
    public Person () {}
    public String getSQLTypeName() throws SQLException { return sql_type; }
    public void readSQL(SQLInput stream, String typeName) throws SQLException
    sql_type = typeName;
    person_id = stream.readInt();
    person_name = stream.readString();
    public void writeSQL(SQLOutput stream) throws SQLException
    stream.writeInt (person_id);
    stream.writeString (person_name);
    ii) Once you created a Java class compile this class in sql plus. Just Copy paste and run it in SQL .
    you should see a message called "Java created."
    iii) Now create your object Types
    CREATE TYPE person_t AS OBJECT
    EXTERNAL NAME 'Person' LANGUAGE JAVA
    USING SQLData (
    person_id NUMBER(9) EXTERNAL NAME 'person_id',
    person_name VARCHAR2(30) EXTERNAL NAME 'person_name'
    iv) Now create a table of Objects
    CREATE TYPE person_tab IS TABLE OF person_t;
    v) Now create your procedure . Ensure that you create dummy table called "person_test" for loggiing values.
    create or replace
    procedure give_me_an_array( p_array in person_tab,p_arrayout out person_tab)
    as
    l_person_id Number;
    l_person_name Varchar2(200);
    l_person person_t;
    l_p_arrayout person_tab;
    errm Varchar2(2000);
    begin
         l_p_arrayout := person_tab();
    for i in 1 .. p_array.count
    loop
         l_p_arrayout.extend;
         insert into person_test values(p_array(i).person_id, 'in Record '||p_array(i).person_name);
         l_person_id := p_array(i).person_id;
         l_person_name := p_array(i).person_name;
         l_person := person_t(null,null);
         l_person.person_id := l_person_id + 5;
         l_person.person_name := 'Out Record ' ||l_person_name ;
         l_p_arrayout(i) := l_person;
    end loop;
    p_arrayout := l_p_arrayout;
         l_person_id := p_arrayout.count;
    for i in 1 .. p_arrayout.count
    loop
    insert into person_test values(l_person_id, p_arrayout(i).person_name);
    end loop;
    commit;
    EXCEPTION WHEN OTHERS THEN
         errm := SQLERRM;
         insert into person_test values(-1, errm);
         commit;
    end;
    vi) Now finally create your java class which will invoke the pl/sql procedure and get the updated value array and then display it on your screen>Alternatively you can also check the "person_test" tbale
    import java.util.Date;
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.text.DateFormat;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    public class ArrayDemo
    public static void passArray() throws SQLException
    Connection conn = getConnection();
    ArrayDemo a = new ArrayDemo();
    Person pn1 = new Person();
    pn1.person_id = 1;
    pn1.person_name = "SunilKumar";
    Person pn2 = new Person();
    pn2.person_id = 2;
    pn2.person_name = "Superb";
    Person pn3 = new Person();
    pn3.person_id = 31;
    pn3.person_name = "Outstanding";
    Person[] P_arr = {pn1, pn2, pn3};
    Person[] P_arr_out = new Person[3];
    ArrayDescriptor descriptor =
    ArrayDescriptor.createDescriptor( "PERSON_TAB", conn );
    ARRAY array_to_pass =
    new ARRAY( descriptor, conn, P_arr);
    OracleCallableStatement ps =
    (OracleCallableStatement )conn.prepareCall
    ( "begin give_me_an_array(?,?); end;" );
    ps.setARRAY( 1, array_to_pass );
         ps.registerOutParameter( 2, OracleTypes.ARRAY,"PERSON_TAB" );
         ps.execute();
         oracle.sql.ARRAY returnArray = (oracle.sql.ARRAY)ps.getArray(2);
    Object[] personDetails = (Object[]) returnArray.getArray();
    Person person_record = new Person();
    for (int i = 0; i < personDetails.length; i++) {
              person_record = (Person)personDetails;
              System.out.println( "row " + i + " = '" + person_record.person_name +"'" );
                        public static void main (String args[]){
         try
                             ArrayDemo tfc = new ArrayDemo();
                             tfc.passArray();
         catch(Exception e) {
                        e.printStackTrace();
              public static Connection getConnection() {
         try
                             Class.forName ("oracle.jdbc.OracleDriver");
                             return DriverManager.getConnection("jdbc:oracle:thin:@<<HostNanem>>:1523:VIS",
                             "username", "password");
         catch(Exception SQLe) {
                        System.out.println("IN EXCEPTION BLOCK ");
                        return null;
    and thats it. you are done.
    Hope it atleast helps people to get started. Comments are appreciated. I can be reached at ([email protected]) or [email protected]
    Thanks
    Sunil.s

    Hi Sunil,
    I've a similar situation where I'm trying to insert Java objects in db using bulk insert. My issue is with performance for which I've created a new thread.
    http://forum.java.sun.com/thread.jspa?threadID=5270260&tstart=30
    I ran into your code and looked into it. You've used the Person object array and directly passing it to the oracle.sql.ARRAY constructor. Just curios if this works, cos my understanding is that you need to create a oracle.sql.STRUCT out of ur java object collection and pass it to the ARRAY constructor. I tried ur way but got this runtime exception.
    java.sql.SQLException: Fail to convert to internal representation: JavaBulkInsertNew$Option@10bbf9e
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
                        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatum(OracleTypeADT.java:239)
                        at oracle.jdbc.oracore.OracleTypeADT.toDatumArray(OracleTypeADT.java:274)
                        at oracle.jdbc.oracore.OracleTypeUPT.toDatumArray(OracleTypeUPT.java:115)
                        at oracle.sql.ArrayDescriptor.toOracleArray(ArrayDescriptor.java:1314)
                        at oracle.sql.ARRAY.<init>(ARRAY.java:152)
                        at JavaBulkInsertNew.main(JavaBulkInsertNew.java:76)
    Here's a code snippet I used :
    Object optionVal[] =   {optionArr[0]};   // optionArr[0] is an Option object which has three properties
    oracle.sql.ArrayDescriptor empArrayDescriptor = oracle.sql.ArrayDescriptor.createDescriptor("TT_EMP_TEST",conn);
    ARRAY empArray = new ARRAY(empArrayDescriptor,conn,optionVal);If you visit my thread, u'll see that I'm using STRUCT and then pass it to the ARRAY constructor, which works well, except for the performance issue.
    I'll appreciate if you can provide some information.
    Regards,
    Shamik

  • Oracle Database 11g Examples CD

    Hi
    Please can anybody let me know where i can download the 11g examples CD for linuxx86 as early as possinle
    Does it come s with the 11g release 2 patchset?
    Please let me know
    Thanks
    Vinay Varma S

    Hi,
    It should be here or else it is not available:
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112020-zlinux64-352074.html
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com/

  • Running Oracle ADF tutorial example to weblogic server

    Hi all,
    I am following the tutorial at [Developing RIA Web Applications with Oracle ADF|http://st-curriculum.oracle.com/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm] . However, I did something new here. I deployed the finished sample to weblogic admin server, and it went fine. But when I tried to access the page DeptEmpPage.jspx, I got exception:
    oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
    and also
    java.sql.SQLException: ORA-01005: null password given; logon denied
    Looks like the user hr was not logged in. I tried to give explicit plaintext password in the file connections.xml as following
    <SecureRefAddr addrType="password">
    <Contents>hr</Contents>
    </SecureRefAddr>
    , but this also did not work.
    Could you please let me know how to make it working? I know for security concerns, we may need to have a log in form to do authentication. But for the quick-fix and pedagogic purpose, could anyone here please help?
    Many thanks.

    Dou you need to change the bc4j.xcfg content to reference the JNDI connection created in the deployment. Note that the deployed EAR creates a HrDS JDBC connnection with the credentials and Security user and associations, see the JNDI url in your app, for example, for "jdbc/HrDSDS", the entry to be added to the config file must be <Custom JDBCDataSource="java:comp/env/jdbc/HrDSDS"/>
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">
    <AppModuleConfigBag ApplicationName="lt.andrejusb.model.HrModule">
    <AppModuleConfig name="HrModuleLocal" ApplicationName="lt.andrejusb.model.HrModule" DeployPlatform="LOCAL" jbo.project="lt.andrejusb.model.Model">
    <Database jbo.TypeMapEntries="OracleApps"/>
    <Security AppModuleJndiName="lt.andrejusb.model.HrModule"/>
    *<Custom JDBCDataSource="java:comp/env/jdbc/HrDSDS"/>*
    </AppModuleConfig>
    <AppModuleConfig name="HrModuleShared" ApplicationName="lt.andrejusb.model.HrModule" DeployPlatform="LOCAL" jbo.project="lt.andrejusb.model.Model">
    <AM-Pooling jbo.ampool.maxpoolsize="1" jbo.ampool.isuseexclusive="false"/>
    <Database jbo.TypeMapEntries="OracleApps"/>
    <Security AppModuleJndiName="lt.andrejusb.model.HrModule"/>
    <Custom JDBCDataSource="java:comp/env/jdbc/HrDSDS"/>
    </AppModuleConfig>
    </AppModuleConfigBag>
    </BC4JConfig>

  • Oracle ODBC BLOB examples.

    We are currently writing a VB application to harvest data from an Access 2000 database, which is to large to convert to 97 and use migration workbench, and stuff it into an Oracle 8 database, which already has the table structures from the Access dataabase created in it. We are running into a problem in transfering OLE objects in Access to BLOBs in Oracle. Can anyone give some insight / code examples?
    Thanks,
    Matt Shoultz

    When you get a chance, can you post the ADO version, or a link to it?
    thanks.
    Chris
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Justin Cave ([email protected]):
    Unfortunately, I've never dealt with OLE objects in Access. I'm more than happy to help with BLOB's, though.
    I'm posting a document below that covers reading & writing BLOB's with RDO under VB. Unfortunately, it's a little long, so I hope it doesn't get mangled too badly. If there's interest in an ADO version, let me know that as well and I'll post it on another thread.
    If folks would like me to e-mail them a copy of this document, drop me a line. Expect it to take me at least a few days to reply to these requests, though.
    PURPOSE
    The code below should demonstrate how to read from and write to Oracle
    8 BLOB datatypes.
    SCOPE & APPLICATION
    Experienced Visual Basic Developers.
    RELATED DOCUMENTS
    None.
    The code below this demonstrates how to create a Visual Basic project
    to read from and write to BLOB datatypes. It was written and tested using Visual
    Basic 5 and RDO 2. The Oracle 8.0.5.2 ODBC driver was also used and an
    Oracle 8.0.5 database.
    Disclaimer:
    This sample is provided for educational purposes only. It is NOT supported by
    Oracle World Wide Technical Support. The sample has been tested and appears to
    work as intended. However, you should always test in YOUR environment before
    relying on it.
    'Form Image Description
    '~~~~~~~~~~~~~~~~~~~~~~
    'The form needs 1 OLE control (OLE1) and 1 small text box (text 1) default value '1'
    'it also needs 4 command buttons (AddNew,LoadFrom,LoadFromFile,SaveToDB)
    'ODBC Datasource
    '~~~~~~~~~~~~~~~
    'Configure an 8.0.5.2 Oracle ODBC Driver Datasource named 'V805'
    'Code required to generate database objects.
    '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'drop table tblTestBlob;
    'CREATE TABLE tblTestBlob
    ' DATA_ID NUMBER(5,0),
    ' DATA_BlobData BLOB,
    ' DATA_MemoData CLOB
    'INSERT INTO TBLTESTBLOB VALUES (1,EMPTY_BLOB(), EMPTY_CLOB());
    Option Explicit
    Dim en As rdoEnvironment
    Dim Qd As rdoQuery
    Dim Cn As rdoConnection
    Dim Rs As rdoResultset
    Dim SQL As String
    Dim DataFile As Integer, Fl As Long, Chunks As Integer
    Dim Fragment As Integer, Chunk() As Byte, I As Integer
    Const ChunkSize As Integer = 16384
    Dim fileName As String
    Private Sub PipeToFile(sFileName)
    Dim iFile As Integer
    iFile = FreeFile
    Open sFileName For Binary As iFile
    Me.OLE1.SaveToFile iFile
    DoEvents
    Close iFile
    End Sub
    Private Sub AddNew_Click()
    Dim sSQL As String
    sSQL = "Select * from TBLTESTBLOB"
    On Error GoTo errorhandler
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    Rs.AddNew
    Rs("DATA_ID") = Val(Me.Text1)
    Rs("DATA_BLOBDATA").AppendChunk Null
    Rs("DATA_MEMODATA").AppendChunk Null
    Rs.Update
    Rs.Close
    Set Rs = Nothing
    Exit Sub
    errorhandler:
    MsgBox "Add new click"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub Form_Load()
    On Error GoTo errorhandler
    Set Cn = New rdoConnection
    Cn.CursorDriver = rdUseOdbc
    Cn.Connect = ";dsn=" & "V805" & ";uid=" & "scott" & ";pwd=" & "tiger"
    Cn.EstablishConnection
    Exit Sub
    errorhandler:
    MsgBox "Form Load"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Function GetBLOBLength() As Long
    Dim sSQL As String
    Dim oResult As RDO.rdoResultset
    On Error GoTo errorhandler
    sSQL = "SELECT DBMS_LOB.GETLENGTH(DATA_BLOBDATA) FROM TBLTESTBLOB WHERE DATA_ID=" & Text1
    Set oResult = Cn.OpenResultset(sSQL, rdOpenStatic)
    GetBLOBLength = Val("" & oResult.rdoColumns(0).Value)
    oResult.Close
    Set oResult = Nothing
    Exit Function
    errorhandler:
    MsgBox "Get BLOB Length"
    MsgBox Err.Number
    MsgBox Err.Description
    End Function
    Private Sub LoadFrom_Click()
    Dim iNumBlocks As Integer
    Dim lColSize As Long
    Dim lBlockSize As Long
    Dim byteData() As Byte
    Dim lOffSet As Long
    Dim iDestFileNum As Integer
    Dim lLeftOver As Long
    Dim iCount As Integer
    Dim sSQL As String
    On Error GoTo errorhandler
    sSQL = "Select * from TBLTESTBLOB WHERE DATA_ID=" & Val(Text1)
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    If Not Rs.EOF Then
    lColSize = GetBLOBLength()
    If lColSize <> 0 Then
    iDestFileNum = FreeFile
    Open "c:\TEST.DAT" For Binary As iDestFileNum
    lBlockSize = 10000
    iNumBlocks = lColSize \ lBlockSize
    lLeftOver = lColSize Mod lBlockSize
    For iCount = 1 To iNumBlocks
    ReDim byteData(lBlockSize)
    byteData() = Rs("DATA_BLOBDATA").GetChunk(lBlockSize) 'note offset not used by RDO (?)
    Put iDestFileNum, , byteData()
    lOffSet = lOffSet + lBlockSize 'note offset not used by RDO (?)
    Next iCount
    ReDim byteData(lLeftOver)
    byteData() = Rs("DATA_BLOBDATA").GetChunk(lLeftOver) 'note offset not used by RDO (?)
    Put iDestFileNum, , byteData()
    Close iDestFileNum
    iDestFileNum = FreeFile
    Open "c:\TEST.DAT" For Binary As iDestFileNum
    Me.OLE1.ReadFromFile iDestFileNum
    Close iDestFileNum
    End If
    End If
    Rs.Close
    Set Rs = Nothing
    Exit Sub
    errorhandler:
    MsgBox "Load From click"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub LoadFromFile_Click()
    ' Locates a file and sets the Filename to this file.
    On Error GoTo errorhandler
    With CommonDialog1
    .Filter = "*.*"
    .ShowOpen
    fileName = .fileName
    End With
    FileName_Change
    Exit Sub
    errorhandler:
    MsgBox "Load from file"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub SaveToDB_Click()
    Dim sSQL As String
    Dim sTempName As String
    On Error GoTo errorhandler
    sTempName = "c:\TEST.DAT"
    Kill sTempName
    PipeToFile sTempName
    sSQL = "Select DATA_ID, DATA_BLOBDATA from TBLTESTBLOB WHERE DATA_ID=" & Val(Text1)
    'sSQL = "Select DATA_Field1, DATA_IMAGE from TBLBIGDATA WHERE DATA_FIELD1=" & Val(Text1)
    Set Rs = Cn.OpenResultset(sSQL, rdOpenKeyset, rdConcurValues)
    If Rs Is Nothing Or Rs.Updatable = False Then
    MsgBox "Cant open or write to result set"
    Exit Sub
    End If
    If Not Rs.EOF Then
    Rs.Edit
    End If
    DataFile = 1
    Open sTempName For Binary Access Read As DataFile
    Fl = LOF(DataFile) ' Length of data in file
    If Fl = 0 Then
    Close DataFile
    Exit Sub
    End If
    Chunks = Fl \ ChunkSize
    Fragment = Fl Mod ChunkSize
    Rs("DATA_BLOBDATA").AppendChunk Null
    ReDim Chunk(Fragment)
    Get DataFile, , Chunk()
    Rs("DATA_BLOBDATA").AppendChunk Chunk()
    ReDim Chunk(ChunkSize)
    For I = 1 To Chunks
    Get DataFile, , Chunk()
    Rs("DATA_BLOBDATA").AppendChunk Chunk()
    Next I
    Close DataFile
    Rs.Update
    Rs.Close
    Set Rs = Nothing
    MsgBox "Finish"
    Exit Sub
    errorhandler:
    MsgBox "Save to DB"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Private Sub FileName_Change()
    On Error GoTo errorhandler
    Me.OLE1.CreateEmbed fileName
    Exit Sub
    errorhandler:
    MsgBox "File Name Change"
    MsgBox Err.Number
    MsgBox Err.Description
    End Sub
    Justin Cave
    ODBC Development<HR></BLOCKQUOTE>
    null

  • Oracle 11g Database Examples when to install Pre(or)Post DBUA?

    Hi Friends,
    I am performing Oracle DB Upgrade from 11.2.0.1 to 11.2.0.3
    I want to install Oracle 11g Examples also so when can i install it , Pre (or) Post DBUA (or) both are supported?
    Plan A:
    1) Install Oracle 11.2.0.3 on new home
    2)Install Oracle Database Examples 11.2.0.3 on the above home
    3)Invoke dbua to upgrade 11.2.0.1 Database
    (or)
    Plan B:
    1) Install Oracle 11.2.0.3 on new home
    2)Invoke dbua to upgrade 11.2.0.1 Database to 11.2.0.3
    3)Install Oracle Database Examples 11.2.0.3 on the above home
    4) Anything to be performed on the Database(like catpatch...) since examples is installed post DB upgrade?
    (or)
    Both Plan A and Plan B is supported
    Regards,
    DB

    Hi;
    1) Install Oracle 11.2.0.3 on new home (software only)
    2)Install Oracle Database Examples 11.2.0.3 on the above home
    3)Invoke dbua to upgrade 11.2.0.1 Database
    AFAIK you can also install it after upgrade
    Regard
    Helios

  • Oracle Recovery Structures And Processes

    Could somebody please tell me where I can get to know what exactly the following are and what role they play in Instance Recovery
    a) Fast-Start Parallel Rollback
    b) On-Demand Parallel Rollback
    I found no explanation of this in the Backup and Recovery Guide.
    Thanks in Advance.
    With Regds.,
    Sriraman.

    Fast-Start Parallel Rollback is a feature that was introduced in Oracle8 meaning that the in the case of a database crash, Oracle will first roll forward all transactions in the online logs and open the database. Then after the database is open, then the transactions that were not commited would be roll back. Therefore, you do not need to wait for the roll back to occur before the database opens. There have been many improvements on the rollback phase after a crash on when,who, and how the transactions are rolled back. In Oracle9i, the transactions are rolled back a block at a time when the block is needed for a new transaction.
    I found a reference in the Oracle9i Real Application Clusters Concepts guide. http://tahiti.oracle.com/pls/db901/db901.to_URL?remark=drilldown&urlname=http:%2F%2Fdownload-west.oracle.com%2Fotndoc%2Foracle9i%2F901_doc%2Frac.901%2Fa89867%2Fpshavdtl.htm%237046
    Also found information on fast-start and on-demand in Oracle9i Database Performance Guide and Reference. (http://tahiti.oracle.com/pls/db901/db901.to_URL?remark=drilldown&urlname=http:%2F%2Fdownload-west.oracle.com%2Fotndoc%2Foracle9i%2F901_doc%2Fserver.901%2Fa87503%2Finstreco.htm%234 29566) And Chapert 17 of the same book.
    Hope that helps.

  • Oracle Recovery problem

    Hello All,
    We have database running 0n oracle 9.2.0.8 on HPUX.
    We were having database runing in backup mode by that time instance got killed, so the person in charge wasn not aware of database was in backup mode.
    we tried to open the dataabse recieved error it needs recovery, so he started applying archive log with database, now my question is application of archive log would cause any issue as we were suppose to open database after taking it into end backup mode.
    Please advise.
    Vinayak

    If you had put the database or selected tablespaces in backup mode with "ALTER TABLESPACE tablespacename BEGIN BACKUP" commands, you only needed to
    STARTUP MOUNT
    ALTER DATABASE DATAFILE fileid_OR_filename END BACKUP;
    ALTER DATABASE OPEN;supplying the FILE_ID OR the File Name for each datafile of each Tablespace that was in Backup mode.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • How to run oracle cm sdk examples in a standalone mode?

    I encountered some difficulty on how to run the examples provided by CM SDK Developer's Guide,such as SimpleConnection.I deployed my develop enviroment in two computers,installed only oracle JDeveloper in one computer,while installed Oracle10g,Oracle AS and Oracle CM SDK on the other computer.But when I tried to run the example on the computer which was only installed Oracle JDeveloper,I always failed.I have no idea of how to run the example in a standalone mode.I hope someone who familiar with Oracle CM SDK can help me solve the problem or give me some advice.Now I list the errors which appeared when I ran the example,SimpleConnection.
    C:\Oracel JDeveloper904\jdk\bin\javaw.exe -ojvm -classpath C:\Oracel JDeveloper904\jdev\mywork\Workspace2\Project1\classes;C:\Oracel JDeveloper904\jdev\lib\jdev-rt.jar;C:\ias\cmsdk.jar;C:\ias\uix2.jar;C:\ias\classes12.jar;C:\ias\emPid.jar -DIFS.DOMAIN.Name=ifs://zhao:1521:zyh:IFSSYS -DIFS.STANDALONE.Mode=true -DIFS.SCHEMA.PASSWORD=manage oracle.ifs.examples.devdoc.connection.SimpleConnection
    Connecting...
    oracle.ifs.common.IfsException: IFS-20102: Unable to start service (IfsDefaultService)
    oracle.ifs.common.IfsException: IFS-20010: Unable to get service configuration properties (SmallServiceConfiguration)
    java.sql.SQLException: Io Òì³£: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:231)      
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:345)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:431)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:515)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:345)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at oracle.ifs.beans.LibraryService.getServiceConfigurationProperties(LibraryService.java:618)
    at oracle.ifs.beans.LibraryService.getServiceConfigurationProperties(LibraryService.java:503)
    at oracle.ifs.beans.LibraryService.startService(LibraryService.java:366)
    at oracle.ifs.examples.devdoc.connection.SimpleConnection.main(SimpleConnection.java:17)
    Process exited with exit code 0.

    The CMSDK uses the oci8 interface to connect to the database. The classes12.jar file has to correspond to the appropriate ocijdbc9.dll file; and the ocijdbc9.dll file is dependent on about 26 other DLLs beginning with oci*.dll and ora*.dll.
    I've found that the 10.1.0 and 9.2.0 database client releases contain the wrong oci*.dll family (at least for JDeveloper) and I use the 9.0.4 AS Client tree in my path when I work with CMSDK.
    My quick test is to see if I can connect to my database using JDeveloper Connect DBMS with the oci8 connection method. This seems to put out some reasonable error messages explaining why it failed, e.g. it tells you that it couldn't find the right DLL dependency.

  • Oracle Reports API example implementations

    I have found the Oracle Reports Java API @ http://otn.oracle.com/products/reports/htdocs/getstart/docs/Javadocs/index.html
    and have also found some examples utilising this API @
    http://otn.oracle.com/products/reports/apis/
    On this page some of the links are not active to other tutorials/examples
    Does anyone know if these links 'exist' and if so how to access these or any other examples that would be useful in developing a Java app that will utilise Oracle 9iAS Reports Services ?
    cheers
    jimmy

    Hello,
    These links are not active because the samples are not yet available.
    Check regularly http://otn.oracle.com/products/reports/htdocs/getstart/GettingStarted/whatsnew.html
    to be informed about new samples, doc, white papers ...
    Regards

Maybe you are looking for

  • Lock Ups with MSI K7N2 Delta-ILSR [Resolved] thnx!

    Well this is a first for me and it is driving me nucking futs !, I have been building my own pc's for at least 10 years now and never had a problem where I have even needed to come to a forum like this.  So as I see there are some very helpful and kn

  • Multiple BSOD Windows 7 Home Premium 64bit Fujitsu Amilo Desktop

    hi, ive had my fujitsu amilo pc for about 7-8 years and its been working fine until just after xmas i started getting bluescreens and pc wouldnt start up.. ive tried everything, memtest shows no problems , heres a list of bsod codes ive wrote down: d

  • The arrays class question

    consider the code below int[] list = {2, 4, 7, 10}; java.util.Arrays.fill(list, 7); java.util.Arrarys.fill(list, 1, 3, 8); System.out.print(java,util.Arrays.equals(list, list));i understand line 2, it gonna fill 7 into the array,so the output would b

  • Sound quality for recording concerts

    I love music and visit a lot of concerts. When I bought my E63 I noticed that while on my previous phone the sound got all distorted when I tried to record a loud live performance, it sounded pretty good on the E63, even if the concert got loud. Sinc

  • Can't get album artwork - error 609

    I'm using MBP and iTunes 10.3.1. When importing from a CD, I got the track details but not the album artwork. On requesting through menu Advanced I get "Unknown error -609". However,  the same CD on Windows+RealPlayer can get all album and track info