Hi, the requirement is to keep all transactions that have occured on the the database. Is it better to insert a new record in the existing schema and then mark the old record 'inactive'? Or would it be better to archive the old record to a different table(s)?
The problem with the first approach is that the relationships are no longer true to the intention of the database. For example a one to one relationship must become one to many, as there would then be many entries (due to the archvied data) in the second table. The problem with archiving to a different table is I think I have to recreate a new table for each table in the schema to archive into.
You need to consider how the data steward thinks of their data. Do they think of data consistency in terms of a snapshot in time, or is it a continuous function? Do they only consider current data to be meaningful, or do they need some period of history? All of the approaches you mentioned are valid under some circumstances, but probably only one of them applies in any given set of circumstances.
For More Information
- Dozens more answers to tough database design questions from Pat Phelan are available here.
- The Best Database Design Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your database design -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
Dig Deeper on Oracle database design and architecture
Related Q&A from Pat Phelan
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.