recovering data from overwriting leaf with consolidation

Post Reply
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

recovering data from overwriting leaf with consolidation

Post by fleaster »

Ok, so I've just made the rookie mistake of attaching a leaf element to another leaf element that already had data in it - thereby making it a consolidation and losing all the cube data associated with it :(

Any ideas on what the best way is to recover everything?

Thankfully I did a Save data several minutes before the error, so I was considering bringing the service down, renaming the last backup dimension file (with the date extension) to the main file, then restarting the service ( i.e. rename "ProductProcessor.dim.20141128024359" to "ProductProcessor.dim" )

...anyone have other thoughts, or is this the only way to go...? :)

Regards,

Matt
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: recovering data from overwriting leaf with consolidation

Post by kangkc »

Must say it's a terrible mistake. You probably realized by now by changing the element back to N doesn't get back you data. Hence by restarting and revert the dimension changes will not help either.

You can't use transaction log as you have no idea how far back to apply restore using transaction log.

Only choice to me is to find the latest backup of the cube backup and restore the cube. But before that make sure you revert the dimension changes as well.
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Re: recovering data from overwriting leaf with consolidation

Post by fleaster »

hehe yes, I am a little red faced... :)

What I did was NOT to Save Data before shutting down the service (as I'd already saved data a few minutes prior to the change), I then reverted back to yesterday's backup .dim file, then restarted the service.

Luckily there had been no Leaf changes to the dimension file this morning, so no cube data was invalidated... phew... close call =)
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: recovering data from overwriting leaf with consolidation

Post by lotsaram »

kangkc wrote:Must say it's a terrible mistake. You probably realized by now by changing the element back to N doesn't get back you data. Hence by restarting and revert the dimension changes will not help either.
... not necessarily ....
If a save data had been done with the old dimension structure and the dimension then changed to convert N to C then this doesn't re-write the .cub and .feeders files. If the server was brought down (with no action in-between to cause a data change to any affected cubes) and the .dim file replaced with the old one then the server brought back up then this would in theory restore the data. I have seen this work before. (also in a backwards and unintended fashion where dimension elements were deleted as a shortcut to deleting data as cubes were very large and so zeroouts took too long, after elements were re-inserted and the server restarted data reappeared in cubes where there had been no data change and update of the .cub file)

So restore from this scenario *can* be quite simple and quick but it depends very much how soon the error is realized and action taken. Recovery fro something like this is never without risk.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Gabor
MVP
Posts: 170
Joined: Fri Dec 10, 2010 4:07 pm
OLAP Product: TM1
Version: [2.x ...] 11.x / PAL 2.1.13
Excel Version: Excel 2016-2021-365
Location: Germany

Re: recovering data from overwriting leaf with consolidation

Post by Gabor »

It's all about the time stamp of the .cub file. If this one is older than your change, which has damaged the .dim, you will be able to recover your data as lotsaram described it.
kangkc
Community Contributor
Posts: 206
Joined: Fri Oct 17, 2008 2:40 am
OLAP Product: TM1, PA , TMVGate
Version: 2.x
Excel Version: 36x
Location: Singapore
Contact:

Re: recovering data from overwriting leaf with consolidation

Post by kangkc »

lotsaram wrote:
kangkc wrote:Must say it's a terrible mistake. You probably realized by now by changing the element back to N doesn't get back you data. Hence by restarting and revert the dimension changes will not help either.
... not necessarily ....
If a save data had been done with the old dimension structure and the dimension then changed to convert N to C then this doesn't re-write the .cub and .feeders files. If the server was brought down (with no action in-between to cause a data change to any affected cubes) and the .dim file replaced with the old one then the server brought back up then this would in theory restore the data. I have seen this work before. (also in a backwards and unintended fashion where dimension elements were deleted as a shortcut to deleting data as cubes were very large and so zeroouts took too long, after elements were re-inserted and the server restarted data reappeared in cubes where there had been no data change and update of the .cub file)

So restore from this scenario *can* be quite simple and quick but it depends very much how soon the error is realized and action taken. Recovery fro something like this is never without risk.
Well..I remember having this working as what you have described in 9.x world.

Before replying fleaster I did a test on 10.2.2 to make sure.
But on 10.2.2 I am not seeing the same behaviour. I did a change from N to C, and from C back to N, all N data was wiped out.
No save data, data input, restart in between. It's a simple element property change.

I went on further testing by using rule to override the N element with dummy data. As soon as rule statement is removed, I get back my original N level entered data. Similar mistake but different results.
Confusing enough but this is what I am seeing in 10.2.2.

That's why I suggested to change from C back to N to see if fleaster managed to get back the data, else restore cub seems to be the only way out.
fleaster
Regular Participant
Posts: 167
Joined: Wed Mar 30, 2011 11:57 pm
OLAP Product: TM1
Version: 10.2.2
Excel Version: XL2010

Re: recovering data from overwriting leaf with consolidation

Post by fleaster »

kangkc wrote: That's why I suggested to change from C back to N to see if fleaster managed to get back the data, else restore cub seems to be the only way out.
Hi kangkc, I did try changing it back from C to N, but no success - the data was already gone.

However, I was able to recover everything by immediately bringing down the server and restoring a backup .dim file - and found that the cube data was all ok (nothing missing).

However, as lotsaram & Gabor alluded to earlier, this was only successful for me because:
1. I detected the mistake within a few minutes of the dimension maintenance
2. A save data had been done earlier in the day
3. No cube data had changed between #1 and #2

...so I was lucky to dodge this bullet :)
Post Reply