How to restore archived data back into their tables.

Document ID : KB000009589
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

A common practice in many firms is to take copies of data in CA Datacom databases for archival purposes. There are many ways to accomplish this, and while we would recommend that customers use the CA Datacom/DB utility program called DBUTLTY to take this backup, other programs like ADRDSSU (DFDSS) or FDR are often used.

This presents a challenge for customers who have made significant changes to the database structure since the backup was taken, as restoring these backup files will result in a mismatch between the data and the definition. 

Background:

The best way to view this situation is not that you will restore the data back into the same database from which it came - because the data definition is now different - but to look at this old data as an external data store - like data being imported into CA Datacom/DB databases from another DBMS, or being provided from an outside source. This will allow you to keep your current data and definitions intact and still access this old data.

Instructions:

To do this, you will need to do the following:

  1. Create new tables in Datadictionary as they would have looked at the time of the backup - we recommend that you use a new Database/Area/Table to keep from altering current data and definitions. One way is to create a BTG file of the database from the Datadictionary as it was then. You would use the command (after defining your desired path) -BTG DATABASE,databasename(ASOF),pathname,YYYYMMDDhhmm - where YYYY is the year, MM is the month, DD is the day, hh is the hour and mm is the minute. This date and time should reflect the date and time that the data backup was taken. If this works, you should then change the unique identifiers like DBID, Area ID or Table IDs (the 3-character code) to create a new database for this old data. 
  2. Catalog the database and allocate new files for the new database as usual.
  3. Use ADRDSSU, FDR or some other utility program to restore this old backup to the new database files;
  4. Perform whatever tasks are necessary to access and report on the data.

The main task for this project is to identify the correct data structure in use at the time of the backup. If the above does not work other options would be:

  • Find a dataview that was in use then (some firms never change a dataview, but instead create new ones when changes are made)
  • Find a program listing that was made with the old data definitions
  • Find a Datadictionary table listing from that time
  • Restore a backup of the Datadictionary taken at that time and create the BTG from that active Datadictionary. Note that you should backup the current Datadictionary (both DB 2 and 15) and the CXX, so you can restore your environment after getting the BTG.
Additional Information:

In order to avoid this problem in the future, one process we would recommend is to:

  1. Use DBUTLTY to EXTRACT the data for each table into a file.
  2. Create a simple text file with the layout of the table, and explanations of the fields if necessary.
  3. Use ADRDSSU, FDR or some other utility to create a backup of the data and metadata together.

As always, please contact CA Technologies support for CA Datacom if you have further questions.

***