audit-trail

How do you create an audit trail for aggregate roots?

我的梦境 提交于 2019-12-08 08:28:33
问题 I have read several articles online as well as several answers on StackOverflow about creating an audit trail for a database driven application. It seems that the most popular solution is to create an audit table for the table in question and use triggers to insert an audit record into the audit table. I can see how this would work well for simple entities whose data is contained in one table. What about aggregate roots that contain children? Example: Order is an aggregate root containing

Building a snapshot table from audit records

只愿长相守 提交于 2019-12-07 20:40:35
问题 I have a Customer table with the following structure. CustomerId Name Address Phone 1 Joe 123 Main NULL I also have an Audit table that tracks changes to the Customer table. Id Entity EntityId Field OldValue NewValue Type AuditDate 1 Customer 1 Name NULL Joe Add 2016-01-01 2 Customer 1 Phone NULL 567-54-3332 Add 2016-01-01 3 Customer 1 Address NULL 456 Centre Add 2016-01-01 4 Customer 1 Address 456 Centre 123 Main Edit 2016-01-02 5 Customer 1 Phone 567-54-3332 843-43-1230 Edit 2016-01-03 6

Firebird - get all modified fields inside a trigger

ε祈祈猫儿з 提交于 2019-12-06 19:22:44
问题 I need to get all the values which changed in a row and post modifications on other 'audit' table. Can I accomplish this, without writing the conditions for each element from the row? I know the SQL from http://www.firebirdfaq.org/faq133/ which gives you all the conditions for verifications: select 'if (new.' || rdb$field_name || ' is null and old.' || rdb$field_name || ' is not null or new.' || rdb$field_name || 'is not null and old.' || rdb$field_name || ' is null or new.' || rdb$field_name

Building a snapshot table from audit records

这一生的挚爱 提交于 2019-12-06 04:08:33
I have a Customer table with the following structure. CustomerId Name Address Phone 1 Joe 123 Main NULL I also have an Audit table that tracks changes to the Customer table. Id Entity EntityId Field OldValue NewValue Type AuditDate 1 Customer 1 Name NULL Joe Add 2016-01-01 2 Customer 1 Phone NULL 567-54-3332 Add 2016-01-01 3 Customer 1 Address NULL 456 Centre Add 2016-01-01 4 Customer 1 Address 456 Centre 123 Main Edit 2016-01-02 5 Customer 1 Phone 567-54-3332 843-43-1230 Edit 2016-01-03 6 Customer 1 Phone 843-43-1230 NULL Delete 2016-01-04 I have a CustomerHistory reporting table that will be

Firebird - get all modified fields inside a trigger

烈酒焚心 提交于 2019-12-05 01:10:21
I need to get all the values which changed in a row and post modifications on other 'audit' table. Can I accomplish this, without writing the conditions for each element from the row? I know the SQL from http://www.firebirdfaq.org/faq133/ which gives you all the conditions for verifications: select 'if (new.' || rdb$field_name || ' is null and old.' || rdb$field_name || ' is not null or new.' || rdb$field_name || 'is not null and old.' || rdb$field_name || ' is null or new.' || rdb$field_name || ' <> old.' || rdb$field_name || ') then' from rdb$relation_fields where rdb$relation_name =

Log User Activity on ASP.NET MVC Application

十年热恋 提交于 2019-12-03 02:02:05
问题 Is there A good strategy to Log the User activity on an ASP MVC App? (ActionFilters/ HTTPModules). Something like last user activity (just like StackOverflow "Seen 23 mins ago"), and even what Pages and Controllers were used, and pushing even further what buttons or links were clicked. I have ELMAH installed but as far as i know its just for Error Logging. PD: Google Analytics is not an option. 回答1: You could try using a PostSharp aspect to perform the logging for you, it's multi-cast

Log User Activity on ASP.NET MVC Application

南笙酒味 提交于 2019-12-02 15:37:51
Is there A good strategy to Log the User activity on an ASP MVC App? (ActionFilters/ HTTPModules). Something like last user activity (just like StackOverflow "Seen 23 mins ago"), and even what Pages and Controllers were used, and pushing even further what buttons or links were clicked. I have ELMAH installed but as far as i know its just for Error Logging. PD: Google Analytics is not an option. Rory You could try using a PostSharp aspect to perform the logging for you, it's multi-cast functionality might come in handy for something like that. If it's not an option, then a Module would probably

Access 2010 Audit Trail on SubForms

坚强是说给别人听的谎言 提交于 2019-12-01 12:52:41
I am having trouble getting the code I found for an audit trail to work with sub forms. The origninal code is from http://www.fontstuff.com/access/acctut21.htm . I would rather stick to this code than using Allen Browne's code http://allenbrowne.com/appaudit.html . It seems to be a problem with Screen.ActiveForm.Controls . I have read that this does not work with sub forms. Is there a way I can alter this to audit a sub form in my database? When I record the data in the sub form, I get the following error: Microsoft can't find the field "CalSubID" referred to in your expression." In a module I

Change Data Capture or Change Tracking - Same as Traditional Audit Trail Table?

牧云@^-^@ 提交于 2019-12-01 03:32:07
Before I delve into the abyss of Microsoft documentation any deeper, I'd like to know if someone experienced with Change Data Capture and Change Tracking know if one or both of these can be used to replace the traditional ... "Audit trail table copy of the 'real table' (all of the fields of the original table, plus date/time, user ID, and DML action field) inserted into by Triggers" ... setup for a database table audit trail, where the trigger populates the audit trail table (which is all manual work). The MSDN overview documentation explains at a high level what Change Data Capture and Change

Creating a global trigger that listens to multiple tables

霸气de小男生 提交于 2019-11-30 17:31:00
问题 I want to create a global trigger in Oracle 11g. Which can be used for auditing of around 100 tables. Can multiple tables fire a single trigger. If yes then how can I achieve this? 回答1: I want to create a global trigger in oracle 11g ,which can be used for auditing of around 100 tables Is there a reason you want to reinvent the wheel? Why not make use of Oracle's inbuilt auditing? Oracle Base provides some basic info as to how to get started on Auditing: Auditing can enabled by setting the