How identify the query which cause a SERVERERROR?

Hi,
Can I identify the query which called the trigger SERVERERROR?
I need this because we have a error in our log, and we can not identify the cause.
Thanks,
Everson

Michaeles,
The problem is here:
for i in 1 .. ora_sql_txt (v_sql_text)
Take a look in my trigger code.
CREATE OR REPLACE TRIGGER "LOG_ERRORS" AFTER SERVERERROR ON DATABASE
declare
v_osuser VARCHAR2(30);
v_machine VARCHAR2(64);
v_username VARCHAR2(30);
v_program VARCHAR2(64);
v_error VARCHAR2(1000);
v_sql_text ora_name_list_t;
v_sql CLOB;
v_test varchar2(4000) := 'A';
BEGIN
select osuser, machine, program, username into v_osuser, v_machine, v_program, v_username
from v$session
where audsid = userenv('SESSIONID') and rownum =1;
v_test := v_test||'B';
begin
for i in 1 .. ora_sql_txt (v_sql_text)
loop
v_test := v_test||'C';
v_sql := v_sql || v_sql_text (i);
end loop;
v_test := v_test||'D';
exception
when others then
v_test := v_test||'E';
v_test := v_test||'F'||substr(sqlerrm,1,100);
end;
v_test := v_test||'G';
v_error := DBMS_UTILITY.FORMAT_ERROR_STACK;
insert into everson.log_erros_bd(data,osuser,machine,username,program,erro,sql)
values(sysdate,v_osuser,v_machine,v_username,v_program,v_error||'-'||v_test,v_sql);
exception
when others then -- null;
insert into everson.log_erros_bd(data,osuser,machine,username,program,erro,sql)
values(sysdate,'ERRO '||v_osuser,v_machine,v_username,v_program,DBMS_UTILITY.FORMAT_ERROR_STACK,v_test);
END;
The v_test variable is only for debug, and after the error it contains:
ORA-04043: object mensagem does not exist
-ABEFORA-06502: PL/SQL: numeric or value error
ORA-04043: object mensagem does not existG
How you can see, the v_test jump to 'B' to 'E', jumping the debugs in loop, 'C' and 'D', and in exception I get the message 'ORA-06502: PL/SQL: numeric or value error'.
Any idea?

Similar Messages

  • How to find out the line which caused the runtime error in a SP?

    We have a situation like this.
    We are consulting company doing consultancy services on Oracle technologies.
    One of our clients have PL/SQL stored package.
    We found out by debugging the Oracle Forms front-end application that
    error is generated by a procedure inside this package.
    Problem is that this procedure has over 6000 lines.
    How do we figure out the line which caused the error?
    We tried putting messages in between, but not have been successful.
    Any help would be greatly appreciate.

    How do we figure out the line which caused the error?
    We tried putting messages in between, but not have been successful.
    What does that mean exactly?
    Typically you would instrument the code (especially for multi-step ETL/transform processes) to capture/log key information.
    Also, key sections of code would also be in their own BEGIN/EXCEPTION/END block so that you would know what block caused the exception.
    step_num NUMBER; -- what step is being executed?
    BEGIN
      step_num := 1;
      . . . do something
      step_num := 2;
      . . .  do something else
    EXCEPTION
      -- when you get here the 'step_num' variable will have the number of the step that caused the exception. Log it and then handle/reraise it.
    END;

  • When Firefox freezes, how can I shut it down, and re-start it without it automatically going to the site which caused the problem in the first place ?

    I have Firefox set so that when I start up, I have it set so that it automatically goes to my home page. However when it freezes, which it does on a daily basis, and I have to shut it down and re-start, it automatically goes to the site which caused the problem in the first place.
    If I was a hacker, I would probably find it quite fun to design a virus to reintroduce bugs after they had been exterminated - except that Firefox seem to have got there first.

    Here's how:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''sess''' and pause while the list is filtered
    (3) Double-click the '''browser.sessionstore.max_resumed_crashes''' preference and enter 0 (that's a zero) and click OK.
    When Firefox resumes after a crash, instead of resuming automatically, it will display a list of your previous windows and tabs and you can deselect problem pages.
    (This assumes it wasn't a private browsing session.)

  • How does the query function on a Infoset?

    Hi Gurus,
    I have 3 ODS(GL ODS,Purchasing item,Purchasing Schedule Line).I have built an infoset on these ods.
    Now my question is :
    1)When i run a query on the infoset,what does the OLAP processor do?
    The GL ODS is on the left hand side in Infoset and other 2 ODS are being joined with a left outer join.Does this mean that the OLAP processor goes into GL ODs first and then looks for corresponding records (in the Pur ODS) based on the Join conditions.
    Please Advice
    thanks in advance

    Hi Adam/Ashwin,
    sorry for the late reply.I have another question.
    In the same scenario,i have my infoset below a multiprovider and the selection parameters i have chosen are only available in FI-GL ODS.
    Like i have chosen Ccompany Code and Fiscper as the selection parameters on the query,which are available only on FI-GL ods.
    How would the OLAp processor behave in this scenario,please explain?
    Ashwin,when i am using the Infoset the keyfigures are match.its that iw ould like to know how the OLAP processor fnctions?
    thanks in advance

  • How identify the data is client level,plant level or company code level

    Dear sirs,
    GM
    How identify the data is client level,plant level or company code level?
    If there is any T.code for same in SAP plz send me otherwise any procedure?
    Hopeeeeeeeeee....

    Hi,
    Once you gain experience, you will not look at any table any field or any view...You will do it just like how you use keyboard once you pass type writing....
    That is why every area of work, including master data is handed over to specialized teams...that will be their work day in and out....for some one newly entering, it will be little bit tough...once you practice, you will not be worried any more.  Of course, basic data at client level, purchasing data plant level etc...some thumb rules are there...still, you will take big blow by following such thumb rules because if you verify storage condition assigned in the storage location is not storage location level!!!!!!!!!!!!!!!
    that is experience!!  In this forum, it is good to practice rewarding...else, there may not be any more replies
    Good Luck
    Message was edited by:
            Gopala Turaga

  • How to identify the SQLs which are using the tables and new columns

    Hi
    I m using oracle 10G Database in windows. Developers have added some columns in some of the database tables and were asking to check whether there is some impact on performance or not. I have not done this performance tuning before. Kindly help me how to proceed further.
    How to obtain the sqls which are touching the tables and the new columns? It would be really great if you can help me with this.
    Thanks

    You can try to use DBA_DEPENDENCIES to get PL/SQL objects using tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#i1576452.
    However if SQL code is not stored in database in a trigger, a procedure, a function, a package or a view, it is impossible to retrieve all SQL code referencing some table from database dictionary: for this you would have to analyze application source code.

  • How does the query decide which Infoprovider to fetch data from

    Hi,
    Could somebody please explain what steps go on in background to enable the query to decide which Infoproviders it should fetch data from in a multiprovider.Assuming that in the multprovider we have some  infocubes that  are logically partitioned by Fiscal Year  and other cubes that are not.
    Thanks VK..

    Does the RRKMULTIPROVHINT technique work in case of a multiprovider that is not homogenous... Also in case there are 5 infocubes, does the select query run on fact table of all infocubes or are select queries run initially on the dimension tables and based upon which infocube has the required data for the query the fact table is queried..
    Thanks

  • How to check the query, which had run how many times in a year?

    <Moderator Message: ok, subject is better now but you didn't search at all. Therefore thread is locked again>
    Hi All,
    I want to check the Query statistics like it had run how many times in a year?
    Regards,
    Kiran
    Edited by: Siegfried Szameitat on Dec 9, 2008 11:55 AM

    Hi Kiran,
    please follow the below steps
    1. Create a query for that purpose
    2. Make use of BW Statistic InfoProvider 0BWTC_C02
    3. in Col: Key Figure:0TCTNAVCTR
    4. in Row: 0TCTQUERY (select a variable 0TCTQUYS)
    5. in Filter: BW System( 0TCTSYSID) [give yr source system name whether its production/quality)
    6. in Free char you can give calmonth/year  or user if want to do so.
    save and execute the query
    you will be asked for input the query name
    As output you will be getting count (as many times query is hit by all users since the time it was created)
    if you give date and user name then it will display the count accordingly.
    Hope it Clarifies you.
    Thanks & Regards
    Nagaraju.V

  • How to build query which list only active PC's

    Hi guys,
    I have to install SCCM client on many devices in my enviroment. Unfortunately, SCCM has found amny devices which still have accounts in AD but are not used for looong time. I would like to list only devices, which hasen't installed SCCM client yet but are
    active in my enviroment. 
    That is possible? If yes, that will be glad to hear how build this query.
    Thank you.

    If you don't want those not used devices, why don't you stop discovering them. In the
    Active Directory System Discovery there is a tab Options
    in which you can configure to not discover computers account that have not been used.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Undo_tablespace and undo_retetion or tune the query  which one to increase

    hi all,
    In my logs file s
    ORA-01555 caused by SQL statement below (SQL ID: 9nc0n06yryhbk, Query Duration=165122 sec, SCN: 0x05ff.062f3363):
    Tue Feb 5 02:26:39 2008
    SELECT /*+ FIRST_ROWS */ /*+ ORDERED */ B.GID ,K.ELEMENT_TYPE ,K.DATA_SOURCE_GID ,K.PROD_ID ,K.OPTION_CD ,K.MCC ,K.SPN ,K.REGION_CD ,K.WW_CD ,K.COUNTRY_CD ,K.ERROR ,B.GBATCH_ID
    ,B.PERIOD_SEQ_NUM ,B.ACTION ,B.ERROR B_ERROR ,B.COST ,B.INPUT_FILE_ROW_NUM ,B.ACTION_STATUS ,B.ACTION_TIMESTAMP FROM T_INPUT_BUCKET B, T_COS_INPUT_KEY K WHERE B.ACTION_STATUS =
    'initial' AND B.GINPUT_KEY_ID = K.GID AND B.GBATCH_ID = :B1 AND ROWNUM < 8001
    Tue Feb 5 02:35:21 2008
    Thread 2 advanced to log sequence 42907
    Mon Feb 4 09:10:55 2008
    ORA-01555 caused by SQL statement below (SQL ID: 9nc0n06yryhbk, Query Duration=104081 sec, SCN: 0x05ff.05ebc008):
    Mon Feb 4 09:10:55 2008
    SELECT /*+ FIRST_ROWS */ /*+ ORDERED */ B.GID ,K.ELEMENT_TYPE ,K.DATA_SOURCE_GID ,K.PROD_ID ,K.OPTION_CD ,K.MCC ,K.SPN ,K.REGION_CD ,K.WW_CD ,K.COUNTRY_CD ,K.ERROR ,B.GBATCH_ID
    ,B.PERIOD_SEQ_NUM ,B.ACTION ,B.ERROR B_ERROR ,B.COST ,B.INPUT_FILE_ROW_NUM ,B.ACTION_STATUS ,B.ACTION_TIMESTAMP FROM T_INPUT_BUCKET B, T_COS_INPUT_KEY K WHERE B.ACTION_STATUS =
    'initial' AND B.GINPUT_KEY_ID = K.GID AND B.GBATCH_ID = :B1 AND ROWNUM < 8001
    Mon Feb 4 09:14:08 2008
    ===============================================
    and my undo_retention
    Current usage:
    UNDO_01 96736 11596 12 88
    UNDO_02 96736 9357 10 90
    NAME TYPE VALUE
    undo_management string AUTO
    undo_retention integer 36000
    can anyone please guide me which one is best to increase undo_retention or undo_tablespace
    or tune the query?
    my database version is
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
    PL/SQL Release 10.2.0.2.0 - Production
    "CORE     10.2.0.2.0     Production"
    TNS for HPUX: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    thanks in advance

    IMO best is to
    1) tune the query to minimize time and resource use;
    2) set the undo_retention to size the undo tablespace for the required 'consistent read' rebuild requirements;
    3) set the retention guarantee appropriately
    4) size the undo tablespace based on the required size, probably dictated by 2)
    Why is this an 'either one or other' question? When driving a car and looking for best fuel efficiency, you tune up the car, drive properly AND use the right fuel. You don't just pick one and leave it at that.

  • How identify the duplicate user mappings in portal.

    Dear SAP gurus,
    I am facing an issue in enterprise portal regarding user mapping.
    I am trying to map a portal user to R3 user,but that R3 user is already mapped to other user.
    I got the warning msg like
    The user mapping for remote system "XXXXX" is not unique. At least one other user is also mapped to remote user ID "81122555". This can lead to problems when it is necessary to uniquely identify the user mapped to this remote user ID ("inverse user mapping").
    I know the problem that is the user id 81122555 is already mapped to some other user.So i want know that user which is mapped with 81122555 and delete that mapping.
    Please help me that how can i serach it.
    Thanks & Regards
              Kumar

    Hi,
    Run the consistency check in the portal "User Administration". This will provide the report which can be copied and pasted in TXT file. In the text file search for the R/3 User ID you have mentioned. By this way you can find the portal User ID which is mapped to this R/3 user.
    Thanks,
    Mahendran B.

  • How can the query results include null if it's a required field on the front end?

    I executed a query that simply asked for all data points on a single table.
    I am trying to figure out why the query would report back as having all "Null" values in 3 of 10 columns. The information is required for the end user to enter before the system allows
    them save a record.

    You understand correctly.
    When you look up de service code do you get an description from table DDLValues?
    THIS IS CORRECT
    If the service code is in there, you should check why de ID is not correct.
    I dont know what this means. Check why the "ID" is not correct? What ID?
    The DDLvalues table has no objects on which it depends. It that normal?
    This is the code for the individual services
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[IndividualService](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [StudentID] [uniqueidentifier] NULL,
    [DateofService] [datetime] NULL,
    [ServiceCode] [int] NULL,
    [FocusCode] [int] NULL,
    [InterventionCode] [int] NULL,
    [ClinicianID] [uniqueidentifier] NULL,
    [Schoolid] [bigint] NULL,
    [Approved] [int] NULL CONSTRAINT [DF_IndividualService_Approved]  DEFAULT ((0)),
     CONSTRAINT [PK_IndividualService] PRIMARY KEY CLUSTERED 
    [ID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users] FOREIGN KEY([StudentID])
    REFERENCES [dbo].[Students] ([StudentID])
    ON DELETE CASCADE
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_aspnet_Users1] FOREIGN KEY([ClinicianID])
    REFERENCES [dbo].[aspnet_Users] ([UserId])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_aspnet_Users1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues] FOREIGN KEY([FocusCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues1] FOREIGN KEY([InterventionCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues1]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_DDLValues2] FOREIGN KEY([ServiceCode])
    REFERENCES [dbo].[DDLValues] ([DDLValueID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_DDLValues2]
    GO
    ALTER TABLE [dbo].[IndividualService]  WITH CHECK ADD  CONSTRAINT [FK_IndividualService_Schools] FOREIGN KEY([Schoolid])
    REFERENCES [dbo].[Schools] ([SchoolID])
    GO
    ALTER TABLE [dbo].[IndividualService] CHECK CONSTRAINT [FK_IndividualService_Schools]
    GO

  • Can we find the size of the query which is retrived in select operation??

    Hi,
    We run one select query and found that the query is retriving 953368 records(rows). Now is there any way to calculate how big is that query in terms of size.??
    Could you pls suggest me.
    Thanks,
    Srini....

    >
    We run one select query and found that the query is retriving 953368 records(rows)
    >
    Yes but how many different tables are involved? How many columns? What are the datatypes of the columns?
    If I run a query that returns one row it could have 900 columns defined as CHAR(4000), or one column defined as CHAR(1).
    So row length is somewhere between 1 byte and 3.6MB times 1 million rows.
    I'm guessing 1 million bytes minimum and 3.6GB on the high side.

  • I accidentally dropped my Iphone 5s on the ground which caused damage on the corner edge of the phone.  Is there a hope this can get repaired? My phone is still within the first year warranty. I hope to hear from you. Thank you.

    I accisentally dropped my iphone on the ground causing damaged on the
    corder edge of the phone. Can this still be repaired? My phone is still within the first year warranty. I hope to hear from you. Thank you

    The standard iPhone warranty does not cover accidental damage. Apple will fix it, but they will charge the full repair cost.
    The AppleCare+ warranty for the phone, which you can buy within 30 days of the iPhone purchase, does cover two incidents of accidental damage and repairs are charged at $75 I believe.
    Your carrier warranty, if you have one, may cover accidental damage - check with them.
    Matt

  • SharePoint key word query, how does the "Query Text" query special character in a query variable?

    I have a no code sandbox solution, in a content by search web part, I want to return pages from the library except the page I am visiting.
    I have 2 pages:
    Page A, the title is: Page title without special character
    Page B, the title is: Page title with special character "a b c d ..."
    And then I use Title<>{Page.Title} in the query text of the CSWP.
    While I visit Page A, the CSWP returns Page B, it works as expected.
    But while I visit Page B, the CSWP returns nothing, expected result should be Page A. I just consider, whether the special characters in the Title of Page B breaks the query text.
    I can not find similar topics in the forum, Does anyone have idea?
    Many thanks!

    Thank you for your feedback, Daniel.
    I have some updates, and found the root cause: if the field value contains special characters, the CSWP will not render the double quotation marks around the field value.
    View the page html source, and then find the text "QueryModification", you will see what happen:
    Query Text Input: Title<>{Page.Title}
    1. While the page title is "Test Page 1" (without special character), the rendered query text is
    Title<>\"Test Page 1\". It works as expected.
    2. While the page title is "Test-Page-1" (with special character "-", of cause we have more special characters on production), the rendered query text is
    Title<>Test-Page-1.  The double quotation marks are not rendered by the CSWP, so the query text are broken. It does not work as expected.
    If I make the query text as Title<>"{Page.Title}"
    1. While the page title is "Test Page 1", the rendered query text is
    Title<>\"\"Test Page 1\"\". It does NOT work since the
    quotes are duplicated (no sure why CSWP duplicates the quota mark),
    2. While the page title is "Test-Page-1", the rendered query text is
    Title<>\"Test-Page-1\".  Quotes are correct, but it does NOT work as expected still.
    The expected rendered query text (view from the html source) should be
    Title<>\"Test\\\-Page\\\-1\". (Here is test url: <a href="http://server/_api/search/query?querytext='Title<>"Test%5c%5c%5c-Page%5c%5c%5c-1"'&rowlimit=10">http://server/_api/search/query?querytext='Title<>"Test%5c%5c%5c-Page%5c%5c%5c-1"'&rowlimit=10)
    From the above information, I can say the CSWP not handle the special character correctly ("\" is not inserted before any special charactor).
    Is there any setting in CSWP can be used to resolve above problem?

Maybe you are looking for

  • Sound in video chat

    When using video chat my friend can hear me but I can't hear her. We're both using macs. After this happened, she brought her computer to the apple store where they checked it and said it wasn't a problem on her side. I've looked at the solutions tha

  • I upgraded to Yosemite and my calendar is black.  Can anyone tell me how to get my calendar back

    I upgraded to Yosemite yesterday and now my Calendar is blank.  Can anyone tell me how to get my old calendarback

  • Access Denied - Cannot download applications

    After purchasing the creative cloud subscription, I've received;  Access Denied:  You don't have permission to access ...CreativeCloudInstaller.dmg on this server. What do you recommend? Thank you.

  • UDConnect & Visual Foxpro 6

    Hi, i am using UDConnect for get datas from ORACLE 10g, that working good, we need extract data from files .dbf version Visual Foxpro 6. We use in Oracle this setting : <b>DriverName</b> Value = oracle.jdbc.driver.OracleDriver <b>URL</b> Value = jdbc

  • Problems sending attachments

    Hi, I've been having constant problems sending MP3 files. I work in music so it's important that this works but it's been steadily getting worse. The average mp3 size for me is around 6.3mb so it's not the file size. The sending bar shows that it get