Maintaining an Audit Table

Hi - I have created a small country table with country cd, country name and some audit columns like updt timestamp, updt cd etc. I edited the doDML() method of cntryImpl.java to auto populate some of the audit information.
and generated the JHeadstart webpages.
If I want to add another table like an audit table, which will maintain all the inserts, deletes, updates made to the actual country table, how do I do that ?
That is, any row added to the country table via the default webpages, should also add a row in this audit table. Any deletes in the actual table, should insert a record in the audit table with updt type cd 'delete'. How do I go about this?

You have several options:
1. Create audit tables in the database and have them filled with triggers. I believe good-old Headstart utilties (not to be confused with JHeadstart) can automate this proces. No java coding needed
2. Or you want to implement this in business components. I would recommend building a generic solution in the entityImpl superclass in the doDML method. Perhaps it is good idea to have a generic audit table in which changed values are stored in XML format, so you do not need to create shadow tables for every table of your application you want to implement auditing for.

Similar Messages

  • How to maintain previous and record count in audit table in SQL Server 2008 r2?

    Hi Experts ,
     Situation :
    in our database we are having few of stored procedures which will drop and recreates the tables and it is scheduled on weekly basis. when this job will run all the stored procedures will drop all the tables and recreate. Now we need to create one table which
    will maintain history of the records.
    my table structure is listed below
    TableName CurrentReocrdCount CurrentExecutionDate PreviousReordCount PreviousExurtiondate
    TEST         1000                   2014-03-30            NULL        NULL
    Test         1500                   2014-04-10            1000      2014-03-30
    Test         2000                   2014-04-11            1500      2014-04-10 
    How do i achive this . 
    franklinsentil

    You need to create audit tables for these. The table will be populated by COUNT value inside stored procedure. Each time it clears the main table and fills new data and also logs count details to audit tables. You can use COUNT(*)  to get count value
    and GETDATE function to get current execution value.
    So proc will look like
    CREATE PROC procname
    @param....
    AS
    --step to drop existing table
    IF OBJECT_ID('tablename') IS NOT NULL
    DROP TABLE <table name>
    --step to fill new table
    SELECT ...
    INTO TableName
    FROM
    --Audit table fill step
    INSERT AuditTable (TableName,CurrentRecordCount,CurrentExecdate,PrevRecordCount,PrevExecDate)
    SELECT TOP 1 'TableName',(SELECT COUNT(*) FROM tableName),GETDATE(),CurrentRecordCount,CurrentExecDate
    FROM AuditTable
    ORDER BY CurrentExecDate DESC
    UNION ALL
    SELECT 'TableName',(SELECT COUNT(*) FROM tableName),NULL,NULL
    WHERE NOT EXISTS (SELECT 1 FROM AuditTable)
    GO
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Modifying OWB audit tables?

    One option we are exploring on a new project is using the OWB audit tables/views as control tables to facilitate extracting changed data from the source system.
    For example
    Extract all data from source table x where update_date > (select max(start_time) from all_rt_audit_map_runs where map_name = y and run_status = 'COMPLETE')
    I am no terribly keen on the idea. Has anyone done this in the past? Would you consider this standard practice? I'd prefer to maintain our own control table(s).
    One problem I see is that (especially in dev/testing environments) it would call for situations where there needs to be manual modification of the data in OWB audit tables, which may lead to the data in them becoming corrupt. Would updating things like start_time, end_time and run_status be an acceptable development practice? I just think that once you start updating a table like all_rt_audit_map_runs it becomes very difficult to keep corresponding tables like ALL_RT_AUDIT_STEP_RUNS also accurate.
    Would appreciate others thoughts on the matter.

    I'd suggest maintaining your own tables, they are then in your control, there is no guarantee that the OWB audit tables will be in the same format in future releases.

  • Fetching SSIS error message into Audit table using SP

    Hi Experts,
    I want to fetch SSIS Error Info along with Task Name into Audit table 'Error_Info' column. This is nvarchar(max) datatype, i wrote below Stored Procedure for this (Column names passing dynamically in SP)
    CREATE PROC [dbo].[usp_AuditErrorHandler]
    @AuditTableName nvarchar(MAX)
    ,@Audit_Status nvarchar(100)
    ,@Audit_ErrorDescription sql_variant
    ,@Audit_PkgEnd_dttm nvarchar(100)
    ,@task sql_variant
    ,@errordescription sql_variant 
    ,@Audit_ID nvarchar(10)
    ,@LogID INT
    AS
    BEGIN
    DECLARE @STRQuery NVARCHAR(MAX)
    SET @STRQuery = ' 
    UPDATE '+@AuditTableName+'
    SET '+@Audit_Status+' = ''Failed''
    ,'+@Audit_PkgEnd_dttm+' = GETDATE()
    ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+@errordescription +'''
    WHERE ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    The above procedure is working fine in SSMS and inserting complete error info into table, but when i am executing thru SSIS Pkg i am getting error like
    "[Execute SQL Task] Error: Executing the query "exec usp_AuditErrorHandler ?,?,?,?,?,?,?,?" failed with the following error: "Incorrect syntax near '@P1'.". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly."
    So, i tot of checking with string lenght and modifed the code by adding left () to @errordescription as below.
    UPDATE '+@AuditTableName+'
    SET '+@Audit_Status+' = ''Failed''
    ,'+@Audit_PkgEnd_dttm+' = GETDATE()
    ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+LEFT(@errordescription ,100)+'''
    WHERE ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    Here, it is inserting till 119 chars, if i give more than 119 chars pkg is failing with above error.
    I want to get insert Complete error info into the column.
    Can anybody suggest on this?? 
    Thanks in advance !!!

    Thanks Arthur for the response, i have tried with the Sql_Variant data type also, here  procedure itself not creating and throwing below error.
    "The data types nvarchar(max) and sql_variant are incompatible in the add operator."
    This is the procedure i am using to fetch error info into Audit table.
    ALTER PROC [dbo].[usp_AuditErrorHandler]
    @AuditTableName nvarchar(MAX)
    ,@Audit_Status nvarchar(100)
    ,@Audit_PkgEnd_dttm nvarchar(100)
    ,@Audit_Task_ErrorCode nvarchar(100)
    ,@Audit_ErrorDescription SQL_VARIANT
    ,@errorcode nvarchar(max)
    ,@task SQL_VARIANT
    ,@errordescription SQL_VARIANT 
    ,@Audit_ID nvarchar(10)
    ,@LogID INT
    AS
    BEGIN
    SET NOCOUNT ON;
    DECLARE @STRQuery SQL_VARIANT
    BEGIN TRY
    SET @STRQuery = '    
    UPDATE  '+@AuditTableName+'
    SET     '+@Audit_Status+' = ''Failed''
           ,'+@Audit_PkgEnd_dttm+' = GETDATE()
           ,'+@Audit_Task_ErrorCode+' = '''+@errorcode+'''
           ,'+@Audit_ErrorDescription+' = ''Task['+ @task +']:'+ @errordescription +'''
    (Error is giving in this line)
    WHERE   ' +@Audit_ID+ ' = ' + CAST(@LogID AS NVARCHAR)
    EXEC (@STRQuery)
    END TRY 
    Below is the Audit Table Schema

  • Maintain acct determination (table T030B) for posting key IRX / IGX (M8395)

    Dear Guru,
    I am testing IS-Oil & Gas (Downstream) - Exchanges.
    Created Exchange Agreement and Purchase Contract and Sales Contract, Purchase Contract and Sales Contract are assigned to the Exchange Contract.
    A PO is created with reference to the Purchase Contract.
    Upon post goods receipt in MIGO, encountered error message "Maintain account determination (table T030B) for posting key IRX (Message no. M8395)" that does not allow PGR to get through.
    A call-off is created with reference to the Sales Contract.
    Similarly, when PGI is performed in VL01N, encountered error message "Maintain account determination (table T030B) for posting key IGX (Message no. M8395)" that does not allow PGI to get through.
    Checked in OBYC, there is no transaction key for IRX and IGX.
    Please advise. Thank you.
    Regards,
    WL

    Hi WL,
    Please use transaction code O54E to maintain the required configuration.
    I hope this helps you.
    Thanks & Regards
    Kalpesh Chavda

  • Maintain account determination (table T030B) for posting key IRX (M8395)

    Dear Guru,
    I am testing IS-OIL - Exchanges.
    Created Exchange Agreement and Purchase Contract and Sales Contract, Purchase Contract and Sales Contract are assigned to the Exchange Contract.
    A PO is created with reference to the Purchase Contract.
    Upon post goods receipt in MIGO, encountered error message "Maintain account determination (table T030B) for posting key IRX (Message no. M8395)" that does not allow PGR to get through.
    A call-off is created with reference to the Sales Contract.
    Similarly, when PGI is performed in VL01N, encountered error message "Maintain account determination (table T030B) for posting key IGX (Message no. M8395)" that does not allow PGI to get through.
    Checked in OBYC, there is no transaction key for IRX and IGX.
    Please advise. Thank you.
    Regards,
    WL

    Hi WL,
    In an Exchange scenario, the account determination entry would have to go added through tcode O54E for this purpose. You would see both the IRX and IGX entry in the above mentioned tcode.
    Menu path: IS-OIL Downstream --> EXG --> Account Assignment
    You would not be able to see the IRX or IGX transaction key in OBYC.
    Hope the above helps.
    Thanks.
    Edited by: Kok Wai Phang on Jul 10, 2011 7:58 AM

  • Error Maintaining multi-lingual tables.

    Hello, for past few days i have been stack at this error, can't find the solution. So i am bringing my problem here, hoping for an answer.
    Platform: Linux Red Hat Enterprise 5
    i am on R12.1.3 version and DB: 11g 2 realise.
    I need to install a Finnish language on EBS, so i licensed Finnish language in EBS.
    As mentioned in subject my problem lies within Maintaining multi-lingual tables.
    After i run the adadmin and select Maintain multi-lingual tables, everything is right until the last jobs, where 3 workers fail! here is the error
    sqlplus -s APPS/***** @/u01/ar121/VIS/apps/apps_st/appl/ibc/12.0.0/sql/IBCNLINS.sql
    Connected.
    PL/SQL procedure successfully completed.
    MESG
    LANGUAGE=AMERICAN
    PACKAGE=IBC_CITEM_VERSIONS_PKG
    SQLERRM=ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-20000: Oracle Text error:
    DRG-50857: oracle error in textindexmethods.ODCIIndexInsert
    ORA-20000: Oracle Text error:
    DRG-10607: index meta data is not ready yet for queuing DML
    DRG-50857: oracle error in drdmlv
    ORA-01426: numeric overflow
    ORA-30576: ConText Option dictionary loading error
    MESG
    ORA-06512: at "CTXSYS.DRUE", line 160
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 752
    select to_date('ERROR')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    And here is the worker fail
    ATTENTION: All workers either have failed or are waiting:
    FAILED: file IBCNLINS.sql on worker 1.
    FAILED: file CSNLINS.sql on worker 2.
    FAILED: file IRCNLINS.sql on worker 3.
    the worker error is the same on all three workers, just script is changed.
    I am pretty new at EBS, and newbie at DB administration too, so don't be so hard on me. Thx
    Edited by: 905194 on Dec 30, 2011 4:17 AM
    Edited by: 905194 on Dec 30, 2011 4:20 AM
    Edited by: 905194 on Dec 30, 2011 4:23 AM

    Was this instance upgraded from 11i and 10g database ? If so, a step in the upgrade may have been missed. Pl see this MOS Doc
    Applying The Patch 6678700 Worker 1 Failed: File Cskbcat.Ldt. ERRORS: ORA-20000: Oracle Text error: DRG-50857: oracle error in textindexmethods.ODCIIndexUpdate, DRG-13201: KOREAN_LEXER is desupported (Doc ID 1333659.1)
    If you are using 11.2.0.3, MOS Doc 1386945.1 (Oracle Text release 11.2.0.3.0 mandataroy Patches) may be applicable
    HTH
    Srini

  • Trigger problem -- can't insert the same data into audit table

    Sir/Madam,
    I'm trying to use insert trigger with a 'long raw' datatype data for my audit purpose. Each time, the data of original table can be inserted correctly. While the trigger for audit table in which it contains almost the same data as original would failed. The error messages are some thing like following:
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
    ORA-06512: at "CORPSEC.TI_ARCHIVE_PDF", line 9
    ORA-04088: error during execution of trigger 'CORPSEC.TI_ARCHIVE_PDF'
    If the column with 'long raw' datatype is taken out, then there is no error at all. I'm using Oracle 8i 8.1.6 for Windows NT and suspect there is bug in PL/SQL execution.
    The following are SQL text for the trigger:
    CREATE OR REPLACE TRIGGER "CORPSEC"."TI_ARCHIVE_PDF" AFTER INSERT ON "ARCHIVE_PDF" FOR EACH ROW DECLARE
    LOG_SEQ_NO NUMBER;
    BEGIN
    SELECT AUDIT_SEQ.NEXTVAL INTO LOG_SEQ_NO FROM DUAL
    insert into ad_archive_pdf (DOC_TITLE,PDF_FILENAME,CONTENT,DOC_DESC,AUDIT_REF_NO,AUDIT_DATE,AUDIT_MODE,AUDIT_BY)
    values (:new.DOC_TITLE,:new.PDF_FILENAME,:new.CONTENT,:new.DOC_DESC,LOG_SEQ_NO,sysdate,'I',:new.created_by);
    END;
    Any help on this. Thank in advance.
    Best regards,
    Ruijie

    See here for a discussion of how to incorporate LONG datatypes into triggers:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:635439::NO::F4950_P8_DISPLAYID

  • How to maintain variant in table RSRPARAMETRIZA?

    Dear Experts,
    I have to maintain variant in table RSRPARAMETRIZA via ABAP Program. Some thread in SDN advice the class CL_RSR_PARA but I don't know how to use this class to update the field "Content of Variant" in table RSRPARAMETRIZA.
    Please tell me the class or function that can update the variant?
    Thank you,
    Zilla D.

    Hello Narendar,
    Check the following link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/45/adee2396f711d1b46b0000e8a52bed/frameset.htm
    Also, a table control wizard in Screen Painter(SE51) exists, which takes you step by step through the Table Control generation and also creates code, so you can start using the Table Control right away.
    You can either specify a database table, or use an internal table from program.
    If you want to use internal table, it needs to be predefined in your program, before you start creating the table control.
    Reward if helpful.

  • Failure during running Maintain Multi-lingual Tables

    Hi,
    Currently, the system is running with R12.1.1 on RHEL 5.7.
    All the prerequisite patches are installed including language performance.
    Then, I am adding 4 additional languages. So, what's done is...
    1. Activated languages in the license manager.
    2. Run Maintain Multi-lingual Tables in AD Admin.
    I assigned 16 workers for this, and the last two assignments failed with the following messages.
    FAILED: file JTFNLINS.sql on worker 2 for product jtf username JTF.
    Deferred: file JTFNLINS.sql on worker 2 for product jtf username JTF. (Deferment number 1 for this job)
    Assigned: file JTFNLINS.sql on worker 2 for product jtf username JTF.
    FAILED: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.
    Deferred: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS. (Deferment number 1 for this job)
    Assigned: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.
    FAILED: file JTFNLINS.sql on worker 2 for product jtf username JTF.
    FAILED: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.
    Completed: file AKNLINS.sql on worker 6 for product ak username AK.
    There are now 0 jobs remaining (current phase=Done):
    0 running, 0 ready to run and 0 waiting.
    ATTENTION: All workers either have failed or are waiting:
    FAILED: file FNDNLINS.sql on worker 1.
    FAILED: file JTFNLINS.sql on worker 2.
    So, when I looked at the worker specific logs, followings are the error message.
    LANGUAGE=AMERICAN
    PACKAGE=JTF_GRID_COLS_PKG
    SQLERRM=ORA-01653: unable to extend table JTF.JTF_GRID_COLS_TL by 16 in tablespa
    ce APPS_TS_SEED
    select to_date('ERROR')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    Time when worker failed: Tue Sep 06 2011 10:11:16
    LANGUAGE=AMERICAN
    PACKAGE=FND_LOOKUP_VALUES_PKG
    SQLERRM=ORA-01653: unable to extend table APPLSYS.FND_LOOKUP_VALUES by 16 in tab
    lespace APPS_TS_SEED
    select to_date('ERROR')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    Time when worker failed: Tue Sep 06 2011 10:11:36
    1.
    When I had search work, it seems that <not enough space> is causing this.
    Or, is there any other reason than this for the failure?
    2.
    If <not enough space> is causing the failure, how could this be handled/solved?
    3.
    After the solution is applied, how is <Maintain Multilingual Tables> resumed?
    Currently, my status is that I am on pause at the following message;
    ATTENTION: All workers either have failed or are waiting:
    FAILED: file FNDNLINS.sql on worker 1.
    FAILED: file JTFNLINS.sql on worker 2.
    ATTENTION: Please fix the above failed worker(s) so the manager can continue.
    Can anyone help me out of this problem...?
    Thanks in advance,
    - SH

    Hi,
    When I had search work, it seems that <not enough space> is causing this.
    Or, is there any other reason than this for the failure?I believe this is only the reason and you need to add some space to APPS_TS_SEED tablesapce.
    ALTER TABLESPACE APPS_TS_SEED add datafile '/<replace with the actual file name path>' size 1024M;
    3.
    After the solution is applied, how is <Maintain Multilingual Tables> resumed?
    Currently, my status is that I am on pause at the following message;If you have not stopped the adadmin, then use adctrl to restart the failed workers.
    If you have already stopped/quit adadmin, then run adadmin again.
    thanks

  • Maintain multi lingual tables poor performance

    hello all,
    i am trying to install 4 new langauges into one of my test environments.
    the first stage is to add the language via licence manager - i have done this ok.
    the enxt stage is to run 'maintain multi lingual tables' via adadmin
    the problme i am having is that one process is taking over 48 hours to fail with snapshot too old, even though i have increased the undo_retention from 10800 to 48000, the job JTFNLINS.sql still fails
    I have a tar raised at the moment, but with not much information coming back,
    has any one got any tips/hints on how i can get this job working succesfully and in a shorter time?
    many thanks
    rob

    Maybe you have already seen this note 199716.1
    Sam
    http://www.appsdbablog.com

  • Maintain Multi-Lingual Tables Option Fails On Cznlins.Sql

    Hi all.
    I am trying to install Albanian language in a 11.5.10.2 fresh installation.
    I applyed all the neccesary patches to come to the NLS apply patch stage.
    I followed the link
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=316804.1
    for applyeing NLS Patch. I have to run the AD Utility Maintain Multi-Lingual Tables ,before applying NLS.
    But the workers fail on Cznlins.Sql.
    The worker's log shows:
    Start time for file is: Wed Jun 18 2008 14:13:08
    sqlplus -s APPS/***** @/oracle/prodappl/cz/11.5.0/sql/CZNLINS.sql
    PL/SQL procedure successfully completed.
    MESG
    LANGUAGE = AMERICAN
    PACKAGE= CZ_LOCALIZED_TEXTS_PKG
    SQLERRM= ORA-01400: cannot insert NULL into ("CZ"."CZ_LOCALIZED_TEXTS"."CREATED_
    BY")
    select to_date('ERROR')
    ERROR at line 1:
    ORA-01858: a non-numeric character was found where a numeric was expected
    Time when worker failed: Wed Jun 18 2008 14:13:08
    My question are:
    1.) Has anyone encountered this problem before.On the specific Cznlins.Sql file?
    2.) Shall i skip Maintain Multi-Lingual Tables, install the NLS, and run Maintain Multi-Lingual Tables after the installation?Do you recommend me to do this?
    Thanks in advance, Soni

    Hi hsawwan
    i am sending you the Road Map of patches i have applied,in my OEL 4 server enviroment.
    1.     Apply patch 4320012
    2.     Apply patch 6502082
    3.     Apply patch 6323691
    4.     Apply patch 6831988
    5.     Apply patch 4948577
    6.     Apply patch 5713544
    7.     Apply patch 4261542
    8.     Apply patch 5216496
    9.     Apply patch 5753922
    10.     Apply patch 6195759
    11.     Apply patch 5938515
    12.     Apply patch 3830807
    13.     Apply patch 4586086
    14.     Apply patch 4888294
    15.     Apply patch 5989593
    16.     Apply patch 3218526
    17.     Apply patch 3761838
    18.     Apply patch 4206794
    19.     Apply patch 5903765
    20.     Apply patch 3865683
    21.     Apply patch 4619025
    22.     Apply patch 6372396
    23.     Apply patch 4653225
    24.     Installation of Oracle 10g R2 database,software only(different home).
    25.     Installation of Oracle 10g R2 companion cd products.
    26.     Installation of Oracle 10g R2 pachset2
    27.     Apply patch 5257698
    28.     Upgrading to Oracle 10g R2
    29.     Configuring AutoConfig on db tier
    30.     Apply patch 5753621
    31.     Prepare for NLS(failed on AD Maintain Multi-Lingual Tables on CZNLINS.sql file)
    Is this the right way, before applying NLS, for albanian language?
    Do you think i have any conflicts in my list of patches?
    Thanks, Soni

  • Query based on main table and audit table

    Hi,
    I had created auditing on some table. Values might not change and if they changed, it should be stored in audit table.
    I want to get the values in the table a on real time basis, like dimentions in datawarehouse.
    Trying to write a query based on table a and aud_a to get point-in-time or values at anytime in the past.
    Something like
    SELECT *
    FROM a (table_name)
    WHERE effective_from >= $DATE_TO_QUERY
    AND effective_to < $DATE_TO_QUERY
    How to get this kind of query .
    Please help. ( Table structure for table a and audit table aud_a and trigger aud_tg_a given below)
    Giving code as follows.
    main table a
    create table a
    ( val1 number,
    val2 number,
    update_by varchar2(30),
    date_updated date);
    creare auidt table aud_a
    create table aud_a
    ( "AUDIT_SEQ" NUMBER,
    "AUDIT_TRAN_ID" NUMBER,
    "AUDIT_PROG_ID" VARCHAR2(30 BYTE),
    "AUDIT_TERMINAL" VARCHAR2(16 BYTE),
    "AUDIT_REASON" VARCHAR2(30 BYTE),
    "AUDIT_ACTION" CHAR(1 BYTE),
    "AUDIT_ACTION_BY" VARCHAR2(20 BYTE),
    "AUDIT_ACTION_DT" DATE,
    val1 number,
    val2 number,
    updated_by varchar2(30),
    date_updated date);
    trigger on  table a to populate aud_a
    CREATE OR REPLACE TRIGGER aud_tg_a AFTER
    INSERT OR
    DELETE OR
    update on a
    for each row
    declare
    v_time_now DATE;
    v_terminal VARCHAR2(16);
    v_tran_id NUMBER;
    v_prog_id VARCHAR2(30);
    V_reason VARCHAR2(30);
    BEGIN
    v_time_now := sysdate;
    v_terminal := userenv('TERMINAL');
    v_tran_id := 1;
    v_prog_id := 'test';
    v_reason := 'AUDIT';
    IF inserting THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    val1,
    val2,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'I' ,
    :new.val1,
    :new.val2,
    :new.updated_by,
    :new.date_updated
    elsif deleting THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    us_agy_backed_id,
    industry_subgroup,
    comments,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'D' ,
    :old.val1,
    :old.val2,
    :old.comments,
    :old.updated_by,
    :old.date_updated
    elsif updating THEN
    INSERT
    INTO a
    audit_seq,
    AUDIT_tran_id,
    AUDIT_prog_id,
    AUDIT_reason,
    AUDIT_terminal,
    AUDIT_action_by,
    AUDIT_action_dt,
    AUDIT_action ,
    us_agy_backed_id,
    industry_subgroup,
    comments,
    updated_by,
    date_updated
    VALUES
    s_audit_no.nextval,
    v_tran_id,
    v_prog_id,
    v_reason,
    v_terminal,
    USER,
    v_time_now,
    'U' ,
    :new.val1,
    :new.val2,
    :new.updated_by,
    :new.date_updated
    END IF;
    END;
    -------------------------

    Hi hoek,
    I am not able to use Oracle's audit functionality becuase I need to trap some changes in particular tables and then rebuild query if required.
    Thanks for your suggestion though.
    Regards,
    Milind

  • How to access to audit tables in Oracle Content DB version 10.2.0.0.1

    Hello,
    Could someone tell me please how to access to Oracle Content DB audit tables as:
    ODMZA_RAWAUDITEVENT
    ODMZA_AUDITEVENTPROPERTY
    ODMZA_AUDITEVENT
    ODMZA_AUDITOPTYPE
    ODMZA_AUDITTARGETCLASS
    ODM_INTERMEDIAAUDIO
    ODM_AUDITINGCONFIGURATION
    ODM_AUDITTYPEENTRY
    ODM_AUDITSPECIFICATION
    ODM_AUDITTYPELIST
    ODM_AUDITTARGETSPEC
    Could you tell me the way to view all these audits logs?
    Which interface should I have?
    Thanks for your help.
    Alex

    Hi
    Yes you can directly apply path set 10.2.0.4
    Note 839187 - Oracle 10.2.0: Applying patch set/patches/patch collection
    Regards
    Uday

  • How to populate SQL Text in auditing table?

    Hi,
    Only modifying the 'AUDIT_TRAIL' .ora parameter is enough to popoulate SQL text?
    Plz reply,if you have any concerns.
    Thanks,

    Hi,
    >>I gone through few documents to enable SQL_TEXT in audit table,it says Changing the . ora parameter to 'DB_EXTENDED' is enough to populate SQL text.
    That's right. The exact SQL statement executed by the user and the bind variables used with the SQL are collected in the audit trail when the initialization parameter AUDIT_TRAIL is set to DB_EXTENDED. The DB or TRUE value will not populate the SQLTEXT and SQLBIND columns of the AUD$ table.
    Cheers
    Legatti

Maybe you are looking for