MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

History data

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Wed Apr 09, 2014 10:13 am    Post subject: History data Reply with quote

currently we store history data on the same table. when a table row is updated we don't actually update it, we end date existing row and insert a new row with the changed data.

I know that log trigger tables are an alternative to this, so the "main" table has only one row per "instance" so to speak.

Are these temporal tables an alternative to this too? how do they do that?

Thanks!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Apr 09, 2014 1:29 pm    Post subject: Reply with quote

sumithar,

How about writing the deleted record to a GDG ? You would have a daily generation with the deleted records and the at end of the month you run another job to create a monthly generation which deletes all the daily generations once merged. You would have similar process for the year end where it takes all the monthly generations and then creates 1 yearly generation.

Since you are writing to a file you can have all the identifiers like current timestamp to identify when the record is written to the file

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Thu Apr 10, 2014 2:35 pm    Post subject: Reply with quote

kolusu wrote:
sumithar,

How about writing the deleted record to a GDG ? You would have a daily generation with the deleted records and the at end of the month you run another job to create a monthly generation which deletes all the daily generations once merged. You would have similar process for the year end where it takes all the monthly generations and then creates 1 yearly generation.

Since you are writing to a file you can have all the identifiers like current timestamp to identify when the record is written to the file

Kolusu


Thanks Kolusu. Not sure what you mean by the "deleted" row? Are you talking about the row before the update happens? Instead of writing it out into a log trigger table, write it out into a file?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Apr 10, 2014 3:05 pm    Post subject: Reply with quote

sumithar wrote:
Are you talking about the row before the update happens? Instead of writing it out into a log trigger table, write it out into a file?


Yes.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sumithar
Beginner


Joined: 22 Sep 2006
Posts: 84
Topics: 29

PostPosted: Mon Apr 14, 2014 6:41 pm    Post subject: Reply with quote

kolusu wrote:
sumithar wrote:
Are you talking about the row before the update happens? Instead of writing it out into a log trigger table, write it out into a file?


Yes.

Kolusu


That's viable too, but with the log trigger, that process is automated for me, isn't it? If push comes to shove I can always unload the history table to a file and load replace it periodically, especially if it's partitioned, as part of a periodic purge/archive.

I have done some reading about these temporal tables, they are somewhat similar in approach too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group