Locating table truncation source

Hi all,
I have a problem with a database schema that I use, but am not a DBA for. Every night certain tables are truncated from 200,000+ records to just 100 records. At first I wasn't sure if it was a table deletion or a truncation, so i set up a trigger for both events that populate an audit table to identify who, when and what is happening. This is the trigger for the truncate check:
CREATE OR REPLACE TRIGGER IDMS_TMP.capture_trunc
before truncate on schema
WHEN (
ora_dict_obj_name='E_TRACK_WO_SSL_VALID' AND ora_dict_obj_TYPE='TABLE'
DECLARE
IntPKID NUMBER;
Begin
IntPKID := 0;
   SELECT SEQ_ZATSW_PKID.NEXTVAL INTO IntPKID FROM dual;
INSERT INTO Z_AUDIT_TRK_SSL_WO (ZATSW_PK_ID, ZATSW_USER_ID, ZATSW_DATE, ZATSW_ALTERTYPE) Values (  IntPKID, USER, SYSDATE, 'TRUNCATE');
END;This returned the following results:
ZATSW_USER_ID ZATSW_DAT ZATSW_ALTERTYPE
SYS 12-APR-2010 21:35:35 TRUNCATESo i can tell that it is a truncation, occurring at 9:35pm, run by the sys user, but I still need to track down how this being run. So my question is:
Does anyone know how to capture the executing statement causing the truncation, be it a PL/SQL stored proc, scheduled job, manual SQL statement or some other method or identifying what is deleting the data? This would help me to eliminate the cause but at the moment i can only tell who and when, not how or why :(
Not even sure why it then populates with 100 records (as a truncate would remove all?) but finding the calling truncate statement location would probably also answer this question :)
Many thanks
Dan

Hi all,
Thanks for the adivse, unfortunately I do not have access to the DBA_JOBS or any other way or finding out what jobs are running (DBA has restricted access). He tells me that the following jobs are scheduled but should not have this sort of impact:
DAILY_PURGE_SCHEDULE
EMD_MAINTENANCE.EXECUTE_EM_DBMS_JOB_PROCS
Both of these are supposed to be general housekeeping tasks so shouldn't do anything like this, but these are the only scheduled jobs that he can find. The only other possible option is that the truncation is coming from another DB schema across one of two DB_Links we have, but when this first happened I created a copy of one the tables, renamed it, and this is still being hit by the subsequent truncation the next day so it doesn't look like it is table specific (although only certain tables seem to be affected).
As i mentioned in my previous post, what I am really after is a method by which the trigger can find the calling package / procedure of the truncation and tell me what is causing the truncation, however i will look into using the log miner, although my understanding fro the DBA is that there is no logging (it is only a dev DB but not sure why no logging was specified), and not sure if a table being truncated would be captured by the redo log?
Cheers
Dan

Similar Messages

  • Can FDMEE connect to oracle table as source system?

    Can FDMEE connect to oracle table as source system?

    Hi Experts ,
    I am new to FDMEE .
    I am loading data from Oracle RDBMS to Essbase/Planning using Open Interface Adapter , as per the steps mentioned in the Erpi_admin guide , i have populated the AIF_OPEN_INTERFACE table with data and configured FDM stuffs ( Mappings , Import Format , Location , Data Rule etc ) . During IMPORT getting the error "
    2014-01-28 17:45:24,018 FATAL [AIF]: Error in CommData.insertImportProcessDetails
    Traceback (most recent call last): File "<string>", line 2304, in insertImportProcessDetailsRuntimeError: No periods were identified for loading data into table 'TDATASEG'."
    Just to confirm that i have done the Period Mapping as well .
    Please guide me to load the data using Open interface adapter .
    Thanks,
    Amit

  • What is difference between using interface as source and table as source?

    I am working on a batch flow which need several steps to populate data from source to target. For example, I need 5 interfaces to finish final data loading. I can either use interface or use temporary table as source and target for the interface 2, 3, and 4. It looks like both case will use tables no matter use interface or use temporary table. So my question is if there is any difference between these two (using interface as source or use temporary table as source)?
    Thanks

    if you use a Table as source for the intermediate process, it will create a physical temporary table i your work rep(depends on you choice) and populate the data into the table. if you use a interface as a source, just it will create a sub query instead of temporary table.
    Thanks
    nidhi

  • Creating a new logging table in source

    Hi ,
    I have two relication setup , one is ECC to Ent hana and the other Ecc to BW on hana.
    For ECC to BW on hana , i want to create a seperate logging table in source  to diffrenciate from the two replication.
    Could you please let me know how to do this.
    Thanks,
    Rajiv

    Hi,
    this is unfortunately the wrong community, pls. have a look here: SAP LT Replication Server
    There you can post your question.
    Best,
    Heike

  • Error while using Oracle Table as source file :- ODQ for ODI

    Hi All,
    I am getting some errors while working on ODQ with Oracle Tables as source file.
    If I am trying with text files (*.txt) as source and output it works fine.
    Please let me know how we can connect to an oracle table which is my source file.
    In the exported project -> “settings” folder
    In the file named eN_transfmr_pXX.stx
    For
    /CATEGORY/INPUT/PARAMETER/INPUT_SETTINGS/ARGUMENTS/EN
    TRY/DATA_FILE_NAME=
    What I need to give? (URL – source file)
    I tried with
    1. jdbc:oracle:thin:@xxx.xxx.x.xx:1521:ORCL
    2. jdbc:oracle:thin:UserName/Password@// xxx.xxx.x.xx:1521:ORCL
    i am not sure , is there any thing missing ???
    (Note: for text file I am giving “D:\Sourcefolder\customer.txt”)
    If I am running the batch file directly from CMD Prompt it’s displaying the error message
    “Cannot open file”
    If I am connecting with ODI it’s displaying the error
    com.sunopsis.dwg.function.SnpsFunctionBaseException: OS command returned 3503. …………………….
    Thanks in advance…
    Rathish A M

    Hi Ratish,
    ODQ supports files as inputs not Oracle tables, what you should do is:
    - define an ODQ process that takes a file as an input.
    - create an ODI process that dumps your Oracle table into a file that will be used by ODQ. (interface or OdiSqlUnload step)
    - run the ODQ process in ODI (in a package)
    - create an ODI interface that will load your ODQ output file into a DB.
    You can profile Oracle tables directly using Oracle Data Profiling.
    Thanks,
    Julien

  • ODI: Way to select Distinct data while doing Join of tables at Source

    HI,
    Our requirement is to do a join on multiple tables selecting distinct data from those table at source.
    But we are not able to see the Distinct Box in flow tab.
    Any thoughts to resolve our problem
    Pratik

    You can not put DISTINCT clause selectively .
    If you choose to opt for DISTINCT then Oracle will apply the distinct to all columns present in the select list .
    So at your IKM level just click the distinct check box .. run your interface and find out the query generated .
    See if your requirement is getting fullfilled or not .
    Thank,
    Sutirtha

  • Fixed vendor table in source list

    Hi Friends,
    We understand that EORD is the table for Source List.Fixed Vendor check which we maintain in source list (transaction ME01) does not get saved in the table EORD.It get saved at some other table,Can you please let me know the table name for this Fixed vendor check.
    -Prasad.

    hi
    ME03 field is actuly  a structure not a table .
    Structure          RM06W
    Short Description  I/O Table, Source List, SAPDM06I
    field : FESKZ       Fixed source of supply
    check in SE11
    regards
    ravikant

  • PAYR Table Data source

    Dear BI Experts,
    We are planning to implement Payment details like check number and date and Bank Name.
    Using PAYR table our requirement is matching.
    But we are not getting related data source IN R/3.
    Please suggest PAYR table data source.
    Regards
    Ramu.

    Hi Ramu..
    This may help
    (0FI_AP_51)
    http://help.sap.com/saphelp_nw70/helpdata/EN/db/0345943f9043e083c3ccba1e73b42a/frameset.htm
    Regards,

  • Using table comparison can we use multiple tables as source?

    Using table comparison can we use multiple tables as source?
    Thank you very much for the helpful info.

    Table Comparison
    1) Input Data coming in
    2) Comparison table (table to which the data is compared)
    3) Output (input rows with respective opcodes based on the comparison result of input dataset with the comparison table)
    If your question is whether table comparison can accept union/join of multiple table sources, you can achieve by using merge/query transforms and then feeding to table comparison. Here, you have to be careful about choosing the primary keys inside table comparison

  • ORA-01653: unable to extend table SYS.SOURCE$ by 64 in tablespace SYSTEM"

    Hi,
    While creating a package the , I got the following error.
    "ORA-00604: error occurred at recursive SQL level 1
    ORA-01653: unable to extend table SYS.SOURCE$ by 64 in tablespace SYSTEM"
    Could anyone please explain, how to solve this problem.
    Thank you,
    Regards,
    Gowtham Sen.

    solution: increase the size of the system tablespace.
    the text of all pl/sql objects is stored in the database by sys. packages, procedures, and functions are stored in sys.source$ (which is part of the USER_SOURCE view definition). so, you've created a lot of pl/sql, and the table wants to extend, but there isn't room.
    this is a major problem, because it means that nothing in system can extend. add another datafile, or put the tablespace on autoextend.

  • Newbie Table Data Source Question

    Hi,
    I have a question about table data sources. I can set them up OK but I can't find the answers I'm looking for in the documentation or online.
    With a table data source, the content column is the one that's indexed right? Are the attribute column sindexed as well? If the content column is null, will the attribute columns still be indexed?
    Thanks in advance
    Mark.

    The attribute column is indexed along with the content column. However, the attribute column will not be indexed if the content column is null. That is, empty document is not indexed.
    The workaround is to at least fill in a few space characters to the content column.
    Steve

  • Insert data into fact table from source database tables

    here i try to insert data into fact table from source database tables here is the query 
    ALTER procedure [dbo].[facttable]
    as
    insert into [pp dw].dbo.Dimfact(Prod_ID,Production_ID,Material_ID,Equip_ID,WC_ID,Recipe_ID,Quantity,costprice)
    select Products.[Product ID],[Production ID],Materials.[Material ID],[Equipment ID],[Work Centre ID],[Recipy ID],Quantity,[cost price]
    from
    [PRODUCTION PLANNING 2].dbo.[Products],
    [PRODUCTION PLANNING 2].dbo.[Production Detail],
    [PRODUCTION PLANNING 2].dbo.[Material category],
    [PRODUCTION PLANNING 2].dbo.[Materials],
    [PRODUCTION PLANNING 2].dbo.[Equipment],
    [PRODUCTION PLANNING 2].dbo.[Working Centre] ,
    [PRODUCTION PLANNING 2].dbo.[Recipies]
    where
    Products.[Product ID] in (13, 14, 15, 16, 17) and
    [Production Detail].[Production ID] in (1, 2, 3) and
    [Materials].[Material ID] in (1, 2, 3, 4, 5) and
    [Equipment].[Equipment ID] in (1, 2, 3, 4) and
    [Working Centre].[Work Centre ID] in (1, 2, 3) and
    [Recipies].[Recipy ID] in (1, 2, 3) and
    [Material category].[Category ID] in (8, 9, 10, 11, 12, 13)
    and when i execute query it shows me error 
    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Dimfact_Dimproduct". The conflict occurred in database "pp dw", table "dbo.Dimproduct", column 'Prod_ID'.
    ERD IS
    HOW TO SOLVE THIS PROBLEM?

    I cant see any join conditions in your query posted. Whats the purpose of the query above. It will just bring you a cartesian product (cross join) of tables involved subjected to filters. Are you sure this is the correct query?
    The error you're getting may be because you've not yet populated DimProduct or may be because of logic you used in popultaing DimProduct causing it to miss some records which is what query is referring to in above case.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Table Data Source Search Result gives ClassCastException

    I set up a table data source and queried it using the following URL:
    http://machine_name:port/ultrasearch/query/search.jsp?usearch.p_mode=Advanced
    and specified my table data source. The result URLs
    came up with the right primary key id. However when I
    click the URL, I get:
    java.lang.ClassCastException: com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].sql.OrclCallableStatement
    at oracle.ultrasearch.query.DisplayUtil.displayTableUrl(DisplayUtil.java:131)     
    at display.jspService(_display.java:1568)     [SRC:/display.jsp:81]     
    at com.orionserver[Oracle9iAS (9.0.2.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)     
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)     
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)     
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)     
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)     
    at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    I have specified NUMBER as the data type for my primary key column and it is of type NUMBER in my table DDL. Is that OK or could this be causing the problem?
    Dinesh

    Dinesh,
    Can you provide the following information for creating the table data source:
    - Is the table data source based on a table or a view?
    - Is the table/view in the local or remote database?
    - If the table is in the local database, is the table in the instance owner schema or another schema?
    - Do you login to Ultra Search Admin Tool as the instance owner or other users?
    - Does the instance owner schema have privileges to read the contents in the table/view?

  • How to deactivate s26X tables in Source system

    Hi All,
    I have an  requiremnet
    I have to stop updating of s26x table in source system, as data is not extracting to BW (version 3.0)
    I have deactivated the Infostructure in LBWQ 2lis_01_26x. By which Delta tables got deactivated .
    But still the s26x table is getting updated  in source system.
    Thansks in advace
    Leena

    Hi,
    Please stop the job control of the extractor.
    -Vikram

  • How do we use Data rules/error table for source validation?

    How do we use Data rules/error table for source validation?
    We are using OWB repository 10.2.0.3.0 and OWB client 10.2.0.3.33. The Oracle version is 10 G (10.2.0.3.0). OWB is installed on Linux.
    I reviewed the posting
    Re: Using Data Rules
    Thanks for this forum.
    I want to apply data rules to source table/view and rule violated rows should go to defined error table. Here is an example.
    Table ProjectA
    Pro_ID Number(10)
    Project_name Varchar(50)
    Pro_date Date
    As per above posting, I created the table in object editor, created the data rule
    NAME_NOT_NULL (ie project name not null). I specified the shadow table name as ProjectA_ERR
    In mapping editor, I have projectA as source. I did not find error table name and defined data rules in table properties. It is not showing up the ERR group in source table
    How do we bring the defined data rules and error table into mapping?
    Are there any additional steps/process?
    Any idea ?
    Thanks in advance.
    RI

    Hi,
    Thanks for your reply/pointer. I reviewed the blog. It is interesting.
    What is the version of OWB used in this blog?
    After defining data rule/shadow table, I deployed the table via CC. It created a error table and created the all the source coulmns in alphabatical order. If I have the primary key as 1st coulmn (which does not start with 'A') in my source, it will apprear middle of of columns in error table.
    How do we prevent/workaround this?
    If I have source(view) in sch A, how do we create Error table in Sch B for source(view)?
    Is it feasible?
    I brought the error table details in mapping. Configured the data rules/error tables.
    If I picked up 'MOVE TO ERROR' option, I am getting "VLD-2802 Missing delete matching criteria in table. the condition is needed because the operator contain at least one data rule with a MOVE TO ERROR action"
    On condition Loading - I have 'All constraints' for matching criteria.
    I changed to "no constraints' still I get the above error.
    If I change to 'REPORT' option instead of 'MOVE TO ERROR' option, error goes off.
    Any idea?
    Thanks in advance.
    RI

Maybe you are looking for

  • My ipod shows up that its connected but says its in recovery mode

    My ipod shows up that its connected but says its in recovery mode. HELP ME NOW.

  • How to set proxy to javamail?

    Hi friends: I want to receieve email using javamail. I use code: Properties prop=new Properties();        prop.put("mail.pop3.host",host);        prop.put("mail.smtp.auth","true");//        Session session=Session.getDefaultInstance(prop);        ses

  • IPod 10GB 3rd Generation

    Hey All! My roommate just purchased a 3rd Generation 10GB iPod off eBay and nothing seems to happen. Do you know or have any suggestions for him? If so, great! If not, no worries. I have tried reseting it, using my AC adapter with it, etc. Looking fo

  • Error in AD8512 model

    Multisim 11.0.2 Full edition. I was in the process of entering a moderately complex circuit for analysis.  The first part of the circuit involved 2 AD8512 dual opamps.  My analysis was such that I could enter part of the circuit, simulate, then proce

  • Initiate from Watched Directory

    Is it possible to initiate a workflow by creating a file in a watched directory and then reading that file as part of the workflow? I have a process that creates a simple CSV file of Purchase Order numbers in a directory. I would like to read in that