Oracle Trigger to log changes in a table

I have a situation where if a new record is created or a modification to a table is made all details of these changes are logged. For example
A change is made in a customer table, from
Customername - Andrew
Customerid - 1
to
Customername - John
Customerid - 1
The changes would be logged in a separate table of the following format
TableType - The table the edit or new record appeared in
Username - The user that made the change
ChangeDate - Date of change
Uniqueid - Customer id
change type - the type of change add or modify
colname - the column name affected by the change
oldvalue - the old value
newvalue - the new value
therefore for the above example the logtable would be populated as follows:
TableType - Customer
Username - athompson
ChangeDate - 17/01/06
Uniqueid - 1
change type - modify
colname - customername
oldvalue - andrew
newvalue - john
Ok that sums up the aim, all im wondering is if this is possible using Oracle Triggers?
Any help, advice or possible solutions would really be helpful as im a bit of a trigger newbie :P
cheers
AndyT

Ah okay, the system has been designed and built before all requirements are known and understood and now cannot be changed. This is a common reason for using triggers as a kludge to fill the gaps in the application after the fact.
Based on the low usage though you should probably be okay, hopefully this will help get you started.
Also see the SQL and PL/SQL Reference guides
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
SQL> create table t (n number);
Table created.
SQL> create table t_log (table_name varchar2(30),
  2    username varchar2(30), change_date date, change_type varchar2(10),
  3    old_value number, new_value number);
Table created.
SQL> create or replace trigger t_after_row
  2  after insert or update on t
  3  for each row
  4  declare
  5    l_type varchar2(10);
  6  begin
  7
  8    if updating then
  9      l_type := 'MODIFY';
10    elsif inserting then
11      l_type := 'ADD';
12    end if;
13
14    insert into t_log
15      (
16      table_name,
17      username,
18      change_date,
19      change_type,
20      old_value,
21      new_value
22      )
23    values
24      (
25      'T',
26      user,
27      sysdate,
28      l_type,
29      :old.n,
30      :new.n
31      );
32
33  end;
34  /
Trigger created.
SQL> insert into t values (1);
1 row created.
SQL> insert into t values (2);
1 row created.
SQL> update t set n = 3 where n = 1;
1 row updated.
SQL> select * from t_log;
TABLE_NAME   USERNAME     CHANGE_DAT CHANGE_TYP  OLD_VALUE  NEW_VALUE
T            TEST         01-19-2006 ADD                            1
T            TEST         01-19-2006 ADD                            2
T            TEST         01-19-2006 MODIFY              1          3
SQL>

Similar Messages

  • Logged changes in Custom Table

    Hi Gurus,
    Need the Transaction code to check logged changes in Customizing Table ....... Something Like V_T510N...
    ...Need to know the USER ID who changed the table......
    NOTE: THIS IS FOR CUSTOMIZING TABLE....Not INFOTYPE or PA Table.
    Kumarpal Jain.

    Hi
    Check SM30->View of your Custom Table Name->Utilities -> change logs.
    Check Tables : CDHDR and CDPOS also.
    Regards,
    Sreeram

  • Trigger for logging changes(DML changes) for All tables in Schema

    Hi ,
    Is there a way to create a schema level trigger to audit the DML changes that affect all the tables.I need the output in my log table as
    1) the table name on which the DML occurred
    2) type of DML
    3) column names affected.
    I know this can be achieved through enabling AUDIT or by creating dynamically, triggers for each tables...
    Is there a way to create a single trigger to achieve this??

    It's not possible to create DML trigger on schema level
    I think the only way is to create the triggers dynamically for each table..
    Re: Schema level Database triggers by Kamran Agayev
    Edited by: jeneesh on Oct 12, 2012 6:39 PM

  • Log changed data in tables

    hi
    I want to hold change data information.
    For example I have table student and one row is inserted.
    Then somebody else changed the name of the student name and phone number.
    I want to hold the changed columns when an update query is executed.
    I looked at change data capture but I think it is about data warehouses and there are 2 databases in that case.
    I do not want to write triggers for all tables.
    I looked at fine grained auditing but I can take the update statement only, I do not know how can I find the changed columns, column's last data and new data.
    How can I do it? Which topic should I research?
    Can you lead me?
    Good Works

    [Flashback Query|http://www.oracle-base.com/articles/9i/FlashbackQuery.php] may be possible. but, There are some restrictions for Flashback query.
    [http://www.oracle-developer.net/display.php?id=210]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query.shtml]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query2.shtml]
    [http://www.dbasupport.com/oracle/ora9i/flashback_Query3.shtml]
    Last option is log Minor.

  • Logging changes in any table

    Hi,
    Is it possible to track changes in a schema by writing own code? What i want to achieve is to write something that will 'catch' any insert or update to any table in my schema and writes a log to my table.
    Thank you very much
    lubos

    Here is what SAP says as a F1 help on the logging flag in technical setting of a table..
    Log data changes
    The logging flag defines whether changes to the data records of a table should be logged. If logging is activated, every change (with UPDATE, DELETE) to an existing data record by a user or an application program is recorded in a log table in the database.
    Note: Activating logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, many users access this log table in parallel. This could cause lock situations even though the users are working with different application tables.
    Dependencies
    Logging only takes place if parameter rec/client in the system profile is set correctly. Setting the flag on its own does not cause the table changes to be logged.
    The existing logs can be displayed with Transaction Table history (SCU3).

  • Oracle Data Modeler commit change seg physical table

    Hello,
    Sometimes when I record a data model, Oracle Data Modeler (SVN) given as outgoing a chage of segment of physical table , if you committees are to change, duplication of files in the physical model is produced. Later when you open the physical model gives errors that have duplicate files
    How you can correct this error? Why the segment change occurs?
    Thanks

    Hello,
    Versión 4.0.0.833.
    No pattern is occasionally when shooting in the data model. How you can correct this error? Why the segment change occurs?
    Thanks

  • Change logs not available for tables

    Hi Experts,
    Is there any change logs available for the  tables PCEC, FTXP, T030
    We need to add logs so that we can keep track of the changes.
    Please let me know if someone knows the solution.
    Regards,
    Srinivas

    Dear Srinivas,
    Go to SE11 and key in your table, then select Display.
    In the top, you will be able to see Technical Settings Button. click on it.
    It will show you the technical details for that table.
    There will be an indicator at the bottom LOG DATA CHANGES.
    If this indicator has been set, then only the changes will be recorded.
    For change log, you shall make use of the transaction SCU3.
    AUT10 shall also be used.
    thank you
    Venkatesh

  • Table for the report RPUAUD00  Logged Changes in Infotype data

    Hi
    I have a query with the program RPUAUD00 Logged changes in Infotype Data.  In which table stores the details of the program RPUAUD00.  for example in the 1st period there is a LWP record for the employee.  If in the 2nd period the LWP entered in 1st period has deleted, in the log the LWP displays for 1st period  new field contents, Action Indicator I.  The deleted information displayes in Old field contents with the Action Indicator D. We want to know in which table the LWP insert and LWP delete (d) details are stored.
    This information required to create a report for ESI.  In the report No of days (payroll processed for) has to mention.  To know the no of days need to access the report RPUAUD00.  From the RPUAUD00 the details of LWP insert and delete can be known.
    Request to help in solving the issue
    Thanks & Regards
    EKP Yadav

    Hello:
    Logged changes in Infotype Data are stored in cluster table PCL4 ID  LA and SA for employee and LB and SB for applicant. Maybe L is for longterm and S for shorterm
    Cheers.
    Antoine

  • IDOC trigger using Z change pointers for standard SAP table

    For IDOC trigger, is using custom change pointers on standard SAP master data tables, a good idea? A seasoned abaper told me "it will mess with the standard" and further told to go with scheduled job.
    So, for example, say that my data for table T001K is updated via transports in PRD and I need to transfer this updated data via IDOC to an external system. Since there is no standard message type for this data, I will create a new one. Further, I will create a new change pointer for table T001K (it already has six fields with their data elements activated for Change Documents). Then I link the message type and the new change pointer. And so on an so forth. I have followed the procedure given here:SAP Tips: A to Z of Custom Change Pointer
    Now, the question is, will this be a good idea to capture data and trigger IDOC? Or a batch program with calls to standard FM to read CDHRD/CDPOS be a more suitable option.
    I need to know if a near instantaneous data transfer (and an effecient one as far as the system performance and reliability is concerned) can be acheived. If there is any other way of doing this, I am not aware of it!
    Any one has any input/experience on this?

    Hi Viktor,
    I think the batch program approach would be a good solution as the by this way you are taking matter into your own hands rather giving control to the SAP framework because you may have to test out the other approach as to how the standard SAP framework is behaving for custom change pointers.
    Thanks,
    Ravi

  • URGENT: What table stores data for logged changes in PA and PD??

    Thanks!!!

    Hi Scott,
    Thanks for the reply.  This transaction leads to the report that allows you to display logged changes in PA, but I need the table name where these changes are actually stored for PA and the other table where change documents are stored in PD.
    Regards,
    -Joe

  • Change in Oracle Parameters and Log file size

    Hello All,
    We have scheduled DB Check job and the log file showed few errors and warnings in the oracle parameter that needs to be corrected. We have also gone through the SAP Note #830576 – Oracle Parameter Configuration to change these parameters accordingly. However we need few clarifications on the same.
    1.Can we change these parameters directly in init<SID>.ora file or only in SP file. If yes can we edit the same and change it or do we need to change it using BR tools.
    2.We have tried to change few parameters using DB26 tcode. But it prompts for maintaining the connection variables in DBCO tcode. We try to make change only in default database but it prompts for connection variables.
    Also we get check point error. As per note 309526 can we create the new log file with 100MB size and drop the existing one. Or are there any other considerations that we need to follow for the size of log file and creating new log file. Kindly advise on this. Our Environment is as follows.
    OS: Windows 2003 Server
    DB: Oracle 10g
    regards,
    Madhu

    Hi,
    Madhu, We can change oracle parameters at both the levels that is init<SID> as well as SPFILE level.
    1. If you do the changes at init<SID> level then you have to generate the SPFILE  again and then database has to be restarted for the parameters to take effect.
        If you make the changes in SPFILE then the parameters will take effect depending on the parameter type whether it is dynamic or static. You also need to generate the PFILE i.e init<SID>.ora
    2. If possible do not change the oracle parameters using the tcode. I would say it would be better if you do it via the database and it would be much easier.
    3. Well its always good to have a larger redo log size. But only one thing to keep in mind is that once you change the size of the redolog the size of the archive log also changes although the number of files will decrease.
    Apart from that there wont be any issues.
    Regards,
    Suhas

  • How to enable logging of database changes of  Z tables into a log table.

    Dear Team,
    We have 8 Z tables and we need to log the changes in these tables. Earlier Change Document process was proposed but now we know that the possible changes in the Z tables will be many and this can cause too many entries in CDHDR and CDPOS tables. Going through so many entries of Change Document tables will decrease the system performance. The other option involves enabling the Log data base changes for the Z data base tables, but this will also cause the system to slow down as per SAP F1 help on "Log data changes" checkbox.
    description-"Note: Activating logging slows down accesses that change the table. First of all, a record must be written in the log table for each change. Secondly, many users access this log table in parallel. This could cause lock situations even though the users are working with different application tables."
    So we came to a solution where we can create a Z table and we will log the above mentioned Z table changes in the Z Change table but I have no idea how to implement the suggested solution. Please help me on this.
    Regards
    Amit

    Hi,
    Have a suggestion..
    Have custom fleld as LOG with char 1 and date field (sy-datum) in all the 8 ztables. The ztables are updated either through SM30 or from custom program, making sure who ever changes the record if manually then fill that flag field as 'X' and if by program then populate the field with value 'X'.So you will know based on the flag field whether changed or not.similarly for date field updatin as well.
    Now create a custom program to update the new ztable . Schedule this program daily may be at midnight..Read the 8 ztables with having flag = 'X' and update the new ztable. Once done clear the FLAG  from all the 8 ztables to space for that day and update the date field in the custom program.
    So for that particular day the records were written to new ztable and all the 8 ztables are having flag value as space and date will be sy-datum.
    Now for next day again do the same procedure.
    Hope this gives you an idea.
    Regards,
    Nagaraj

  • Why changes on cached tables can't be propagated to the Oracle tables?

    Dear all
    I have a Oracle database that i want cache its tables in two Timesten databases operated in two different PCs in a local network. There are all kinds of cache groups. When some changes are applied in
    TimesTen databases, propagation to oracle tables fails. This problem occur on global and SWT cache groups. My guess is something wrong about the TimesTen grid.
    Error is: [TimesTen][TimesTen 11.2.1.4.0 ODBC Driver][TimesTen]TT5025: Commit failure in Oracle. Transaction must be rolled back in TimesTen. -- file "sqlAPI.c", lineno 3277, procedure
    "sb_sqlCompileMulti1()"
    OS: windows xp sp3
    Timesten version: 11.2.1.4.0
    My Oracle: 11g
    Regards
    shahrokh
    Edited by: Shahrokh on Jun 13, 2012 8:54 PM

    It difficult to give you a recommendation without knowing the detail.
    If you have some level of node affinity in the TimesTen clients then Grid is the perfect solution. How do you know it's not fast enough without testing it?
    If you only have occasional updates to the data in the TimesTen clients then using Read-Only cache groups with PASSTHROUGH is the perfect solution. Updates happen on the TimesTen connection but are passed through to Oracle where at the next AUTOREFRESH they are propagated from Oracle to both TimesTen clients. But if you have a large volume of updates this is not a practical solution. If you do have a large volume of updates then you could send the updates directly to Oracle but this of course requires the application to have a connection to TimesTen and a connection to Oracle.
    Without more detail I suggest you try these 2 simple approaches to see which one works for you.
    What you are asking for is to replicate a change from a TimesTen database to an Oracle database then to another TimesTen database. This is very difficult to achieve with any replication technology. Others in this forum may have other ideas?
    Tim

  • Writing trigger for DML tracking on three table

    Hello,
    I need help on how can i write a trigger for updating backup table on DML changes on source table.
    I have source table named APP_SOURCE and backup table name APP_BACKUP with same data and structure.
    On any DML on source table APP_SOURCE it corresponding backup table APP_BACKUP should also be updated with same number of record changes on any DML
    (insert/update/delete) to maintain data consistency on both tables
    For cross refernce all changed DML records on source table APP_SOURCE should be tracked and stored within third table APP_SOURCEDMLTRACK storing old value and new value data before and after dml changes on source table APP_SOURCE
    source table create script:
    CREATE TABLE APP_SOURCE
    RCN_ID VARCHAR2(23 BYTE),
    CRD_NUM VARCHAR2(23 BYTE),
    TRN_TYP VARCHAR2(10 BYTE),
    TRN_DTE DATE,
    REF_NUM VARCHAR2(23 BYTE),
    TRN_CRR VARCHAR2(3 BYTE),
    TRN_AMT NUMBER(24,6),
    BLL_CRR VARCHAR2(3 BYTE),
    BLL_AMT NUMBER(16,2),
    BSN_DTE DATE,
    BRN_S VARCHAR2(10 BYTE),
    ACC_NUM_S VARCHAR2(24 BYTE),
    BRN_D VARCHAR2(10 BYTE),
    ACC_NUM_D VARCHAR2(24 BYTE),
    SRL_NUM VARCHAR2(12 BYTE),
    DVI_TYP VARCHAR2(8 BYTE),
    ORG_MSG_TYP VARCHAR2(6 BYTE),
    ACQ_CDE VARCHAR2(15 BYTE),
    ACQ_BIN VARCHAR2(11 BYTE),
    REV VARCHAR2(1 BYTE),
    DBCR_FLG VARCHAR2(1 BYTE),
    ATM_FEE NUMBER(16,2),
    ATM_ID VARCHAR2(16 BYTE),
    INT_FEE NUMBER(16,2),
    TRM_ID VARCHAR2(10 BYTE),
    MCN_CDE VARCHAR2(40 BYTE),
    MCN_INF VARCHAR2(40 BYTE),
    PNT_RCN_ID NUMBER(12),
    FGN_KEY VARCHAR2(23 BYTE),
    ERR_CDE VARCHAR2(200 BYTE),
    JNK VARCHAR2(50 BYTE),
    CRD_USED VARCHAR2(10 BYTE),
    RES_CDE VARCHAR2(3 BYTE),
    REA_CDE VARCHAR2(4 BYTE),
    PRC_CDE VARCHAR2(10 BYTE),
    MCC VARCHAR2(4 BYTE),
    APP_CDE VARCHAR2(8 BYTE),
    ISS_INS_ID VARCHAR2(11 BYTE),
    ACQ_INS_ID VARCHAR2(11 BYTE),
    ACQ_NET_CDE VARCHAR2(20 BYTE),
    ISS_NET_CDE VARCHAR2(20 BYTE),
    INST_ID VARCHAR2(60 BYTE),
    FIID1 VARCHAR2(20 BYTE),
    FIID2 VARCHAR2(20 BYTE),
    SWT_FLE VARCHAR2(50 BYTE),
    VIS_FLE VARCHAR2(50 BYTE),
    VIS_FLE_MCHDTE DATE,
    VIS_FLE_EODDTE DATE,
    VIS_FLE_RCNTYP NUMBER(2),
    VIS_FLE_ACNTID VARCHAR2(35 BYTE),
    MAS_FLE VARCHAR2(50 BYTE),
    MAS_FLE_MCHDTE DATE,
    MAS_FLE_EODDTE DATE,
    MAS_FLE_RCNTYP NUMBER(2),
    MAS_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE1_FLE VARCHAR2(50 BYTE),
    TIE1_FLE_SRC VARCHAR2(50 BYTE),
    TIE1_FLE_MCHDTE DATE,
    TIE1_FLE_EODDTE DATE,
    TIE1_FLE_RCNTYP NUMBER(2),
    TIE1_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE2_FLE VARCHAR2(50 BYTE),
    TIE2_FLE_SRC VARCHAR2(50 BYTE),
    TIE2_FLE_MCHDTE DATE,
    TIE2_FLE_EODDTE DATE,
    TIE2_FLE_RCNTYP NUMBER(2),
    TIE2_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE3_FLE VARCHAR2(50 BYTE),
    TIE3_FLE_SRC VARCHAR2(50 BYTE),
    TIE3_FLE_MCHDTE DATE,
    TIE3_FLE_EODDTE DATE,
    TIE3_FLE_RCNTYP NUMBER(2),
    TIE3_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE4_FLE VARCHAR2(50 BYTE),
    TIE4_FLE_SRC VARCHAR2(50 BYTE),
    TIE4_FLE_MCHDTE DATE,
    TIE4_FLE_EODDTE DATE,
    TIE4_FLE_RCNTYP NUMBER(2),
    TIE4_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE5_FLE VARCHAR2(50 BYTE),
    TIE5_FLE_SRC VARCHAR2(50 BYTE),
    TIE5_FLE_MCHDTE DATE,
    TIE5_FLE_EODDTE DATE,
    TIE5_FLE_RCNTYP NUMBER(2),
    TIE5_FLE_ACNTID VARCHAR2(35 BYTE),
    TIE6_FLE VARCHAR2(50 BYTE),
    TIE6_FLE_SRC VARCHAR2(50 BYTE),
    TIE6_FLE_MCHDTE DATE,
    TIE6_FLE_EODDTE DATE,
    TIE6_FLE_RCNTYP NUMBER(2),
    TIE6_FLE_ACNTID VARCHAR2(35 BYTE),
    EJ_FLE VARCHAR2(50 BYTE),
    EJ_FLE_MCHDTE DATE,
    EJ_FLE_EODDTE DATE,
    EJ_FLE_RCNTYP NUMBER(2),
    EJ_FLE_ACNTID VARCHAR2(35 BYTE),
    BTH_FLE VARCHAR2(50 BYTE),
    BTH_FLE_MCHDTE DATE,
    BTH_FLE_EODDTE DATE,
    BTH_FLE_RCNTYP NUMBER(2),
    BTH_FLE_ACNTID VARCHAR2(35 BYTE),
    BRN_ISS_FLE VARCHAR2(50 BYTE),
    BRN_ISS_FLE_MCHDTE DATE,
    BRN_ISS_FLE_EODDTE DATE,
    BRN_ISS_FLE_RCNTYP NUMBER(2),
    BRN_ISS_FLE_ACNTID VARCHAR2(35 BYTE),
    BRN_ACQ_FLE VARCHAR2(50 BYTE),
    BRN_ACQ_FLE_MCHDTE DATE,
    BRN_ACQ_FLE_EODDTE DATE,
    BRN_ACQ_FLE_RCNTYP NUMBER(2),
    BRN_ACQ_FLE_ACNTID VARCHAR2(35 BYTE),
    TRNACC_ID VARCHAR2(21 BYTE),
    PRT_TRNACC_ID VARCHAR2(35 BYTE),
    PROCESS_ID VARCHAR2(20 BYTE),
    SWT_VCH1_NUM VARCHAR2(100 BYTE),
    SWT_VCH2_NUM VARCHAR2(100 BYTE),
    SWT_VCH3_NUM VARCHAR2(100 BYTE),
    SWT_VCH4_NUM VARCHAR2(100 BYTE),
    SWT_VCH5_NUM VARCHAR2(100 BYTE),
    SWT_VCH1A_NUM VARCHAR2(100 BYTE),
    SWT_VCH2A_NUM VARCHAR2(100 BYTE),
    SWT_VCH3A_NUM VARCHAR2(100 BYTE),
    SWT_VCH4A_NUM VARCHAR2(100 BYTE),
    SWT_VCH5A_NUM VARCHAR2(100 BYTE),
    SWT_VCH1B_NUM VARCHAR2(100 BYTE),
    SWT_VCH2B_NUM VARCHAR2(100 BYTE),
    SWT_VCH3B_NUM VARCHAR2(100 BYTE),
    SWT_VCH4B_NUM VARCHAR2(100 BYTE),
    SWT_VCH5B_NUM VARCHAR2(100 BYTE),
    SWT_VCH1C_NUM VARCHAR2(100 BYTE),
    SWT_VCH2C_NUM VARCHAR2(100 BYTE),
    SWT_VCH3C_NUM VARCHAR2(100 BYTE),
    SWT_VCH4C_NUM VARCHAR2(100 BYTE),
    SWT_VCH5C_NUM VARCHAR2(100 BYTE),
    SWT_VCH1D_NUM VARCHAR2(100 BYTE),
    SWT_VCH2D_NUM VARCHAR2(100 BYTE),
    SWT_VCH3D_NUM VARCHAR2(100 BYTE),
    SWT_VCH4D_NUM VARCHAR2(100 BYTE),
    SWT_VCH5D_NUM VARCHAR2(100 BYTE),
    SWT_VCH1E_NUM VARCHAR2(100 BYTE),
    SWT_VCH2E_NUM VARCHAR2(100 BYTE),
    SWT_VCH3E_NUM VARCHAR2(100 BYTE),
    SWT_VCH4E_NUM VARCHAR2(100 BYTE),
    SWT_VCH5E_NUM VARCHAR2(100 BYTE),
    SWT_VCH1F_NUM VARCHAR2(100 BYTE),
    SWT_VCH2F_NUM VARCHAR2(100 BYTE),
    SWT_VCH3F_NUM VARCHAR2(100 BYTE),
    SWT_VCH4F_NUM VARCHAR2(100 BYTE),
    SWT_VCH5F_NUM VARCHAR2(100 BYTE),
    SWT_VCH1G_NUM VARCHAR2(100 BYTE),
    SWT_VCH2G_NUM VARCHAR2(100 BYTE),
    SWT_VCH3G_NUM VARCHAR2(100 BYTE),
    SWT_VCH4G_NUM VARCHAR2(100 BYTE),
    SWT_VCH5G_NUM VARCHAR2(100 BYTE),
    SWT_VCH1H_NUM VARCHAR2(100 BYTE),
    SWT_VCH2H_NUM VARCHAR2(100 BYTE),
    SWT_VCH3H_NUM VARCHAR2(100 BYTE),
    SWT_VCH4H_NUM VARCHAR2(100 BYTE),
    SWT_VCH5H_NUM VARCHAR2(100 BYTE),
    SWT_VCH1I_NUM VARCHAR2(100 BYTE),
    SWT_VCH2I_NUM VARCHAR2(100 BYTE),
    SWT_VCH3I_NUM VARCHAR2(100 BYTE),
    SWT_VCH4I_NUM VARCHAR2(100 BYTE),
    SWT_VCH5I_NUM VARCHAR2(100 BYTE),
    VIS_VCH_NUM VARCHAR2(100 BYTE),
    MAS_VCH_NUM VARCHAR2(100 BYTE),
    TIE1_VCH_NUM VARCHAR2(100 BYTE),
    TIE2_VCH_NUM VARCHAR2(100 BYTE),
    TIE3_VCH_NUM VARCHAR2(100 BYTE),
    TIE4_VCH_NUM VARCHAR2(100 BYTE),
    TIE5_VCH_NUM VARCHAR2(100 BYTE),
    TIE6_VCH_NUM VARCHAR2(100 BYTE),
    EJ_VCH_NUM VARCHAR2(100 BYTE),
    BTH_VCH_NUM VARCHAR2(100 BYTE),
    BRN_ISS_VCH_NUM VARCHAR2(100 BYTE),
    BRN_ACQ_VCH_NUM VARCHAR2(100 BYTE),
    PAR_DTE DATE,
    EOD_DTE1 DATE,
    EOD_DTE2 DATE,
    FILLER1 VARCHAR2(4000 BYTE),
    FILLER2 VARCHAR2(4000 BYTE),
    FILLER3 VARCHAR2(4000 BYTE),
    BRM_LINKID1 VARCHAR2(20 BYTE),
    BRM_LINKID2 VARCHAR2(20 BYTE),
    BRN_ACQ_FLE_ORG VARCHAR2(50 BYTE),
    CRM_TRACK_FLAG VARCHAR2(20 BYTE),
    DIFF_AMT NUMBER(16,2),
    IS_RCN NUMBER(1),
    MCH_DTE DATE,
    MIGRATION_FLAG VARCHAR2(50 BYTE),
    NET_CDE VARCHAR2(20 BYTE),
    TRACK_FLAG VARCHAR2(100 BYTE),
    TRN_MM VARCHAR2(2 BYTE),
    TRN_YY VARCHAR2(4 BYTE),
    MOVE_FLAG VARCHAR2(15 BYTE),
    PURGE_FLAG NUMBER(2),
    REV_FLAG NUMBER(1),
    TEMPVCH_LOCK_DTE DATE
    Please provide me any refernce on web or document which i can implement or code on how to code the required trgger.
    Regards,
    Ganesh

    Perhaps you should consider using Materialized View Replication.
    http://docs.oracle.com/cd/E11882_01/server.112/e10706/repoverview.htm#autoId9
    Instead of writing triggers, you put a materialized view log on your source table. Then you can turn your backup table into a materialized view that is based on the source table. When you perform a fast refresh of the backup table MV, it will read the MV log on the source table. Refreshes should take almost no time at all to process.
    If the data must be absolutely up-to-date at all times, you can use refresh on commit so that the MV is always in synch with the table. Normally I recommend against using refresh on commit, and instead recommend a short refresh interval.
    You can use triggers as you suggest, but it seems simpler to use something like MVs to create a shadow table.

  • Where to find Trigger failed logs.

    Hello friends and Gurus,
    Where can we find the logs, if one trigger failed due to any reasons ?
    I can give one test example,
    First I created one table in Scott schema.
    CREATE TABLE TEMP (SRNO NUMBER PRIMARY KEY,
    DESCRIPTION VARCHAR2(50));
    Second I created a "Logoff on schema" trigger in Scott.
    CREATE OR REPLACE TRIGGER SAMPLE1 BEFORE
    LOGOFF ON SCHEMA
    BEGIN
    INSERT INTO TEMP VALUES (1, 'Message..............');
    END;
    When first time I exit from SQL plus, the trigger inserted the values to Temp table.
    Second time I changes the connection.
    Conn / as sysdba
    It gave the following error.
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00001: unique constraint (SCOTT.SYS_C003212) violated
    ORA-06512: at line 2
    ERROR:
    ORA-24313: user already authenticated
    Warning: You are no longer connected to ORACLE.
    This is fine. It won't allow me to connect to another user.
    But when I exit from SQL plus it allowed me to exit with out giving me any messages or warnings, the trigger has been failed because unique constraint violated.
    I am anticipating the response.

    OK i found them.
    I add a dehydration too, and now i can see a real reson of fault: <faultstring>Waiting for response has timed out.
    Now its only to find where to configure a "response timeout"

Maybe you are looking for

  • Connect unmanaged clients to Software Update Services 10.8.4

    Software Update Services 10.8.4 I cannot get unmanaged clients to connect to my ML Software Update Service I tried the following versions: sudo defaults write com.apple.SoftwareUpdate CatalogURL http://my.sus.local:8088/ sudo defaults write com.apple

  • Select Apps to appear in 'Open In'

    It appears that iPad limits only 10 apps to appear in the 'Open In' menus (e.g., the menu in the mail client). Is there any way of selecting which apps will appear here? E.g., I used to be able to see GoodReader as one of the options, but now it is g

  • Recording Graduations, creative tips, and advice

    Recording Graduations, creative tips, and advice. Can someone direct me to some where I can find real creative graduation footage tips and advice. I have a proposal to make to a school and I do not want it to look like a traditional recording for a g

  • Failed when installing windows and linux on my lenovo laptop E440

    Good day, I have a problem with my lenovo Thinkpad E440 Laptop. The laptop and brings the windows installed by default but I need to install linux and also have both systems on the machine. That said I do the preceded the installation of linux and I

  • Where has the secure connection gold lock gone?

    How do I know now whether a page I am visiting is secure? Just by looking at the https header? This doesn't tell me whether there is a problem with the integrity of the connection, like the old golden lock did. I will feel very insecure using Firefox