Trapping SQL errors and OS errors

hi all,
i'm running a script which exits execution whenever there is a sql error or an os error. Is it possible to trap the sql error or the os error which caused the script to exits and put it into another log file ? Please Help!!!
Thanks.

Please define script. Is it a sqlplus script? Do you run it from a Unix shell script? Or a Windows bat file? Is it a pl/sql program? Do you call a stored procedure?
You can redirect output from your script to a file.
If you are using sqlpplus, you can use the spool command to log output.
From a stored procedure, use a combination of the spool command and dbms_output to log error messages.

Similar Messages

  • How to trap sql errors in a script

    Hi,
    I have a SQL script where I need to call 5 other SQL scripts. Every of those 5 scripts contain the following code for trapping an sql error:
    WHENEVER SQLERROR EXIT sql.sqlcode
    whenever oserror exit os.oscode
    SET SERVEROUTPUT ON
    In the first script that calls the others I put the same code at the begining.
    Is it enough for the first script to trap the errors from the others and to show them at runtime?
    Thanks

    Yes but test it as we do not necessarily know what you want to script to do when an error occurs.

  • FRM-40655: SQL error forced rollback: clear form and re-enter transaction.

    Hello ,
    I have ORACLE 10G & Forms 6i on Windows server 2008 . When I open the forms for some work , it give me error in few minis.
    FRM-40655: SQL error forced rollback: clear form and re-enter transaction.
    I have not done anything unusual in form design. it was working properly from a long time.
    Yesterday i set the default profile to idle_time = 20. Will that make any problem ???
    I checked my Alert Log but no sign of any deadlock in it, or any other unusual activity ....
    What is the solution ???
    Thanks in advance ..

    This happens due to dead lock situation
    To avoid this problem, add NOWAIT option to the UPDATE and DELETE statements, which returns ORA-00054 error, trap this error and display user defined message like 'The record is being accessed and try after some time'.
    This even improves the performance
    because no process waits for the locks preventing dead locks.
    If it is due to the UPDATE's or DELETE's with base table blocks in the form, in the PRE-UPDATE and PRE-DELETE triggers write SELECT statements to select the particular row with FOR UPDATE NO WAIT option. Handle by trapping the ORA-00054 error

  • SQL error while activating DSO and loading Mater Data

    Hello Experts,
    we are having process chains which include process activating DSO and loading to Master data,
    while executing achai, we are getting error:
    An error occurred during confirmation of process 000008. See long text
    Message no. RSODSO_PROCESSING024
    Diagnosis
    Note the detailed system message:
    An SQL error occurred when executing Native SQL.
    when i go to T-Code: ST22
    the diagnosis is below:
    Runtime Errors         DBIF_RSQL_SQL_ERROR
    Exception              CX_SY_OPEN_SQL_DB
    Date and Time          20.05.2010 22:18:02
    What happened?
         The database system detected a deadlock and avoided it by rolling back
         your transaction.
    What can you do?
         If possible (and necessary), repeat the last database transaction in the
          hope that locking the object will not result in another deadlock.
         Note which actions and input led to the error.
         For further help in handling the problem, contact your SAP administrator
         You can use the ABAP dump analysis transaction ST22 to view and manage
         termination messages, in particular for long term reference.
         Note which actions and input led to the error.
         For further help in handling the problem, contact your SAP administrator
         You can use the ABAP dump analysis transaction ST22 to view and manage
         termination messages, in particular for long term reference.
    Could you please help me out how can i deal with this issue, .
    Regards
    Sinu Reddy

    it seems that the target you're loading to is already locked by another load...if it concerns a master data is also possible that the master data is locked by a change run. check your scheduling and make sure you don't load the same target at the same moment...
    M.

  • Designer 6.0 Repository Reports and PL/SQL Error ORA 6505

    Trying to run some Repository reports give error
    REP-1401 'cf_desc_textformula'. Fatal PL/SQL error occurred.
    ORA-06505: PL/SQL: variable requires more than 32767 bytes
    of contiguous memory
    Occurs at e.g. ckentdef Seems to be that Reports has Problems
    with the Entity Descriptions and Notes in the repository...
    The Database Characterset is US7-ASCII
    Any Ideas?
    Michael
    null

    Hi, I4m not sure, but maybe it works,in WHEN OTHERS zone, to make commit after the insert in the table where you want the errors to log. You can make commit in a trigger if you specify in the declaration zone of the trigger:
    PRAGMA AUTONOMOUS_TRANSACTION;

  • SQL error forced rollback and connection loss with OLE item in forms 6i

    We are running forms 6i client server on a Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit. We have a form that has 1 base table block that contains an OLE item where the user can create or edit a Microsoft Word document then save that document in a long raw column in the table. The OLE item is using the Word.Document.8 OLE class.
    We are having intermittant problems where the user presses commit in the form and gets a FRM-40508 error: unable to Insert record. The message displayed at the bottom of the screen is FRM-40655: SQL error forced rollback: clear form and re-enter transaction. When I press Shift-F1 to view the error I see ORA-03113: end-of-file on communication channel.
    DBA says that there are no errors being generated in the database. Does anyone have any experience with kind of problem? Any suggestions would be most welcome.

    The Ora-3113 error means that the connection has been lost.
    These issues normally are database or networking related and have little to do with ole objects.
    You need to determine if a server-side error is causing the disconnect.
    To start diagnosing this issue you first need to turn on sqlnet tracing to see what other ora-XXXX error is occuring. That will start to help diagnosing this issue.
    You may also want to check the database alert log for any RDBMS errors that may have caused the disconnect.
    If there aren't any RDBMS errors logged, you should generate a Net8 trace for the session to see if you can get more detailed errors.
    About sql tracing:
    To obtain a trace, you have to place the following entries in the SQLNet.ORA file. Make sure before you start your application that the C:\Trace directory exist.
    TRACE_FILE_CLIENT = net817
    TRACE_DIRECTORY_CLIENT = C:\trace
    TRACE_UNIQUE_CLIENT = ON
    TRACE_LEVEL_CLIENT = 16
    TRACE_TIMESTAMP_CLIENT = ON
    When finished obtaining both traces, set the TRACE_LEVEL_CLIENT = 0 from 16 to turn off tracing.
    Monica

  • SQL Error 3113 and 3114

    Hi all
    I am getting Sql error 3113, system logs are below:
    i checked tablespaces are having enough space.
    can anybody tell what is this prob
    SQL error 3114 . Work processes in reconnect status       
    SQL error 3113 . Work processes in reconnect status       
    SQL error 3113 . Work processes in reconnect status       
    SQL error 3113 . Work processes in reconnect status       
    Operating system call recv failed (error no. 73 )         
    Perform rollback                                          
    Perform rollback                                          
    Program RM07DOCS manually terminated by user LINFIN       
    Call of function NiRead failed, RC: -006                  
    Work process has left reconnect status                    
    Work process has left reconnect status                    
    Terminal 00046 in status DISC                             
    Perform rollback                                          
    Delete session 003 after error 004                        
    Error calling the central lock handler                    
    Request (type DIA) cannot be processed                    
    > Unable to reach central lock handler                    
    Request (type DIA) cannot be processed                    
    Request (type DIA) cannot be processed                    
    Request (type DIA) cannot be processed                    
    Request (type DIA) cannot be processed                    
    Request (type DIA) cannot be processed

    Hello,
    Well, Is the above error is happening during the offline backup? What is the impact on the system because of the above error? Is any transaction fails?
    The above error could be because of the following
    1. Network issue
    2. wrong client version. If you are SAP Kernel which  is compatible with client 9i, then i suggest to install the latest version of the client. Ofcourse client version shouldn't be more than the version of the oracle server software.
    3. and there could be other possible reasons like some error in the alert log, resource issue.
    Regards,
    Madhukar

  • ORA-06502: PL/SQL error with dimensions and roles

    Hi everyone,
    When executing a mapping that loads a cube we are always getting that ORA-06502: PL/SQL error character string buffer too small
    The cube contains a number of dimensions, some of them with roles. We've checked that the error appears when we use two different lookup operators to fill dimension atributtes in the cube and its correspondent role. If we map dimension attributes with lookup operator, and the role attributes with constants, the mapping executes without any error. Moreover, even thought it doesnt make any sense, if we map the role dimension attributes with a lookup operator linked to a different dimension, it works too.
    We think that this could be due to attributes names, maybe they are too long, but we have tried to make them shorter and still getting the same error.
    Any ideas of what could be happening?
    Thank you so much in advance.

    The return datatype in a PLSQL function is unconstrained. Which means it does not have a size.
    The size is declared on the receiving end.
    What size variable are you trying to return your value into?
    Here is an example...
    SQL>create or replace function my_func
      2  return varchar2
      3  is
      4  begin
      5    return USER;
      6  end;
      7  /
    Function created.
    SQL>declare
      2    my_string varchar2(30);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL>declare
      2    my_string varchar2(3);
      3  begin
      4    my_string := my_func;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 4

  • Error oracle.sql.* and oracle.jdbc.driver.* not found when using oracle as a database

    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama

    Hi Anupama,
    First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
    along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
    These are a few simple things that you should do in your JDBC program:
    1. Import the necessary JDBC classes in your programs that use JDBC.
    For example:
    import java.sql.*;
    import java.math.*;
    2. Register the Oracle driver before before calling other JDBC APIs.
    (This is not needed if you are using the JDBC Server-side Internal
    Driver because registration is done automatically in the server.)
    To register the Oracle driver, make sure the following statement
    is executed at least once in your Java session:
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    3. Open a connection to the database with the getConnection call.
    Different connection URLs should be used for different JDBC
    drivers. The following examples demonstrate the different URLs.
    For the JDBC OCI8 Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:oci8:@<database>",
    "scott", "tiger");
    where <database> is either an entry in tnsnames.ora or a SQL*net
    name-value pair.
    For the JDBC Thin Driver, or Server-side Thin Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@<database>",
    "scott", "tiger");
    where <database> is either a string of the form
    <host>:<port>:<sid> or a SQL*net name-value pair.
    For the JDBC Server-side Internal Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:kprb:");
    Note that the trailing ':' character is necessary. When you use
    the Server-side Internal Driver, you always connect to the
    database you are executing in. You can also do this:
    Connection conn
    = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    Hope this helps,
    Thanks,
    Anupama wrote:
    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama--
    Apurb Kumar

  • MaxDB perl DBI and sql error -4008

    I'm using PERL DBI module to connect to my liveCache instances, as a read-only user, to obtain status of various things.
    I've installed the latest MaxDB DBI modules and latest MaxDB 7.7 Linux runtimes.
    I can successfully connect to a livecache 7.4 instance, but for some reason when I connect to a 7.6 instance I get a DBI error:
    sql error -4008
    failed: POS(1) Unknown user name/password combination
    My code is:
    $dbMAXDB = DBI->connect("dbi:MaxDB:$o_nodename/$o_SID",$maxdb_usr,$maxdb_pwd, \%dbi_attr) or die;
    The above code works with 7.5 etc, but not for my 1 single 7.6 instance!
    The username/pwd is correct, as using dbmcli with the same username/pwd works.
    Has anyone experienced this, or can someone offer a solution?

    Maybe you use the administrator user instead of the SQL user? MaxDB distinguishes between “Administrators” - as we called them - and “SQL users”. The group of “Administrators” (Database Manager operators, DBM operators) is used for the administration of the database only (start, stop, backup etc.) and cannot be used to open a SQL session. So please make sure that the user is a SQL user.
    Also you might check if you will be able to connect to the database with the command line tool sqlcli using this user.
    Regards,
    Marco

  • Install error and PL/SQL error

    Hello,
    I'm new to Oracle. I installed Oracle8iR2 on Redhat Linux 6.2. During installation (more precisely during "Linking Oracle8i Enterprise Edition 8.1.6.1.0") I got this error :
    Oracle: Error in invoking target ioracle of makefile /home/oracle/OraHome/rdbms/lib/ins-rdbms.
    mk
    ORA-124547: TNS: lost contact
    ORA-03114: not connected to Oracle
    I clicked "Ignore" and the installation continued without any other errors.
    After the installation was finished I performed the initial configurations described in the manual as user root and user oracle. After that as user oracle I tried to start plsql like this :
    Enter user-name : system
    Enter password : *******(manager )
    oraclebogdan: error in loading shared libraries libdsbtsh8.so : cannot opeb shared object
    file : No such file or directory
    ERROR : ORA -12547 : TNS : lost contact
    Can you help me to fix the problems?
    Thank you,
    Bogdan Paduraru

    Bidyut Kumar (guest) wrote:
    : Jason Howk (guest) wrote:
    : : Jack Lauman (guest) wrote:
    : : : During the linking process of "./orainst /c", I got the
    : : following
    : : : error on the RDBMS, SQL*PLUS and PL/SQL install:
    : : : /usr/i386-linux/bin/ld: cannot open -lnsl: No such file or
    : : : directory
    : : : make: *** [u01/app/oracle/product/8.0.5/rdbms/lib/oracle]
    : : Error
    : : : 1
    : : : Status: 2
    : : : ((OIERR-SYSTEM: make -f ins_rdbms.mk
    : : : ORACLE_HOME=/u01/app/oracle/product/8.0.5 install))
    : : : --------[ rdbms.ins 2631---------------
    : : : The file in question is nowhere on the disk. Anyone have
    : any
    : : : clues?
    : : : Thanking you in advance for your cooperation,
    : : : Jack Lauman
    : : : nwcascades.com
    : : I get the same error using Slackware 3.6. Anyone have any
    : : clues? FYI, I receive the same error on the standard
    edition
    : as
    : : well.
    : : --Jason
    : Even I have the same problem and unable to find the solution.
    : Why is happening. I have no clue at all.can anybosy anywhere
    : could help?
    : Thanks
    : --Bidyut
    I have a similar problem on Red Hat 5.2. In my case, the
    failing command is:
    Command: make -f ins_plsql.mk install <<!
    The failing portion of that make file is:
    `cat /raid/u01/app/oracle/8.0.5/lib/sysliblist`
    It seems that file (sysliblist) contains the following:
    -lnsl -lm
    So, it appears to be looking for
    /raid/u01/app/oracle/8.0.5/lib/libnsl.a and
    /raid/u01/app/oracle/8.0.5/lib/libm.a
    Neither of those files exist anywhere on my hard disk. This
    appears to be the same problem originally reported, above.
    So far, no clues.....
    ============================================
    By the way, I had an earlier failure during a different make
    where it was trying to compile something and include a header
    file of "sys/types.h" and I fixed it by creating a "sys"
    subdirectory in /usr/include that only had in it a symbolic
    link to the regular "types.h" file.
    null

  • "There are errors in one or more PL/SQL packages and functions"

    Hi all,
    first of all - my configuration:
    - OWB 10.0.3.0
    - one Server HP-UX
    - two oracle database instances (plato and platodev)
    My problem:
    when i try to start "Deployment Manager" and try to connect to the platodev instance i get the RTC-5260 and ORA-01017.
    I have no problems to connect to the second instance "plato".
    The output of service_doctor is as followed:
    ===================
    SQL> @service_doctor
    There are errors in one or more PL/SQL packages and functionsPlatform properties have been loaded correctly
    Platform location has been seeded correctly
    NLS messages have been loaded correctly
    The platform service is available
    There is a problem accessing the service startup script from the databaseserver
    Here is the detailed error message which contains the name of the startscript file:-
    The runtime property 'service_command' either does not exist orcannot be read successfully
    oracle.jdbc.driver.OracleSQLException: ORA-00942:
    table or view does not exist
    Please verify that the disk containing the file is visible to thedatabase server
    Please verify that the database server account has access rights on thefile
    There is a problem with the repository connection information used tostart the service
    Here is the detailed error message which contains the connectioninformation passed to the service:-
    Cannot retrieve the repository owner host, port, service-name fromwithin the database server
    Please verify that this information is accurate
    If this information is correct, then please use the'set_repository_password.sql' script to reset the stored password
    PL/SQL procedure successfully completed.
    ================================0
    I did not change the password.
    Can anyone help me?
    I appreciate your help.
    Thank you

    Solved!
    It was a wrong entry in wb_rt_service_nodes column service_name.

  • Muse cc 2014 - the programme is closing to desktop - different errors i am finding it very unstable - palette errors and _writeSyncCOnn.open ....:SQL error: error

    muse cc 2014 - the programme is closing to desktop - different errors i am finding it very unstable - palette errors and _writeSyncCOnn.open ....:SQL error: error'... connection closed . . . operation:ópen', deatillD:'1001

    also if i copy from a different app then try copy and paste an element in muse cc and paste it the info from the other copy will be pasted in musecc

  • Error msg in Balance Sheet - asking for SQL username and Password

    Hi experts,
    I have observed strange behaviour of SAP B1 8.81 PL 07 in following way.
    On one client PC when I preview standard SAP CR Balance Sheet it asks for SQL user Id and password.
    Where as on the same PC, when I select Vertical option to preview Balance sheet, it works fine. This happens on few PC only, On server it shows both balance sheet option correctly.
    any Idea ?
    Thanking you in advance,
    Samir Gandhi

    Hi Palak.......
    I would suggest you to please Make a new connection of CR with OLE DB SQL Server and then reimport it.......
    And then try to take a preview.....
    Regards,
    Rahul

  • How to trap 1843 error. .nOT Valid month..

    This is in my cursor for loop
    mstart_issue := TO_CHAR(to_date(mstart_issue,'YY-MON'),'Mon.YYYY') ;
                   mend_issue := to_char(to_date(mend_issue,'YY-MON'),'Mon.YYYY');
    But it throws 1843 error..
    i Have execptions for finding value error like
    when value_error then
    warn('value error'||moldmembership);
    But i need something to trap the following error ie ..The moment not a valid month error occurs. .It should trap that error
    Like warn('not validm onth'||membershpnumber)
    What shall be the exeption to catch . .the 1843 error...
    Like we got exceptions like when too many rows to catch duplicate records..
    And this is how my end_issue data looks like .. . 10-jul
    12-Aug date in yy-mon format..
    But seems there is error..
    Kindly help..
    Thanks

    susf wrote:
    Hi Thanks i am implementing both part of code.. Thanks ..
    But ..When i use nls_date_language= 'AMERICAN' I see the output of date in some other language in sql
    The output is like this..
    Loka .2010
    Loka .2010
    Loka .2010
    Loka .2010
    Loka .2010
    Loka .2010
    Loka .2010
    Marras.2010
    Marras.2010
    Marras.2010which line below generates the output above?
    Here is the part of my code
    declare
    msno sub.sno%type;
    e;
    mSTART_ISSUE sub.start_issue%type;
    MEND_ISSUE SUB.END_ISSUE%TYPE;
    MCOMMENTS SUB.COMMENTS%TYPE;
    MPCODE SUB.POSTCODE%TYPE;
    mpay_mode sub.pay_mode%type;
    mrmember sub.rmember%type;
    mflag varchar2(1);
    cursor c1 is select * from htmldb_collections     where collection_name = 'CSV_DATA' and c001 != 'SNO';
    invalid_month exception;
    pragma exception_init( invalid_month, -1843 );
    begin     
    mflag := 'N';
              FOR XXX IN C1
                   LOOP
                   begin
    mrmember := xxx.c023;
    mstart_issue := xxx.c019;
    mend_issue := xxx.c020;
                   BEGIN
    IF SUBSTR ( UPPER (mstart_issue)
         , -3
         ) IN ( 'JAN', 'FEB', 'MAR'
              , 'APR', 'MAY', 'JUN'
              , 'JUL', 'AUG', 'SEP'
              , 'OCT', 'NOV', 'DEC'
    THEN
         MSTART_ISSUE := TO_CHAR(to_date(mstart_issue,'YY-MON','NLS_DATE_LANGUAGE=AMERICAN'),'Mon.YYYY') ;
    mflag := 'Y';
    ELSE
         warn('not valid month startissue ' || moldmembership);
    mflag := 'N';
    END IF;
    IF SUBSTR ( UPPER (mend_issue)
         , -3
         ) IN ( 'JAN', 'FEB', 'MAR'
              , 'APR', 'MAY', 'JUN'
              , 'JUL', 'AUG', 'SEP'
              , 'OCT', 'NOV', 'DEC'
    THEN
         mend_issue := to_char(to_date(mend_issue,'YY-MON','NLS_DATE_LANGUAGE=AMERICAN'),'Mon.YYYY');
    mflag := 'Y';
    ELSE
         warn('not valid month endissue ' || moldmembership);
    mflag := 'N';
    END IF;
    exception
    when invalid_month then
    warn('EXCEPTIONnot valid month xx ' || moldmembership);
    END;
    IF mflag = 'Y' then
                   insert into sub (sno,rno,designation,old,start_issue,end_issue,comments,pay_mode,rmember)
                   values
                   (msno,mrno,mdesignation,moldmem e,maddressedas,madd1,
                   madd2,mcounty,mcity,mstate,mcountry,mph_no,memail,mpostcode,mstart_issue,mend_issue,mco );     
    end if;
    exception
    when value_error then
    warn('value error'||moldmembership);
              end;
    END LOOP;
    END;

Maybe you are looking for

  • Goods Receipt and Amoratization to Internal Orders (CO)

    Dear SAP Gurus - Please could you kindly assist in this matter. Our Production department is unable to upload the plan cost / unit cost to the 1st impression production order number, as stock was received before for the old title. Instead of creating

  • LR1.3 sRAW and Photo Downloader not working?

    Hi, Anyone else having problems with 40D sRAW files? When I import them they have a green cast - even converting to greyscale still leaves them with a green cast. In fact the grey channel in the histrogram display is suddenly green as well. Also, Pho

  • InDesign Links / Path Name change on Mac

    We have 5 Mac users on a windows domain using Adobe CC.  They are placing images in to files as links. They are continually getting the "This document contains a link to a source..." error.  The one commong thing I can find is that when looking at th

  • Strange & first time mail issue, help anyone?

    On .mac account, send mail to one correspondent results in her only seeing subject and nothing in body. Other correspondents from same account have no problems, this is the only person who cannot view. Confirmed in "Sent" Folder, entire message is vi

  • Help with Update a Split Form

    Hi, guys! really really need a help, I'm crazy about this problem, don't have any idea what I need to do. Look,  I have a little base, where I want develop a AIO little system, where the user makes filters or click in some pre-defined filters to get