We had a major network and system outage yesterday and, to cut a long and painful story short, some tables in ODS were corrupted (unfortunately it was not possible to see which ones), which had the knock-on effect of stopping Datasourcer from working.
My main concern was getting Datasourcer working again, so I restored the previous evening's backup of ODS. I knew some issues would arise from this but better to at least have some data being captured!
Now ODS and Datamart are obviously out of sync and I have the situation where chunks are being marked as transferred in DMA with a date earlier than they were recieved. I also see the following error in the ETL logs:
[i]ETL_Trans_Only*:* 02:33:46.614 Thread.DstChunkWritersManager java.sql.BatchUpdateException: Violation of PRIMARY KEY constraint 'PK_CHUNK_LOG'. Cannot insert duplicate key in object 'dbo.CHUNK_LOG'.[/i]
I guess when Datasourcer started collecting data again, it assigned "new" chunk IDs to each chunk, but when ETL tries to transfer them to Datamart, the chunk IDs correspond to earlier data which had already been transferred. And DMA obviously picks up the transfer time from the END_WRITE column in Datamart's CHUNK_LOG table.
What I need to do is try and get any data that hasn't been deleted from ODS since yesterday over into Datamart. I know the chunk IDs of this data but what I don't know is whether I can simply:
1. Change the transfer time to NULL for those records in ODS which it thinks have been transferred but which I know contain new data;
2. Remove the records with corresponding chunk IDs from Datamart's CHUNK_LOG table
3. Run ETL and let it do its stuff
I know from reading previous posts that a few people here have had to try similar things so the benefit of any wisdom before I make things worse would be great!!