Thursday, November 1, 2012

Lifecycle management fails to migrate data completely

Lifecycle Management is the widely used option to export application artifacts for migration and backup. Starting 11.1.2 LCM also offers the ability to export data and can be selected while defining the migration definition.  
I wanted to setup a backup process to export application artifacts and used LCM. All seemed OK until I encountered an issue with LCM and wanted to share via this article. Lets reiterate the steps I followed and identify the error ourselves.
I selected all artifacts including data.


I defined the migration to export all the artifacts to file system and scheduled it to run as a job to export all the artifacts on Essbase server.
Just to brief  you on how to do achieve this is to write a batch script which calls the LCM command line utility with migration definition xml and path to export all the artifacts to desired location. On testing it, everything executed well as scheduled.

It was after few days when my scheduled job failed to run because there was not enough memory on C:\ drive of the machine. On drilling into each folder based on its size, I reached to a directory Users\<username>\Appdata\Local\Temp and found it had grown a lot in size. There I found bunch of temp files each of almost same size and created at the same time when my backup process was scheduled to run.


I could not open the big file in text editor due to its size, but going through the other files (audit and cssxml) seemed something related to Essbase. Just to test a vague thing, I exported the whole data from my Essbase application to be surprised to find out that the export created two files and one of them was of the same size as the temp file left behind under Temp directory.


To test it, I opened the Temp directory and started the LCM utility to export all the artifacts. When LCM utility is running export and reaches step to export data, it first exports all data under the Temp directory and then moves it to export location.



This is where Oracle did not code the LCM utility intelligently to pick both files. LCM moves the first file to the export location and renames it Data and the second file with same name but a '_1' suffixed is left behind under the Temp directory. Thus we have all the artifacts but incomplete data exported using LCM.
Hope it helps !!!