What to do when Changing Metadata
When the continuous LogMiner runs it first attaches to the database and reads the metadata to understand the current structure of tables. It only reads information about the current version of each row for each table. It does this one time when it starts. It does not go back and reread metadata.
This means that when you change the metadata in your database you must shut down any JCC LogMiner Loader sessions you are running and restart the LogMiner when you are done.
If the Loader is processing data for the table for which metadata is being changed you must also update the Loader’s control file to include a proper description of the new version of rows for that table.
There is a deeper implication though. When you shut down the Loader family after emptying all the journals, the checkpoint data will contain the AERCP which includes information about the last quiet point. This will be somewhere towards the end of the journal but not exactly at the end because the LogMiner does not send a new AERCP to the Loader until it actually sends a transaction. This means that upon restart the LogMiner will restart in the middle of existing journals.
It is altogether possible when starting from that earlier AERCP that the LogMiner can encounter a row for a table where the metadata has changed. In this case, the LogMiner will fail with a message about unknown table versions.
There are two ways to deal with this:
- You can use a logical name that is processed by the Loader to tell the LogMiner to ignore unknown versions of rows. The method of doing that is currently documented in the section titled “A Rare Exception: Old Table Versions”.
$ define JCC_ADD_CLM_IGNORE_OLD_VERSION_TABLES *
You should be sure that you remove this after restarting to be sure that you do not have a surprise later. - After making your metadata changes and before restarting the application and Loader session, backup the journals with a quiet point backup and modify your loader session to restart its work from the live journals. This will ignore any older backup AIJs that it would normally encounter as they may contain information about tables whose metadata has changed. This is documented in the Loader documentation section titled “Overrides in the Run Command”. Basically you would add “checkpoint live” to the JCC_RUN_CLM_LML command.
Be absolutely sure you remove this after restarting so you do not accidentally skip data at some future time