How to remove Deletion Stubs from a database ?

Hi everyone,

I have a might big problem. I have a database that had a ton of document deleted from it. I can restore thoses documents (I know which one were deleted) from a tape backup copy of the database.

Problem is, after copying the documents from my backup copy to the live copy, the first time it replicate : all the documents are deleted again ...

The answer is pretty simple : it's because the deletion stubs have been copied over to the other replicas ...

Is there a way to remove the stubs from the replicas ? I cannot aford to change the Document Unique IDs simply because there is another database that uses doc-links to that database. I cannot afford either to "flush" the other replicas and create a fresh replica over because the database size is over 700 megs.

Thanks for any help you can provide ;-)

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

We had this problem - BIG problem - when an automated agent accidentally deleted about 200 names from our Public Address Book!  (Of course, all the important executives.)  Here's what we did - and the beauty of it is that you don't need to replicate anything with the live database - totally safe (well, as near totally as possible if you're careful).

1. restore replica of database from backup onto some location where it can't possibly replicate with the live database - I'll call this REPLICA A
2. create replica of the live database with deletions - I'll call this REPLICA B
3. purge deletion stubs from REPLICA B.  (How to do this, see below.)
4. now delete everything from REPLICA B - all documents, everything.
5. REPLICA B now contains only deletion stubs, for all documents EXCEPT the ones that REPLICA A is missing (because you already purged the deletion stubs for those).
6. Replicate REPLICA B with REPLICA A.
7. Now, because of the deletion stubs in step 5, REPLICA A will only be left with the documents that were missing from the live database.
8. These documents can be cut and pasted back to the original live database.  (If you want to live dangerously you could purge the replication stubs again and replicate REPLICA A with the live database, but just in case something goes wrong... I'd recommend cut&paste so there's no risk.)

Ta da!

How to purge deletion stubs - you'd best consult your reference books to double check, I didn't do this step myself, but I understand that when the Purge Interval is set to 0, the purge is immediate.  This is set in the SpaceSaver's section of the database's Replication Settings dialog box.  The line "remove documents not modified in the last..." serves a dual purpose.  When the box is checked, documents are removed and the Purge Interval is one third of the number in the box.  When the box is not checked, documents are not removed but the purge interval is still one third of the number specified.

I am not sure once you change the purge interval if that's all, or if you need to UPDALL or COMPACT the database first - but this is easy to test.

This worked on our Public Address Book which is 100 Mb - I hope it's workable for your 700 Mb database because if not I can't think of any other solution!

Hope this helps you,


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ah - I just re-reread your question and realised I thought you were asking a slightly different question.  However I hope the Purge Interval settings I mentioned might solve your problem?

mchampouAuthor Commented:
No you are right on the money, you understood my need.

I will need to test this before I can give you the points. Is that ok with you ?

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Sure thing!  Good luck!!

mchampouAuthor Commented:
Thanks for your help, your answer helped me fix our problem.

Sincere thanks !

My pleasure!  Glad our pain and panic could be of help to you!  Just gives ya warm fuzzies thinking about it.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.