Dtrace writes in error log

Hi all,
Here is the problem. There is a Soalris host with ZFS. There is some proprietary application which writes its error log. It has been noted that the error messages are not always written immediately, but only after processing some erroneous records. Plus in case of module terminating with SIGTERM, those errors which are still not in the log - they just would be lost, won't be written.
The experiment has been repeated on the different Solaris host with error log placed on local UFS and, second try, on NFS. In both cases error log writes immediately and correctly. So we are inclining to blame ZFS configuration.
I have an access to the "problematic" host and root privileges there. I would not like to restart the process which means I can't use truss. Hence I have a dtrace (in which I'm a nub yet).
Could somebody please give me a hint - which syscalls I should try to monitor to understand what is going on between the application and file system?
Any clue would be deeply appreciated.

Application release: 12.1.2
DB version: 11.2.0.2
OS: Linux 5.6 x86-64
Users can't launch login screen or get hang after input ID and password intermittently after migrate Oracle E-Business R12.1.2 from IBM AIX to Oracle Linux 5.6.
DB logs has errors:
Fatal NI connect error 12170.
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.2.0 - Production
Oracle Bequeath NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Production
Time: 05-SEP-2011 21:29:25
Tracing not turned on.
Tns error struct:
ns main err code: 12535
TNS-12535: TNS:operation timed out
ns secondary err code: 12560
nt main err code: 505
TNS-00505: Operation timed out
nt secondary err code: 110
nt OS err code: 0
Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.36.152.208)(PORT=3763))
But these DB errors doesn't occurred in issue time.
Autoconfig can complete successfully.
Thanks,
Jackie

Similar Messages

  • Write the Error log from background Job to the Spool request

    Hi ,
    I have a situation where in i need to capture the error log of a Z program which runs as a background job and write that log into the spool request. My Z program calls runs RSEINB00 program using the SUBMIT statement. When this Job fails the error log can be seen in SM37. But i need this error log to be sent in to a spool.
    I can read the error log using the BP_JOBLOG_READ FM and can also create a spool using the RSPO_SPOOL_OPEN FM.
    The problem is, when the Submit statement executes, due to internal valdation in the RSEINB00 program the program terminates. Due to this it is not able to perform the SY-SUBRC Check and thus doesn't read the log.
    Can anybody suggest me how to overcome this problem. I am attaching the code for your refernece.
    SUBMIT RSEINB00
           USING SELECTION-SET 'TEST2'
                           TO SAP-SPOOL
                           LIST NAME 'LOCL'
                           IMMEDIATELY space
                           KEEP IN SPOOL 'X'
           AND RETURN.
    <b>If sy-subrc <> 0.</b>           
                 CALL FUNCTION 'BP_JOBLOG_READ'
                  EXPORTING
                    CLIENT                      = SY-MANDT
                    JOBCOUNT                    = i_tbtco-jobcount
                    JOBLOG                      = i_tbtco-joblog
                    JOBNAME                     = i_tbtco-jobname
                   TABLES
                     JOBLOGTBL                   = l_joblog
                 IF SY-SUBRC <> 0.
                 else.
                    message i002 with l_joblog-msgv1.
                 ENDIF.
    <b>
    ENDIF.</b>
    Rgds,
    Kewal
    P.S. : any other approach to solve this problem will be appreciated too and the points will be rewarded suitably.

    If I select a job in SM37 and I click on "spool" I get a list with separate spool entries for each of the steps, e. g.
    Programmname/Kommand   Programmtyp   Spoolliste
    Z_MM_STAT_UPDATE_WERK  ABAP             1707445
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1707459
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_MARA  ABAP             1721423
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1721437
    Z_MM_STAT_UPDATE_MARA  ABAP             1721446
    Z_MM_STAT_UPDATE_WERK  ABAP             1721447
    Z_MM_STAT_UPDATE_VKORG ABAP             1721471
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721521
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721816
    It's in German but I'm sure you get the idea. For each Z_MM_STAT_UPDATE and variant I have a separate spool list that I can display.
    Markus

  • How to write error log while creating invoice and avoid implicite commit

    Hi,
    I've have written code in exit RV60AFZZ in which I check for some possible errors while invoicing via VF01/VF04. If conditions are met then we create error message and display it to the user. As result we had a lot of missing SD invoices in FI when we did batch/mass invoicing. I've opened OSS note and SAP support team wrote that using statement MESSAGE is forbidden in UE. It can lead to implicite commits.
    Do you have some example how to write error log for invoincing in VF01/VF04 transactions?
    Thanks

    @ sri nath. Please read post before answering. I wouldn't be posting trivial questions. As I wrote before it doesn't work.  Also SAP support would not answer to the question in my OSS.
    In VOFM, SAP is using routine  VBFS_HINZUFUEGEN_ALLG to write to error log.
    Mine is something like this in ue:
          PERFORM ZVBFS_HINZUFUEGEN_ALLG
                     USING VBAP-VBELN VBAP-POSNR  'ZSD' 'E '600'
                           SPACE SPACE SPACE SPACE.
    (we have custom message class)
    As result  XVBFS and VBSK are filled with error, but posting is also done.  Error log is filled but invoice is created and posted in FI.
    That is not OK.
    thanks

  • Write error log to Application log

    Hi All ,
    I am new to APO area . I am writing a report in APO and the requirement here is to write the error log to the application log .  Can anyone help explain the process o hot to write the error log to  application log . If possible please help me with some code .
    Thanks ,
    Daniel.

    Hi Daniel,
             Refer the below code for writing the application log.
    .<a href="/people/kamalkumar.ramakrishnan/blog/2007/01/10/a-primer-on-using-and-creating-sap-application-log on Application Log</a>
    Regards,
    Siva.
    Create a Application log
        CALL FUNCTION 'BAL_LOG_CREATE'
          EXPORTING
            i_s_log                 = g_bal_log
          IMPORTING
            e_log_handle            = g_log_handle
          EXCEPTIONS
            log_header_inconsistent = 1
            OTHERS                  = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    loop at g_return.
      g_log_mess-msgty     = g_return-type.
      g_log_mess-msgid     = g_return-id.
      g_log_mess-msgno     = g_return-number.
      g_log_mess-msgv1     = g_return-message.
      g_log_mess-msgv2     = g_return-message_v1.
      g_log_mess-msgv3     = g_return-message_v2.
      g_log_mess-msgv4     = g_return-message_v3.
      g_log_mess-probclass = 'Error Class'.
    appemd g_log_mess.
    endloop.
    add this message to log file
      CALL FUNCTION 'BAL_LOG_MSG_ADD'                          
        EXPORTING
          i_s_msg       = g_log_mess
        EXCEPTIONS
          log_not_found = 0
          OTHERS        = 1

  • ERROR-Logging of Stored Procedure (Stop / Going on after error + logging)

    Hi @all,
    I am using a Stored Procedure which is very simple:
    =>The stored procedure is selecting many tousands of records from table1 + table2.
    => Some values (records) will be summarized (aggregated/group by).
    =>After this selection and summarizing, this records will be deleted from table3 (if they exist in table3).
    =>Then the selected records will be inserted in table3.
    Now I want to do the following:
    Is there a way to log the errors of the stored procedure?
    For example, the stored procedure is copying many thousands of records.
    If there is a problem on copying/ inserting a record to table3, then I want a error-log in a loggin_table.
    Is there a way to write the error-logs from a stored procedure to a special table in database?
    I want to do this in 2 ways:
    1) On error the error is logged and the stored procedure is stopped.
    2) On error the error is logged and the stored procedure is going on to insert/summarize the next record.
    I don't know how I can get these errors of a stored procedure. Maybe it isn't possible? Or is it better to use a function?
    Hope anyone can give me a hint?
    Thanks a lot.
    Best regards,
    Tim

    Hi
    option one:
    as i know you can have another table without primer key (log table).
    then before you insert into table, select the record count using primary key. if it is duplicate then put those record into the table.
    option two:
    write the log into file.
    declare
    f utl_file.file_type;
    s varchar2(200);
    begin
    f := utl_file.fopen('SAMPLEDATA','sample1.txt','R');
    loop
    utl_file.get_line(f,s);
    dbms_output.put_line(s);
    end loop;
    exception
    when NO_DATA_FOUND then
    utl_file.fclose(f);
    end;
    refer : http://www.psoug.org/reference/OLD/utl_file.html
    regards
    upul.
    Edited by: Upul Indika on Apr 9, 2009 12:45 PM

  • Write SharePoint Custom Error logs into physical location

    Hi
       I need to programmatically write a custom error logs using SPDiagnosticsService class into my custom physcial location.
       But when i use SPDiagnosticsService it will write error logs into 15hive\logs folder instead i want to write into my physical location(say C:\Logs\Error.log)
       How to achieve this?
    Regards,
    Siva

    Hi,
    SPDiagnosticsService has a property 'loglocation' and it only points to one location. I reckon, you can not use one location for SharePoint log, another one for custom log - if you use SPDiagnosticsService. What I do for my SharePoint projects is, create
    a custom logger, which wrap the SPDiagnosticsService inside. Then My Logger class write the log into some custom location (configurable through web.config or by other means) as well as pass it to SPDiagnosticsService. Having a custom log file for custom solution
    helps to find problem very quickly and easily - which would be difficult if you would need to go through large log files. So I can suggest, write a custom logger, wrap SPDiagnosticsService  inside the cutom logger. Then on every Log Event, write in your
    cusotm file and if you want you can pass the event to SPDiagnosticsService  also.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • CALDAV server writes constantly too much into error log

    Hi,
    i managed to set up the OS X Server and CALDAV server, everything works fine, events can be synced to devices, macs, etc.
    The firewall (Cisco RV042G) allows only SSL traffic and everythings works fine.
    ... but then I checked the error log:
    2 strange entries are written several times in a minute:
    1. APNProviderFactory#error
    2013-04-25 11:20:47+0200 [-] [notifications] 2013-04-25 11:20:47+0200 [-] [calendarserver.push.applepush.APNProviderFactory#error] Unable to connect to APN server: [Failure instance: Traceback: <class 'socket.gaierror'>: [Errno 8] nodename nor servname provided, or not known
    I can remove this entry if I open the firewall to allow all traffic from my OS X Server machine to ANY
    But I don't like to do so, only open the ports I need.
    Does anybody know, what else needs to be opened from OS X Server to stop this error entry?
    Currently I allow the following outgoing traffic:
    Service
    Port
    Source
    Destination
    SMTP
    25 TCP
    OS X Server
    Any
    IMAP
    143 TCP
    OS X Server
    Any
    Device Enrollment
    1640 TCP
    OS X Server
    Any
    Device Management
    2195 TCP
    OS X Server
    Any
    Push Feedback Service
    2196 TCP
    OS X Server
    Any
    CALDAV SSL
    8443 TCP
    OS X Server
    Any
    CARDDAV SSL
    8843 TCP
    OS X Server
    Any
    2. every 5 seconds I see the following added to the error log:
    2013-04-25 12:16:24+0200 [-] [notifications] 2013-04-25 12:16:24+0200 [-] Starting factory <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3cc128>
    2013-04-25 12:16:24+0200 [-] [notifications] 2013-04-25 12:16:24+0200 [APNProviderProtocol (TLSMemoryBIOProtocol),client] <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3cc128> will retry in 2 seconds
    2013-04-25 12:16:24+0200 [-] [notifications] 2013-04-25 12:16:24+0200 [APNProviderProtocol (TLSMemoryBIOProtocol),client] Stopping factory <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3cc128>
    any idea what needs to be done?
    Thanks a lot for any idea to get the log quiet.
    ~ Markus

    Hi,
    i checked again and found, that TCP 5223 is no longer only associated to iCHAT SSL, it is now associated to Push-Notification.
    I added IN - OUT for TCP 5223 and this seems to help a lot.
    I updated the ports list I'm using - added that traffic is allowed incoming and outgoing to each of the ports (only DNS is outgoing)
    Service
    Port
    In/Out
    In/Out
    SMTP
    25 TCP
    OS X Server
    Any
    IMAP
    143 TCP
    OS X Server
    Any
    Device Enrollment
    1640 TCP
    OS X Server
    Any
    Device Management
    2195 TCP
    OS X Server
    Any
    Push Feedback Service
    2196 TCP
    OS X Server
    Any
    CALDAV SSL
    8443 TCP
    OS X Server
    Any
    CARDDAV SSL
    8843 TCP
    OS X Server
    Any
    Push Notification
    5223 TCP
    OS X Server
    Any
    DNS
    53 UDP
    OS X Server [out only]
    Any
    The messages are no longer written constantly, they are now happing rarely.
    At: 10:46 I got one new entry and the last at:
    2013-04-26 12:13:30+0200 [-] [notifications] 2013-04-26 12:13:30+0200 [APNProviderProtocol (TLSMemoryBIOProtocol),client] <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3c6ea8> will retry in 2 seconds
    2013-04-26 12:13:30+0200 [-] [notifications] 2013-04-26 12:13:30+0200 [APNProviderProtocol (TLSMemoryBIOProtocol),client] Stopping factory <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3c6ea8>
    2013-04-26 12:13:33+0200 [-] [notifications] 2013-04-26 12:13:33+0200 [-] Starting factory <twext.internet.adaptendpoint.LegacyClientFactoryWrapper instance at 0x10b3c6ea8>
    I'm not sure under which circumstances this happens.
    First guess was adding an event or a reminder on an iPhone, but this cannot be verified.
    Maybe this is because I allow only SSL in/out for CARD/CALDAV. I don't know.
    But the log is more or less growing is an expected way.
    So I can check other logs... I think there are some more suspicious growings out there ;-)
    ~ Markus

  • Cannot write to transaction log "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_Audit.log

    Hi friends,
    My server Intelligence Agent (SIA) can not start because the database service "SQLAnywhereForBI" can't start also. I got the following error :
    "I . 08/09 20:35:06. A read failed with error code: (1392), Le fichier ou le répertoire est endommagé et illisible.
    E. 08/09 20:35:06. Fatal error:  cannot write to transaction log "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_Audit.log"
    E. 08/09 20:35:06. unable to start database "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_CMS.db"
    E. 08/09 20:35:06. Error writing to transaction log file
    I. 08/09 20:35:06. Database server shutdown due to startup error "
    inside the database log file.
    Please, can you help me

    I found the solution by following the advice given on the following forum:
    http://evtechnologies.com/transaction-logs-on-sybase-sql-anywhere-and-sap-​​businessobjects-bi-4-1
    In fact, I crushed the BI4_Audit.db and BI4_Audit.log files and I replaced with others that I got from another machine where I installed BO again and where the files are not corrupted . After I logged in to the CMS database by executing the command in the command line:
    dbisql -c "UID = DBA; PWD = mypassword; BI4 Server =; DBF = C: \ Program Files (x86) \ SAP BusinessObjects \ sqlanywhere \ database \ BI4_CMS.db."
    Once connected, I start the command:
    alter database 'C: \ Program Files (x86) \ SAP BusinessObjects \ sqlanywhere \ database \ BI4_Audit.db' alter log off;
    The query runs successfully.
    And that's good, I can be connected to BO smoothly.
    Thank you again Eric

  • Unable to cycle error log due to lock that will not clear

    Hello,
    Currently I'm having an issue with cycling the error log on two SQL Server Instances because the file is being used by another process. Simple I know but, when you try to kill the SPID it becomes hung and we are forced to restart the instance, which I want
    to avoid at all costs. To give you some background we use sqldm for our monitoring of the databases and received a message that our Error log reached its max size threshold and to cycle the error log. When I executed exec sp_cycle_errorlog I'm told the following
    message:
    Msg 17049, Level 16, State 1, Procedure sp_cycle_errorlog, Line 9
    Unable to cycle error log file from 'J:\MSSQL10.SQL6\MSSQL\Log\ERRORLOG.1' to 'J:\MSSQL10.SQL6\MSSQL\Log\ERRORLOG.2' due to OS error '32(The process cannot access the file because it is being used by another process.)'. A process outside of SQL Server may be
    preventing SQL Server from reading the files. As a result, errorlog entries may be lost and it may not be possible to view some SQL Server errorlogs. Make sure no other processes have locked the file with write-only access."
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    Then I ran the following query in instance A and found that sqldm had a active process.
    SELECT *
    FROM sys.dm_exec_requests a
    OUTER APPLY sys.dm_exec_sql_text(a.sql_handle) b
    WHERE session_id > 50
    and session_id <> @@spid AND( text = 'xp_readerrorlog'  OR  text = 'sp_cycle_errorlog')
    ORDER BY start_time a
    Like I said before when I kill the SPID it became hung and remains in a rollback state (the process is not rolling back). My co-worker had this issue before on this same instance and contacted Idera for support, here was their response "The development
    team provided an update regarding this case. After reviewing the code, SQLdm only reads the SQL logs information in each collection and does not lock this resource. Given the behavior that you described,  this could be a problem of SQL Server 2008"
    I believe they're right because we're only seeing this in these two instances. All other instances using sqldm are not reporting this problem which leads me to believe it is MS SQL Server causing it. This is where I'm stuck and that is trying to find out why
    there is a lock on this file and for what reason. I used Process explorer yesterday to search for any processes that are using ERRORLOG through the Find DLL and Handle window and there were mulitple processes touching this file. When I looked today I'm seeing
    now locks for this file and I still cannot cycle the error log. I ran the slect query above I'm still seeing sqldm SPID in both instances. I'm curious to see if anyone else has had this issue before whether they used sqldm or not. Any information will be helpful
    in tracking this issue down.
    Thank you in advance.
    Process Explorer Search Results
    Instance A
    Instance B

    Hi,
    Generally, I use Process Explorer to find out which process is blocking the SQL Server from cycling the error log file. Open search box for ‘errorlog’ or dentify the entries with Handle or DLL as ‘your error log path’. There could be two
    or more processes relating to that. One of them should be ‘sqlservr.exe’, and the others should be the culprits. Verify the process, and try to terminate it and then you should be able to run the stored procedure ‘sp_cycle_errorlog’ to cycle the
    error log without restarting the SQL Server.
    According to the images, there is no process found. I suggest you start the monitor and launch procexp.exe tool again and see if it makes any difference this time. If still no progress, I think you cannot avoid restating.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Creation of error log  on input data  and stat report

    I am doing call transaction on <b>C202</b> transaction.my client asked me before uploading the file he needs some validations on input file and he is asking me to create  a log for all the validations.i have to place error lof for all the input data.
    •An error log will record all errors occurring during upload. For each error the list should
    contain the data (line) going in error and an error text in a subsequent column (subsequent to data). The change number used to perform  the upload will be stated in the header of the error list.A txt-file containing the error log will get the same name as the input file, but with an ending –err.xls.
    Therefore no Batch-Input-Session is needed.
    • After execution of the batch input program, the following analysis regarding execution will be shown:
    o Number of records in input file (including title, first line)
    o Number of records successfully updated
    o Number of records in error
    Example:
    Number of records in input file (incl. first line) 4
    Number of records successfully updated:   3
    Number of records in error:      0
    How to do this according to client  requirements.can u help me to get a statastical way to represent errors.  Send me some smpale code for number of errors and no records gets success and no of failed.
    Thanks
    chandrasekhar

    Hai Chandrasekhar
    Go through the following Code
    report Z_CALLTRANS_VENDOR_01
    no standard page heading line-size 255.
    Generated data section with specific formatting - DO NOT CHANGE ***
    data: begin of it_lfa1 occurs 0,
    KTOKK like lfa1-ktokk,
    NAME1 like lfa1-name1,
    SORTL like lfa1-sortl,
    LAND1 like lfa1-land1,
    end of it_lfa1.
    End generated data section ***
    data : it_bdc like bdcdata occurs 0 with header line.
    *DATA: IT_MESSAGES TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.
    *DATA: LV_MESSAGE(255).
    data : it_messages like bdcmsgcoll occurs 0 with header line.
    data : V_message(255).
    data : V_flag.
    data : V_datum1 type sy-datum.
    data : begin of it_mesg occurs 0,
    message(100),
    end of it_mesg.
    *V_datum1 = sy-datum-1.
    parameters : P_Sess like APQI-GROUPID.
    start-of-selection.
    perform Get_data.
    *perform open_group.
    loop at it_lfa1.
    perform bdc_dynpro using 'SAPMF02K' '0100'.
    perform bdc_field using 'BDC_CURSOR'
    'RF02K-KTOKK'.
    perform bdc_field using 'BDC_OKCODE'
    '/00'.
    perform bdc_field using 'RF02K-KTOKK'
    it_lfa1-KTOKK.
    perform bdc_dynpro using 'SAPMF02K' '0110'.
    perform bdc_field using 'BDC_CURSOR'
    'LFA1-LAND1'.
    perform bdc_field using 'BDC_OKCODE'
    '=UPDA'.
    perform bdc_field using 'LFA1-NAME1'
    it_lfa1-name1.
    perform bdc_field using 'LFA1-SORTL'
    it_lfa1-sortl.
    perform bdc_field using 'LFA1-LAND1'
    it_lfa1-land1.
    call transaction 'XK01' using it_bdc
    mode 'N'
    update 'S'
    messages into it_messages.
    if sy-subrc <> 0.
    if V_flag <> 'X'.
    perform open_group.
    V_flag = 'X'.
    endif.
    perform bdc_transaction. "using 'XK01'.
    endif.
    perform format_messages.
    refresh : it_bdc,it_messages.
    endloop.
    if V_flag = 'X'.
    perform close_group.
    endif.
    *& Form Get_data
    text
    --> p1 text
    <-- p2 text
    FORM Get_data .
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = 'C:\srinu_vendor.txt'
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = it_lfa1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " Get_data
    *& Form bdc_dynpro
    text
    -->P_0061 text
    -->P_0062 text
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR it_BDC.
    it_BDC-PROGRAM = PROGRAM.
    it_BDC-DYNPRO = DYNPRO.
    it_BDC-DYNBEGIN = 'X'.
    APPEND it_BDC.
    ENDFORM.
    Insert field *
    FORM BDC_FIELD USING FNAM FVAL.
    CLEAR it_BDC.
    it_BDC-FNAM = FNAM.
    it_BDC-FVAL = FVAL.
    APPEND it_BDC.
    ENDFORM.
    *& Form format_messages
    text
    --> p1 text
    <-- p2 text
    FORM format_messages .
    loop at it_messages.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = it_messages-MSGID
    LANG = 'EN'
    NO = it_messages-MSGNR
    V1 = it_messages-MSGV1
    V2 = it_messages-MSGV2
    V3 = it_messages-MSGV3
    V4 = it_messages-MSGV4
    IMPORTING
    MSG = V_message
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write : / V_message.
    clear : V_message.
    endloop.
    ENDFORM. " format_messages
    *& Form open_group
    text
    --> p1 text
    <-- p2 text
    FORM open_group .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    GROUP = P_Sess
    HOLDDATE = V_datum1
    KEEP = 'X'
    USER = SY-UNAME
    IF SY-SUBRC = 0.
    write : / 'Session Creating wit Name : ',P_Sess.
    ENDIF.
    ENDFORM. " open_group
    *& Form close_group
    text
    --> p1 text
    <-- p2 text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDFORM. " close_group
    *& Form bdc_transaction
    text
    -->P_0132 text
    FORM bdc_transaction. "USING VALUE(P_0132).
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = 'XK01'
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    SIMUBATCH = ' '
    CTUPARAMS = ' '
    TABLES
    DYNPROTAB = it_bdc
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " bdc_transaction
    Regards
    Sreeni
    Message was edited by: Sreenivasulu Ponnadi

  • Wait on the Database Engine recovery handle failed. Check the SQL server error log for potential causes in SQL Server 2012 Developer Edition

    I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all
    gave same error. I browsed msdn blog. But nothing help me out.
    Below is the error log details--
    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2061893606
      Start time:                    2013-10-21 12:58:05
      End time:                      2013-10-21 13:52:30
      Requested action:              Install
    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for RS:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for DQ:              Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for FullText:        Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
    Machine Properties:
      Machine name:                  CROY-TOSH
      Machine processor count:       4
      OS version:                    Windows 7
      OS service pack:               Service Pack 1
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No
    Product features discovered:
      Product              Instance             Instance ID                    Feature                
                     Language             Edition              Version         Clustered 
    Package properties:
      Description:                   Microsoft SQL Server 2012 Service Pack 1
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         C:\Users\CRoy\Downloads\SQL Server 2012 Developer Edition (x86 and x64) - DVD (English)\x64\setup\
      Installation edition:          Developer
    Product Update Status:
      None discovered.
    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 NT Service\SQLSERVERAGENT
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Backup
      ASCOLLATION:                   Latin1_General_CI_AI
      ASCONFIGDIR:                   C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Config
      ASDATADIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Data
      ASLOGDIR:                      C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  NT Service\MSSQLServerOLAPService
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            CRoy-TOSH\CRoy
      ASTEMPDIR:                     C:\Program Files\Microsoft SQL Server\MSAS11.MSSQLSERVER\OLAP\Temp
      BROWSERSVCSTARTUPTYPE:         Disabled
      CLTCTLRNAME:                   ROY
      CLTRESULTDIR:                  C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\ResultDir\
      CLTSTARTUPTYPE:                Manual
      CLTSVCACCOUNT:                 NT Service\SQL Server Distributed Replay Client
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 C:\Program Files (x86)\Microsoft SQL Server\DReplayClient\WorkingDir\
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
      CTLRSTARTUPTYPE:               Manual
      CTLRSVCACCOUNT:                NT Service\SQL Server Distributed Replay Controller
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     CRoy-TOSH\CRoy
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                true
      FEATURES:                      SQLENGINE, REPLICATION, FULLTEXT, DQ, AS, RS, RS_SHP, RS_SHPWFE, DQC, BIDS, CONN, IS, BC, SDK, BOL, SSMS, ADV_SSMS, DREPLAY_CTLR, DREPLAY_CLT, SNAC_SDK, MDS
      FILESTREAMLEVEL:               2
      FILESTREAMSHARENAME:           MSSQLSERVER
      FTSVCACCOUNT:                  NT Service\MSSQLFDLauncher
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      IACCEPTSQLSERVERLICENSETERMS:  false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             <empty>
      INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
      INSTANCEID:                    MSSQLSERVER
      INSTANCENAME:                  MSSQLSERVER
      ISSVCACCOUNT:                  NT Service\MsDtsServer110
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         false
      QUIETSIMPLE:                   false
      ROLE:                          <empty>
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              SharePointFilesOnlyMode
      RSSVCACCOUNT:                  NT Service\ReportServer
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         *****
      SECURITYMODE:                  SQL
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  Latin1_General_CI_AI
      SQLSVCACCOUNT:                 NT Service\MSSQLSERVER
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           CRoy-TOSH\CRoy
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      TCPENABLED:                    0
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false
      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\ConfigurationFile.ini
    Detailed results:
      Feature:                       Management Tools - Complete
      Status:                        Passed
      Feature:                       Client Tools Connectivity
      Status:                        Passed
      Feature:                       Client Tools SDK
      Status:                        Passed
      Feature:                       Client Tools Backwards Compatibility
      Status:                        Passed
      Feature:                       Management Tools - Basic
      Status:                        Passed
      Feature:                       SQL Server Data Tools
      Status:                        Passed
      Feature:                       Reporting Services - Native
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred during the setup process of the feature.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Data Quality Services
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Full-Text and Semantic Extractions for Search
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       SQL Server Replication
      Status:                        Failed: see logs for details
      Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
      Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
      Component name:                SQL Server Database Engine Services Instance Features
      Component error code:          0x851A001A
      Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
      Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.3128.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026
      Feature:                       Master Data Services
      Status:                        Passed
      Feature:                       Distributed Replay Client
      Status:                        Passed
      Feature:                       Distributed Replay Controller
      Status:                        Passed
      Feature:                       Integration Services
      Status:                        Passed
      Feature:                       Data Quality Client
      Status:                        Passed
      Feature:                       Analysis Services
      Status:                        Passed
      Feature:                       Reporting Services - SharePoint
      Status:                        Passed
      Feature:                       Reporting Services Add-in for SharePoint Products
      Status:                        Passed
      Feature:                       SQL Browser
      Status:                        Passed
      Feature:                       Documentation Components
      Status:                        Passed
      Feature:                       SQL Writer
      Status:                        Passed
      Feature:                       SQL Client Connectivity
      Status:                        Passed
      Feature:                       SQL Client Connectivity SDK
      Status:                        Passed
    Rules with failures:
    Global rules:
    Scenario specific rules:
    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131021_125116\SystemConfigurationCheck_Report.htm

    Hi,
    This 3rd time I followed this link. But nothing new, same error.
    Can you please tell me how to do follow, I cannt do the 1st step, how to change the local system to windows level account, vice-versa. It is shown mine as
    Server Configuration Manager(Local) 
    From here I folllowed the steps ---[I cannt insert link/image :-(]
    SQL 2008/R2 setup fails with "Wait on the database engine recovery handle failed" 
    If I right clicked on SQL Server Service, there is no option to change the account. 
    Hello,
    Thanks for your patience,did you tried stesp mentioned in below article
    http://blogs.msdn.com/b/sqljourney/archive/2012/03/16/sql-2008-r2-setup-fails-with-quot-wait-on-the-database-engine-recovery-handle-failed-quot.aspx
    To resolve it, follow these steps:-
    When the installation throws this error, click on OK and allow it to proceed. It will fail for Database Engine, but the SQL Server service should have
    been created. Check the Services console.
    If the service is present, perform the following steps:-
    1. Go to SQL Server Configuration manager, right click on the SQL Server service, and change the service account (if it is local system, give
    it a windows level account, and vice-versa). It might throw a WMI error but you will see the account getting updated anyway. If not, then use the Services console. Change the account for SQL Agent as well.
    Use this link to change sql server service account
    http://technet.microsoft.com/en-us/library/ms345578.aspx
    2. Next, try to start the service. It should come online.
    3. However, you will not be able to log in to the SQL Server
    4. Now stop the service and start it from the command prompt using -m -c -T3608 parameters.
    5. Now try logging in to the server using admin connection from sqlcmd (sqlcmd admin:<server name>\<instance name> ...)
    6. Once logged in, use the sp_addsrvrolemember '<domain\username>','sysadmin'.
    Also add the builtin/administrators to the sysadmin role
    7. Now stop the service from the command prompt and start it from SQL Server configuration manager
    You should be able to log in to the server now.
    Hope this helps someone.
    Please revert if it helps or even if it does not
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Error logs on 1760 router

    Hi All,
    I am getting the below error logs in my one of my router 1760, i found in some blogs that if no cable connected in WIC then the router is reporting the following fault on the console line and it happens every 1 minute like the device is being polled but doesn't respond.
    But here cables were connected into Serial and Ethernet interfaces, still i am getting the below errors.
    Is anybody experinced with this problem, can someone help me please.
    Aug 14 05:30:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:31:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:32:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:33:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:34:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:35:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:36:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:37:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:38:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:39:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    Aug 14 05:40:04: %PQUICC_ETHER-1-LOSTCARR: Unit 0, lost carrier. Transceiver problem?
    #x
    Interface IP-Address OK? Method Status Prot ocol
    FastEthernet0/0 10.xx.xx.xx YES NVRAM up up
    Serial0/0 unassigned YES NVRAM up up
    Serial0/0.22 172.20.x.xxx YES NVRAM up up
    Ethernet1/0 10.xx.xxx.x YES NVRAM up down
    Loopback0 172.20.xxx.xxx YES NVRAM up up
    #sh ver
    Cisco Internetwork Operating System Software
    IOS (tm) C1700 Software (C1700-IPBASE-M), Version 12.3(6b), RELEASE SOFTWARE (fc1)
    Copyright (c) 1986-2004 by cisco Systems, Inc.
    Compiled Thu 20-May-04 00:20 by dchih
    Image text-base: 0x80008120, data-base: 0x80C73B38
    ROM: System Bootstrap, Version 12.2(7r)XM2, RELEASE SOFTWARE (fc1)
    CE-NUK-RG uptime is 38 weeks, 6 days, 5 hours, 36 minutes
    System returned to ROM by power-on
    System restarted at 00:33:21 UTC Sat Nov 15 2008
    System image file is "flash:c1700-ipbase-mz.123-6b.bin"
    cisco 1760 (MPC860P) processor (revision 0x500) with 55597K/9939K bytes of memory.
    Processor board ID FOC08202N33 (114859209), with hardware revision 0000
    MPC860P processor: part number 5, mask 2
    Bridging software.
    X.25 software, Version 3.0.0.
    1 Ethernet/IEEE 802.3 interface(s)
    1 FastEthernet/IEEE 802.3 interface(s)
    1 Serial(sync/async) network interface(s)
    32K bytes of non-volatile configuration memory.
    32768K bytes of processor board System flash (Read/Write)
    Configuration register is 0x2102
    Regards,
    Naidu.

    By the look of your "sh ip int bri" it is for the Eth1/0 interface not your serial.
    What's plugged into the other end of that link? Have you checked it is the correct encapsulation? eg if it is a trunk, are both sides configured to be a trunk (and also both isl or dot1q)?
    If it is going to a switch have you checked port security? (it may have autorecover set for 1 min which is why it keeps flapping).....
    Could also be a break in the cable which causes it to be unidirectional and UDLD may be brinking it down?

  • Error logging problem:

    error logging problem:
    I would like to implement an error logger that will do the following tasks when a error/exception arrises:
    - surpress the DacfErrorPopupLogger
    - alert the user that an error has occured with a simplified popup (create a global listener then use the ErrorAttributes to create the text of the popup)
    - log the error in a file with a timestamp and all error information
    - later if the above works....i would like to add the error attributes (time stamp, error type) to a oracle object/ Jdev domain.
    Questions:
    What is the best technique to use....errorManager, error logger ...?? combination
    How do i use the error manager to register listners for the errors?.
    In the following code i am not sure how to access the ErrorsAttributes[] array that is returned by loggerReader.getErrors();
    Any general tips places to find sample code on errorManager or associated interfaces, will be appreciated
    I used the OutPutStreamLogger to write error information to a FileOutputStream then a loggerReader to get the error attributes from the file. The reason i went in this direction is because i found some smple code on the outputStream logger.
    package DACVideo;
    import oracle.dacf.util.errorloggers.*;
    import oracle.dacf.util.errormanager.*;
    import oracle.dacf.util.errorloggers.InputStreamLoggerReader.ErrorAttributes;
    import java.io.*;
    * A Class class.
    * <P>
    * @author Adam Maddox
    public class ErrorLogger extends Object {
    static OutputStreamLogger logger = null;
    static InputStreamLoggerReader loggerReader = null;
    public ErrorLogger() {
    System.out.println("==============ErrorLogger Created==============");
    //remove default error logger (popup logger)
    ErrorManager.removeErrorLogger(ErrorManager.findLoggerByName(DacfErrorPopupLogger.NAME));
    try
    logger = new OutputStreamLogger(new FileOutputStream("out.dat"));
    loggerReader = new InputStreamLoggerReader(new FileInputStream("out.dat"));
    catch(java.io.IOException e)
    System.err.println("Error!");
    try
    ErrorManager.addErrorLogger(logger);
    catch(NameAlreadyRegisteredException e)
    System.err.println("A Logger with this name is already registered.");
    private void closeErrorLog()
    //close the OutputStream, to force flushing
    logger.closeOutputStream();
    ErrorManager.removeErrorLogger(logger);
    public static void showErrorLog()
    ErrorAttributes[] errorArray = loggerReader.getErrors(); <<<<CANNOT GET ERROR ATTRIBUTES ??
    null

    JDev could you help??

  • DML Error Logging Tables?

    How can I use DML Error Logging Tables with OWB10gR2 (in tab-definition and mappings)?
    btw: what really is a shadow-table?

    Hi,
    What you can do to solve this is to add a Pre-mapping to your mapping which calls a procedure that alters the constraint on the target table in which you use the "EXCEPTIONS INTO <error_table> " clause.
    like:
    PROCEDURE "ENABLE_CONSTR_WITH_EXCEPTIONS"("P_TABLE" IN VARCHAR2,  "P_CONSTRAINT" IN VARCHAR2) IS
    v_table            varchar2(30) := p_table;
    v_constraint          varchar2(30) := p_constraint;
    v_command           varchar2(200);
    e_CannotValidate      exception;
    PRAGMA EXCEPTION_INIT(e_CannotValidate, -2437);
    -- main body
    BEGIN
    /* Enable Constraint and write error into exception table */
      BEGIN
        v_command := 'ALTER TABLE ' || v_table || ' ENABLE CONSTRAINT '|| v_constraint ||' EXCEPTIONS INTO exceptions';
        execute immediate (v_command);
        commit;
      END;
        EXCEPTION
            WHEN e_CannotValidate THEN
               -- In my case when Unique Constraints are violated I will delete the duplicates.
               DELETE_DUPLICATES(v_table, v_constraint);
            WHEN OTHERS THEN
                NULL;  -- enter any exception code here
    END;
    -- End of ENABLE_CONSTR_WITH_EXCEPTIONS;Greetz,
    Ilona Tielke

  • Error Logging

    I have created an error logging procedure for my application and i am using it in all my procedures.
    WHEN OTHERS THEN
    sp_log_error(...);
    RAISE;
    However, I want it to log the exception only in case the exception has been raised in the current proc and not re-raised from the child proc. Can I write my exception block in such a way that it will log the only those errors which occured in the current proc and not in the child proc, as the child proc will itself be logging that exception.
    I am not using DBMS_UTILITY.FORMAT_ERROR_BACKTRACE in my parent program because a proc can be called inside another proc as a child and can be called individually.

    You can raise a custom exception
    -- Pick a number between 20001 and 20999.  The TRUE for the third parameter adds the exception to the error stack
      RAISE_APPLICATION_ERROR( -20001, 'This is my custom error message.  I logged the other exception.', TRUE );You can catch that custom exception
      <<existing variable definitions>>
      my_custom_exception EXCEPTION;
      PRAGMA EXCEPTION_INIT( my_custom_exception, -20001 );
    BEGIN
      <<your procedure logic>>
    EXCEPTION
      WHEN my_custom_exception THEN
        RAISE;
      WHEN others THEN
        <<log error>>
        RAISE_APPLICATION_ERROR( -20001, 'This is my custom error message.  I logged the other exception.', TRUE );
    END;Justin

Maybe you are looking for