Oracle error handling

Hi, all
I'm new to Oracle and trying to find which Oracle predefined exceptions to handle explicityly in my sp/package. I'll need to do this to capture all available for specific action, then translate them into "User friednly" message to be sent to client without going into ORA-9999 details. I excpect to hard code most probable Exceptions and the rest hadnle with WHEN OTHER..
Also what the best way to keep ORA-9999 type messages for later review, is there any special logging mechanism for Oracle, so I can access them after execution.
Also I read that EXCEPTION should be coded at the end of the sql block, that bit confusing for me, is it alwayse it's the end of actual procedure ? or there is some type of "block" delimiter. In another words, can I write some other code after EXCEPTIONS?
For my case I'm looking for list of EXCEPTION for the following sql code:
for SELECT (to cursor):
for UPDATE:
Thansk
T

You will, of course, handle the exceptions you expect to see - like NO_DATA_FOUND, and other typical processing exceptions.
For the others, you have three choices
1. Let the exception bubble up to the user so that he can see that something really bad happened. When he opens a trouble ticket to report that something awful happened, he will pass the full text of the exception message ticket and you will have some idea of what happened and where in the code.
2. Capture the input arguments and processing steps along the way in the procedure and write them to a log - delete anything over three days old. Then when something bad happens place a marker entry into the log with the error stack, call stack. Now you can pass a message back to the user to say something like 'Something bad happened. Please contact application support.'.
3. Create a package to handle exceptions for you - this is a rather sophisticated piece of code - that will trap and log exception details and, possibly, create an entry in the alert log or trace file. You will call this from the exception handler, then return and pass a message back to the user telling him that something bad happened.
Some how or other, you will need the information provided by the error stack to help you identify the root cause and fix the problem.

Similar Messages

  • Oracle Error Handling in Shell Scripts

    I need to manage 2 diferente class of errors :
    Oracle Errors(produced in compilation time) and
    Operating Syste Error(e.g. No Datbase conection ORA-1017,etc) my shell its KSH.
    Please can you help me how can I manage then?
    this my alternative but is not correct ;
    #creating conexion with sql
    exit | sqlplus -s $USERPV_DB/$PWDPV_DB @$VORDSQLPATH/ord.extractor_porven.sql $VFDESDE $VFHASTA > $VORDDATOS_PATH/ord.extractor_porven$VDATE.dat 2>> $VLOG
         #Evaluating last sentence (sqlplus . . . . )
         VERROR=$?
         #Si VERROR=0 should stop process execution and alert with echo ".."Oracle error handling before compilation time
         if [ $VERROR  != 0 ]
         then
         echo "value of VERROR are:$VERROR"
         echo "`date +"$V_FORMATDATE"` DATA EXTRACTION WAS NOT SUCESSFUL ERROR BEFORE COMPILATION TIME" >> $VLOG 2> /dev/null
         " Here show VERROR
         else #Oracle error handling in compilation time
         echo "`date +"$V_FORMATDATE"` DATA EXTRACTION WAS NOT SUCESSFUL ERROR BEFORE COMPILATION TIME " >> $VLOG
         " Here show VERROR
    else if [ $VERROR  = 0 ]
    " DATA EXTRACTION WAS SUCESSFUL"
    fi
    Would apreciate your help its very urgent.
    Best Regards
    Antonio

    user5647282 wrote:
    I need to manage 2 diferente class of errors :
    Oracle Errors(produced in compilation time) and
    Operating Syste Error(e.g. No Datbase conection ORA-1017,etc) my shell its KSH.
    Please can you help me how can I manage then?
    this my alternative but is not correct ;
    #creating conexion with sql
    exit | sqlplus -s $USERPV_DB/$PWDPV_DB @$VORDSQLPATH/ord.extractor_porven.sql $VFDESDE $VFHASTA > $VORDDATOS_PATH/ord.extractor_porven$VDATE.dat 2>> $VLOG
    Piping the output of 'exit' to sqlplus????????? what do you expect from this?
         #Evaluating last sentence (sqlplus . . . . )
         VERROR=$?any error returned by sqlplus as $? would be a fatal error of sqlplus itself, not any error returned by processing a sql statement. If your script ord.extractor_porven.sql were to generate, say, an ORA-00001, that is NOT an error in sqlplus and so does not return to the OS as an error of sqlplus.
         #Si VERROR=0 should stop process execution and alert with echo ".."Oracle error handling before compilation time
         if [ $VERROR  != 0 ]
         then
         echo "value of VERROR are:$VERROR"
         echo "`date +"$V_FORMATDATE"` DATA EXTRACTION WAS NOT SUCESSFUL ERROR BEFORE COMPILATION TIME" >> $VLOG 2> /dev/null
         " Here show VERROR
         else #Oracle error handling in compilation time
         echo "`date +"$V_FORMATDATE"` DATA EXTRACTION WAS NOT SUCESSFUL ERROR BEFORE COMPILATION TIME " >> $VLOG
         " Here show VERROR
    else if [ $VERROR  = 0 ]
    " DATA EXTRACTION WAS SUCESSFUL"
    fi
    Would apreciate your help its very urgent.
    there is no "urgent" here.
    "Urgent" means one of two things -
    1) people are dying, or
    2) you have a customer-facing, revenue-producing production system that is down.
    (And to get some perspective on the second case, keep the first in mind.)
    For the first, you call whatever civil emergency service seems appropriate.
    For the second, you open an SR with Oracle - which requires a paid-up support contract. For them to consider your problem "urgent", you will need to demonstrate that your problem falls under item #2. I seriously doubt your problem fits that criteria.
    Best Regards
    Antonio

  • R/3 IDOC - XI- ORACLE Error Handling

    Hi,
    All
    we have to send IDOC Data to ORACLE system Through XI.
    R/3 IDOC (OB)->XI ->ORACLE(IB)
    In This scenarion How we can handle the errors between
    R/3 IDOC (OB) ->XI
    And
    XI->ORACLE
    Here we need to check the Null Values and invalid Data. in XI.
    Thnx in Advance
    regards
    kumar

    Hi,
    Michal
    Thankyou for your prompt reply and I appreciate your help.
    Ans:if you need to check if the idoc has all fields
    you can do checks in the mapping .
    In value mapping or in User define function we can check?
    Ans: if it does not have everything start an exception
    in the mapping
    how  this exception will intimate us does this data having errors?
    regards
    kumar

  • Error handling in Oracle

    Hello,
    Could anyone help to convert the following T-SQL statement to PL-SQL? Thanks inadvance!
    BEGIN TRAN
    UPDATE Table1 SET .......
    SELECT @ReturnCode = @@error
    IF @ReturnCode <> 0
         BEGIN          
              SELECT @msg = 'Error - update date feed'
    GOTO Err_Handler
         END     
    COMMIT TRAN
    RETURN 0
    Err_Handler:          
              ROLLBACK TRAN
              INSERT INTO LogTable(ProcessName, ProcessStatus)
                   VALUES('Daily date feed', @msg)
              EXEC msdb.dbo.sp_send_dbmail      
                   @recipients = '[email protected]',
                   @Subject = 'Daily datafeed process failed',
                   @body = @msg          
              RETURN 1

    Sänjay wrote:
    Hi,
    Anonymous block example
    SQL> declare
    2   x number ;
    3  begin
    4    select count(*) into x from dual ;
    5    update emp set empno=empno ;
    6    dbms_output.put_line('Rows updated '|| sql%rowcount);
    7  exception -- Exception Or Error Handling
    8   when others then
    9    rollback ;
    10    dbms_output.put_line(SQLERRM);
    11  end ;
    12  /
    Rows updated 14
    PL/SQL procedure successfully completed.SSAwful example! I would fire programmers who would repeatetly produce such code. Rule #1: Avoid "when others expetions" wherever possible!
    I know you're capable of give much better examples.
    Btw: This code would produce the same result in sql*plus without any exception block:
    proof
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    SQL> drop table test;
    Table dropped.
    SQL> set serveroutput on
    SQL> create table test (col1 number);
    Table created.
    SQL>
    SQL> /* first without exception */
    SQL> declare
      2     x number ;
      3  begin
      4     insert into test values (1);
      5     select length(dummy) into x from dual where 1=1;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from test;
          COL1
             1
    SQL>
    SQL> /* now add some error */
    SQL>
    SQL> declare
      2     x number ;
      3  begin
      4     insert into test values  (2);
      5     select length(dummy) into x from dual where 1=2;
      6  end;
      7  /
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 5
    SQL>
    SQL> select * from test;
          COL1
             1
    SQL>
    SQL> As you can see the second insert was rollbacked. But be careful, this works only for ANONYMOUS pl/sql blocks.
    Edited by: Sven W. on Jul 24, 2009 3:17 PM

  • Oracle stored procedure call failed,but not captured by the error handling

    Hi All,
    I have a unix shelll script which calls a stored proc in Oracle, the stored proc call failed due to "ORA-01033: ORACLE initialization or shutdown in progress".
    But it is not captured in the error handling block, Any ideas why this had happened?
    SQL file had : my_test_sql.sql
    exec my_proc(..............);
    Unix shell script has this call:
    sqlplus -s my_user/my_pwd@db1 @my_test_sql.sql
    if [[ $? -ne 0 ]]; then
    echo "failed"
    exit 1
    else
    echo "success"
    fi
    If i execute the above shell, I'm getting the following
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    SP2-0306: Invalid option.
    Usage: CONNÝECT¨ Ýlogon¨ ÝAS SYSDBA¨
    where <logon> ::= <username>Ý/<password>¨Ý@<connect_identifier>¨ | /
    success.
    This puzzled me, any pointers?

    The $? status variable shows the return code of the last command executed. It will be difficult to determine what the exit status of your sql script is without knowing the script. Do you have any "WHENEVER SQLERROR EXIT" statements in the script?
    The ORA-01033 error happens when the database is not open, perhaps in recovery, or startup or shutdown is halted due to a failed or full disk, error in archiving or writing to redo, etc.

  • How to handle an Oracle error

    I want to handle an Oracle Error in my code where the "execute immediate" statement comes to play.
    My code goes against several tables
    ID_TABLE_08
    ID_TABLE_07
    ID_TABLE_06
    If table does not exist in database (ie: ID_TABLE_05) I get : Oracle Error ORA-0942 table or view does not exist.
    How can I capture and handle this error so
    1. The code will continue to run getting the next value
    2. The bad record still will get written in to a table called bad_table.
    v_year := TO_CHAR (pp_eff_dtg (indx), 'yy');
    BEGIN
    EXECUTE IMMEDIATE
    'SELECT DISTINCT ID_number
    FROM ID_TABLE_'|| v_year||'
    WHERE NAME = :NAME
    AND EFFECTIVE_DATE = : EFFECTIVE_DATE
    INTO v_ID_number
    USING pp_NAME (indx),
    pp_eff_dtg (indx);
    GOTO END_LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    GOTO INSERT_ADD_RECORD;
    END;
    Thank you for your help!

    if you want to handle a specific oracle error number you can also declare an exception, match that exception to the error number and handle it.
    Like this (not syntax checked)
    declare
      e_table_does_not_exist exception;
      pragma exception_init (-942,e_table_does_not_exist); -- I hope I got the parameters in the right order
    begin
       EXECUTE IMMEDIATE('select * from ID_TABLE_'|| v_year||' where ...');
    exception
       when e_table_does_not_exist then -- handle specific error
           raise_application_error(-20001,'The table ID_TABLE_'|| v_year||' could not be found. Next time enter a valid year!');
    end;

  • Error Handling in Oracle Sales Cloud

    Is there a best practice guide/document for error handling in Oracle Sales Cloud?
    For example: Error handling in groovy scripts, business processes.
    Can someone provide a starting point to this topic?
    Thanks,
    Abhishek

    Hi.
    Please review this short video showing you the online logging feature for Application Composer - Groovy. It's very simple and gives you a basic debug capability.
    https://www.youtube.com/watch?v=RcyeKQY2ZGo&index=35&list=PL1ZiAfFIniZf_Uu4qTcp5IZYdFOm9K5o3
    Kind regards,
    Richard
    FA Developer Relations

  • Send a email while error handler Oracle Service bus 11g

    I need to be send an email while error handler in proxy service message flow.
    Error Handler Node -> stage -> report action
    before or after report action, I need be to send a email
    Could you please help this issue? I appreciate your help.
    Thanks,
    sdev

    Add Alert to your Error Handler and set Alert Destination with your email set in.
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/operations/monitoring.html#wp1108089
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/consolehelp/alertdestinations.html

  • Handle Oracle Error from Oracle Forms

    Actually I have a form with all types of validation and Id will be auto-generated by forms.
    Now if any oracle error occures after pre-insert, auto-generated number will generate but record is not saving.
    I want to handle this oracle error in my form and nullify the auto-generated ID forcefully.
    Edited by: Sudipto Nag on Sep 16, 2008 12:07 PM

    The way we handle database error generally is this:
    You should in any case have a NOT NULL constraint on the database column. In the ON-ERROR trigger, we then check for the dbms_error_code value to see, what error message the database returned, after checking for Forms returning the general trigger exception 40735. For example, to trap a NOT NULL constraint voilation, you would do something like this.
    if error_code= 40735 then --Forms error code = "Trigger raised unhandled exception".         
      if dbms_error_code in (-1400, -1407) then --mandatory not null column missing     
        --do something, like alerting the user
      elsif dbms_error_code in (&lt;other DBMS error codes goes here&gt;) then
        --do something else
      end if;
    end if;I believe this is what you are looking for. Hope it helps.
    Regards,
    Jacob

  • Capturing oracle error codes into a variable

    Hi
    Can someone show me how it is possible to save an Oracle defined error code into a variable? What I am trying to do is when a stored procedure fails an Oracle error is raised, such as ORA-xxxx, then pass this code into variable to be saved into a log.
    How do I achieve this?

    user633278 wrote:
    How do I achieve this?Function SQLCODE in PL/SQL exception handler returns error code. SQLERRM returns message:
    SQL> declare
      2      x number;
      3  begin
      4      x := 1/0;
      5    exception
      6      when others
      7        then
      8          dbms_output.put_line('Error code: ' || SQLCODE);
      9          dbms_output.put_line('Error message: ' || SQLERRM);
    10  end;
    11  /
    Error code: -1476
    Error message: ORA-01476: divisor is equal to zero
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Oracle error codes

    Hello,
    My application is handling exceptions like this:
    try{
    resultSet = pStatement.executeQuery();
    catch(SQLException e){
    conn.close();
    if(e.getErrorCode() == 942)
    // handle with table or view doesn't exist
    else
    // handle with other errors
    Is there a way to not hard code the error codes?
    Is there any java constants to oracle error or messages in the jdbc driver?
    Thanks,
    Vladimir.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Marcus Uddenhed ([email protected]):
    I need to know where i can find,
    a description to the error codes
    in Oracle.<HR></BLOCKQUOTE>
    null

  • Issue with SRDemo error handling

    Hi All,
    Glad the forums are back up and running. In debugging some error-handling issues in our own application, I found an issue in the error handling code of SRDemo. I thought I'd post the issue here, as many of us (myself included) use some SRDemo code as the basis for our own applications.
    The issue can be found in the oracle.srdemo.view.frameworkExt.SRDemoPageLifecycle class, specifically in the translateExceptionToFacesErrors method. I'll show the code that has the issue first, and explain the issue afterwards:
            if (numAttr > 0) {
                Iterator i = attributeErrors.keySet().iterator();
                while (i.hasNext()) {
                    String attrNameKey = (String)i.next();
                     * Only add the error to show to the user if it was related
                     * to a field they can see on the screen. We accomplish this
                     * by checking whether there is a control binding in the current
                     * binding container by the same name as the attribute with
                     * the related exception that was reported.
                    ControlBinding cb =
                        ADFUtils.findControlBinding(bc, attrNameKey);
                    if (cb != null) {
                        String msg = (String)attributeErrors.get(attrNameKey);
                        if (cb instanceof JUCtrlAttrsBinding) {
                            attrNameKey = ((JUCtrlAttrsBinding)cb).getLabel();
                        JSFUtils.addFacesErrorMessage(attrNameKey, msg);
                }Now, this bit of code attempts to be "smart" and only show error messages relating to attributes if those attributes are in fact displayed on the screen. It does so by using a utility method to find a control binding for the attribute name. There are two issues with this code, one obvious, and one that is a bit more subtle.
    The obvious issue: if there is a binding in the page definition, it doesn't necessarily mean that the attribute is shown on the screen. It's a good approximation, but not exact.
    The other issue is more subtle, and led to errors being "eaten," or not shown, in our application. The issue comes if you are using an af:table to display and update your data. In that case, the findControlBinding will not find anything for that attribute, since the attribute is contained within a table binding.
    Just posting this as a word to the wary.
    Best,
    john

    somehow, this message got in the wrong thread....
    Hi Frank,
    Yes, I simply scripted it out this way to contrast the behaviour if the first attribute was read-only vs not read-only. I found the issue on a page in our app that was simply drag-and-drop the VO from the data control on the page.
    It's quite annoying, because our particular use case that hit this error is a "save" button on the page. If the commit operation doesn't return any errors (and it doesn't in this use case!), we add a JSF message saying "save successful" - then the attribute errors are further added later in the page lifecycle, so we get 3 messages: "Save successful" and "Fix this error" and "Tried to set read-only attribute" - quite confusing to the end-user when the only message they should see is "fix this error."
    At any rate, the fix is to simply re-order the attributes in the page definition - that doesn't affect the UI at all, other than to fix this issue.
    John
    it was supposed to be something like:
    Hi Frank,
    Thanks for the reply. I was simply posting this here so that people who use the SRDemo application techniques as a basis for developing the same functionality in their own apps (like me) can be aware of the issue, and avoid lots of head-scratching to figure out "what happened to the error message?"
    John

  • RMAN-06004:ORACLE error from recovery catalog ... ORA-00904: : invalid ...

    Good Morning All,
    One of our RMAN backups is failing with the following error message. Any suggestions would be greatly appreciated.
    ==================================================================================================
    Starting backup at 12/30/2008 22:03:47
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 12/30/2008 22:03:47
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> ##BACKUP ARCHIVELOG ALL FORMAT '%d_bkp_al_%t_Set%s_Piece%p' delete input;
    2>
    3> # DELETE ARCHIVELOG UNTIL TIME 'SYSDATE-7';
    4>
    5> # check if database can be restored
    6> # RESTORE DATABASE VALIDATE;
    7>
    8> # check if controlfile can be restored
    9> ##RESTORE CONTROLFILE to '/backups/admin/custpr/custpr_bkp_cntlfile.ctl' VALIDATE;
    10>
    11> # check if archivelogs for the past two weeks can be restored
    12> # RESTORE ARCHIVELOG FROM TIME 'SYSDATE-7' VALIDATE;
    13>
    14> # - Verify all backups on backup media are intact
    15> # CROSSCHECK BACKUP OF DATABASE;
    16>
    17> # - Display a list of files that need to be backed up based on the retention
    18> # policy. For this case study, files that don't have at least 1 backups
    19> # will be reported.
    20> REPORT NEED BACKUP;
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to recovery window of 7 days
    Report of files whose recovery needs more than 7 days of archived logs
    File Days Name
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of report command at 12/30/2008 22:03:48
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> # - delete un-necessary backups. This command deletes backups based on the
    2> # retention policy.
    3> ######### commented out DELETE OBSOLETE - TSM not configured to delete on 68
    4> #########DELETE OBSOLETE;
    5>
    6> # - get complete list of existing backups
    7> LIST BACKUP;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of list command at 12/30/2008 22:03:49
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> #-end of file-
    2> **end-of-file**
    RMAN>
    Edited by: ORA_UMAIR on Dec 31, 2008 7:51 AM

    This Oracle Database is 9.2.0.6.0. Here is the complete log file. The RMAN script that I am using ran successfully many times before.
    ====================================================================================================
    Recovery Manager: Release 9.2.0.6.0 - 64bit Production
    Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
    RMAN>
    connected to recovery catalog database
    RMAN>
    connected to target database: CUSTPR (DBID=525071053)
    RMAN>
    RMAN> #########################################################################
    2> # LEVEL 0 BACKUP #
    3> #########################################################################
    4>
    5> # Configure backups to be written to disk.
    6> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    old RMAN configuration parameters:
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    new RMAN configuration parameters:
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Set the retention policy to a recovery window of 7 days. This ensures that
    2> # RMAN retains all backups needed to recover the database to any point in time
    3> # in the last 7 days. You can use the DELETE OBSOLETE command to delete
    4> # backups that are no longer required by the retention policy. To exclude a
    5> # backup from consideration by the policy, you can use KEEP option with the
    6> # BACKUP command.
    7> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    old RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    new RMAN configuration parameters:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Configure RMAN to use two disk channels for backup, restore, recovery, and
    2> # maintenance operations.
    3> CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
    old RMAN configuration parameters:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
    new RMAN configuration parameters:
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Configure RMAN to write disk backups to the /backup directory.
    2> # The format specifier %t is replaced with a 4-byte timestamp, %s with the
    3> # backup set number, and %p with the backup piece number.
    4> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backups/admin/custpr/%d_bkp_df%t_Set%s_Piece%p';
    old RMAN configuration parameters:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backups/admin/custpr/%d_bkp_df%t_Set%s_Piece%p';
    new RMAN configuration parameters:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backups/admin/custpr/%d_bkp_df%t_Set%s_Piece%p';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Configure RMAN to back up the control file after each backup.
    2> CONFIGURE CONTROLFILE AUTOBACKUP ON;
    old RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    new RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Configure RMAN to write controlfile autobackups to the /backup directory.
    2> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backups/admin/custpr/%d_bkp_cf%F';
    old RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backups/admin/custpr/%d_bkp_cf%F';
    new RMAN configuration parameters:
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backups/admin/custpr/%d_bkp_cf%F';
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Enable the backup optimization feature introduced in 9i to make sure that
    2> # RMAN won't backup an archivelog or datafile if there already exists a backup
    3> # of that file. The FORCE option can be used to override optimization on a
    4> # specific BACKUP command.
    5> CONFIGURE BACKUP OPTIMIZATION ON;
    old RMAN configuration parameters:
    CONFIGURE BACKUP OPTIMIZATION ON;
    new RMAN configuration parameters:
    CONFIGURE BACKUP OPTIMIZATION ON;
    new RMAN configuration parameters are successfully stored
    starting full resync of recovery catalog
    full resync complete
    RMAN>
    RMAN> # Use the SHOW ALL command to see the current configuration settings.
    2> SHOW ALL ;
    RMAN configuration parameters are:
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 'SBT_TAPE' TO '%d_bkp_cf%F';
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backups/admin/custpr/%d_bkp_cf%F';
    CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 1;
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
    CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_bkp_df%t_Set%s_Piece%p';
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/backups/admin/custpr/%d_bkp_df%t_Set%s_Piece%p';
    CONFIGURE MAXSETSIZE TO UNLIMITED; # default
    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/orahome2/custprdb/9.2.0/dbs/snapcf_custpr.f'; # default
    RMAN>
    RMAN> # The following commands are run each day to start the backup cycle.
    2> # The steps are:
    3> # - Take an incremental level 0 backup of the database. A level 0 backup is
    4> # a complete backup of the entire file which can be used as the basis
    5> # for a subsequent incremental backup.
    6> # - Backup all archivelogs that have not already been backed up.
    7> # - Delete on-disk archivelogs older than seven days.
    8>
    9> BACKUP INCREMENTAL LEVEL 0 FORMAT '/backups/admin/custpr/%d_bkp_df%t_Set%s_Piece%p'
    10> DATABASE maxsetsize 33G
    11> PLUS ARCHIVELOG FORMAT '/backups/admin/custpr/%d_bkp_al%t_Set%s_Piece%p'
    12> delete all input;
    Starting backup at 12/30/2008 22:01:40
    current log archived
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=11 devtype=DISK
    channel ORA_DISK_1: starting archive log backupset
    channel ORA_DISK_1: specifying archive log(s) in backup set
    input archive log thread=1 sequence=8008 recid=7910 stamp=674638862
    input archive log thread=1 sequence=8009 recid=7911 stamp=674671207
    input archive log thread=1 sequence=8010 recid=7912 stamp=674697380
    input archive log thread=1 sequence=8011 recid=7913 stamp=674780433
    input archive log thread=1 sequence=8012 recid=7914 stamp=674784211
    input archive log thread=1 sequence=8013 recid=7915 stamp=674863288
    input archive log thread=1 sequence=8014 recid=7916 stamp=674863300
    channel ORA_DISK_1: starting piece 1 at 12/30/2008 22:01:41
    channel ORA_DISK_1: finished piece 1 at 12/30/2008 22:03:47
    piece handle=/backups/admin/custpr/CUSTPR_bkp_al674863300_Set3083_Piece1 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:02:07
    channel ORA_DISK_1: deleting archive log(s)
    archive log filename=/custpr/arch/arch_custpr_8008.log recid=7910 stamp=674638862
    archive log filename=/custpr/arch/arch_custpr_8009.log recid=7911 stamp=674671207
    archive log filename=/custpr/arch/arch_custpr_8010.log recid=7912 stamp=674697380
    archive log filename=/custpr/arch/arch_custpr_8011.log recid=7913 stamp=674780433
    archive log filename=/custpr/arch/arch_custpr_8012.log recid=7914 stamp=674784211
    archive log filename=/custpr/arch/arch_custpr_8013.log recid=7915 stamp=674863288
    archive log filename=/custpr/arch/arch_custpr_8014.log recid=7916 stamp=674863300
    Finished backup at 12/30/2008 22:03:47
    Starting backup at 12/30/2008 22:03:47
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 12/30/2008 22:03:47
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> ##BACKUP ARCHIVELOG ALL FORMAT '%d_bkp_al_%t_Set%s_Piece%p' delete input;
    2>
    3> # DELETE ARCHIVELOG UNTIL TIME 'SYSDATE-7';
    4>
    5> # check if database can be restored
    6> # RESTORE DATABASE VALIDATE;
    7>
    8> # check if controlfile can be restored
    9> ##RESTORE CONTROLFILE to '/backups/admin/custpr/custpr_bkp_cntlfile.ctl' VALIDATE;
    10>
    11> # check if archivelogs for the past two weeks can be restored
    12> # RESTORE ARCHIVELOG FROM TIME 'SYSDATE-7' VALIDATE;
    13>
    14> # - Verify all backups on backup media are intact
    15> # CROSSCHECK BACKUP OF DATABASE;
    16>
    17> # - Display a list of files that need to be backed up based on the retention
    18> # policy. For this case study, files that don't have at least 1 backups
    19> # will be reported.
    20> REPORT NEED BACKUP;
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to recovery window of 7 days
    Report of files whose recovery needs more than 7 days of archived logs
    File Days Name
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of report command at 12/30/2008 22:03:48
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> # - delete un-necessary backups. This command deletes backups based on the
    2> # retention policy.
    3> ######### commented out DELETE OBSOLETE - TSM not configured to delete on 68
    4> #########DELETE OBSOLETE;
    5>
    6> # - get complete list of existing backups
    7> LIST BACKUP;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of list command at 12/30/2008 22:03:49
    RMAN-06004: ORACLE error from recovery catalog database: ORA-00904: : invalid identifier
    RMAN>
    RMAN> #-end of file-
    2> **end-of-file**
    RMAN>
    Recovery Manager complete.

  • Error Handling in File Adapter

    I have been working on a requirement where the file adapter picks up the file and gives to the BPEL for processing the data.
    So, in order to do Error Handling for file adapter, i have been reading the Oracle documentation for technology adapters. In that, some of the
    points which i felt valuable for my error handling when using file adapter are the uniqueMessageSeparator property, fault-policies for rejected messages,
    and one of the action for rejected messages could be writing the payload to a file or invoking any other webservice.
    In my composite, i have configured the file adapter as a service for reading files, and i defined the xsd using the native format builder....If i put some data like 'aaaa' in the attribute of type integer , the .csv file is being picked up and its being passed to the BPEL without any error ? I believe there should be a translation error...right...
    But i am not getting the error, please tell me if anything is wrong in my xsd....
    Here is my xsd...
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://TargetNamespace.com/InboundService"
    targetNamespace="http://TargetNamespace.com/InboundService"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:version="NXSD"
    nxsd:stream="chars"
    nxsd:encoding="US-ASCII"
    nxsd:hasHeader="true"
    nxsd:headerLines="1"
    nxsd:headerLinesTerminatedBy="${eol}"
    >
    <xsd:element name="names">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="name" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="FirstName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="LastName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," />
    <xsd:element name="Number" type="xsd:integer" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    And for DB Adapter, there is a property called SchemaValidation, i think that is not there for File adapter, by default it will take care of validation i guess....In another composite, my file adapter is picking up the .xml file and if i put any wrong data over there, that is working fine, i am getting the translation error, but only here in the case of csv file, i am not getting the error. Experts, please help me in this regard...I am using SOA 11G
    Thanks,
    Naresh

    Hi Yatan,
    Thanks for the reply. I did the same way, where my composite is picking up an XML file and translation error is coming. Even the fault policies are working fine, like writing to a file and even invoking other web service. Its really good that you have achieved the same thing in csv files. But the same thing i am unable to achieve when my file adapter is picking up the csv file. I really cant understand where i am doing wrong.
    here is my XSD which i defined through my native builder format...
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    xmlns:tns="http://TargetNamespace.com/FileRecv"
    targetNamespace="http://TargetNamespace.com/FileRecv"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:version="NXSD"
    nxsd:stream="chars"
    nxsd:encoding="US-ASCII"
    nxsd:hasHeader="true"
    nxsd:headerLines="1"
    nxsd:headerLinesTerminatedBy="${eol}"
    >
    <xsd:element name="Roots">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="FirstName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
    <xsd:element name="LastName" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy="&quot;" />
    <xsd:element name="Number" type="xsd:integer" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    the jca file ..
    <adapter-config name="FileRecv" adapter="File Adapter" wsdlLocation="FileRecv.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter" UIincludeWildcard="n*.csv"/>
    <endpoint-activation portType="Read_ptt" operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
    <property name="DeleteFile" value="true"/>
    <property name="MinimumAge" value="0"/>
    <property name="PhysicalDirectory" value="C:\files"/>
    <property name="Recursive" value="false"/>
    <property name="PollingFrequency" value="5"/>
    <property name="IncludeFiles" value="n.*\.csv"/>
    <property name="UseHeaders" value="false"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    I told that the file will contain only 1 record while defining xsd and i kept a record whose values are John , Peter and akjdkjdskj.
    Now if the data is like above, the file is still getting picked up without any translation error and the BPEL is getting completed successfully...
    Is it possible for you to send your sample project and the csv file from which you have defined the xsd to me if you dont mind ?
    Thanks,
    Naresh

  • Oracle Error when starting the WLI server (samples domain) on Windows XP

    I've installed WLI (SP2) on Windows XP and after Starting the Server (from the
    "Start Server and Launch Examples" commands on the start menu) I get the following
    Oracle error in the console:
    I'm using WLI 7.0 with SP2 and Oracle 9i on Windows XP Home.
    ORA-12154: TNS:could not resolve service name
    Any ideas?

    Hi Peter,
    Based on the error messages it looks like this might be a Windows 7 security issue, which would be why it doesn't occur on XP since security is handled differently in that OS. Have you gone into dcomcnfg.exe and checked the DCOM permissions as described in the error message?

Maybe you are looking for