need help with a view

Posted on 2009-07-07
Medium Priority
Last Modified: 2013-11-17
Hi Guys,

Two weeks ago our stupid backup software went nuts used all the free disk space on our server, this somehow it seems has corrupted a notes database. About 10% of the documents in the database have gone AWOL, meaning clicking in views for them, even after fixup and compacting and re-indexing are coming up with 'non existant document'

So what I intend to do, is replace the current damaged database with my last known good version, and bring across all undamaged docs that have been modified in the last 2 weeks from the damaged DB.
I obviously want to avoid then ending up with a load of dupe's in my final DB.
I've created a view in the damaged DB, which gives produces 281 docs that have been modified in the last 2 weeks. What I need is some way of creating either a view, or and agent that will display or delete those corresponding docs in the restored database before I copy & paste them over from the damaged one.

Hope that makes sense.
Question by:scribla
  • 4
  • 2
  • 2
  • +1
LVL 15

Expert Comment

ID: 24801207
First of all are using a third party backup ( e.g. Netback Veritas) if you use such a back up I highly recommend that you contact them and ask them for support in order to avoid any future inconvenience or whoever responsible for the back up must start working on it .
Second of all, if I have such a problem and get any component currupted frankly speaking I would do the following ( after the working hours)
1- Since I am a Full Admin
2- I would create a new database with a similar name to the currpted one if the currpted one is DB I would create DB1.
3- And I would copy all the emails and folders from currpted one to the new one
4- I would delete the currpted one.
5- rename the new one from DB1 to DB (By right clciking DB1 ===> Clicking Move===>the destination must be the same destination where is exists with the name of DB only )

Best Regards

Expert Comment

ID: 24801330
akhafaf: would doing as you suggested likely fix the corrupted documents? If so that is an extremely handy tip and could save us all a lot of time!

If not, here's what I would do, if akhafafs suggestion doesn't work:

1. Create a new database, call it whatever you want, this is just going to be temporary
2. Restore your last good backup, without replacing the live, corrupt database.
3. Write an agent which will work its way through your view of the 281 modified documents
4. For each of those documents, using the NotesDocument.DocumentUniqueID, see if you can find the same document in the restored database. If you can't, copy it over, or  put it elsewhere in order for you to deal with it later. For this I often create an empty database which I will use as an "in tray", so I can manually transfer the resulting documents once I'm happy with the results.

The idea in this is that because the restored database should have the same replicaID as the corrupted database, the documents should have the same UNIDs and so should be reliable enough to do your checks.

Expert Comment

ID: 24801355
P.S. The above post was pre-morning coffee. The temp db mentioned in point 4 is the db created in point 1 :)
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Expert Comment

ID: 24801364
P.P.S. NotesDocument.UniversalID, not NotesDocument.DocumentUniqueID.

I'm going to stop now.

Author Comment

ID: 24801804
Chuckalicious: Ok, great, to cut to the chase I really need a code really example.
Just to confirm what the scenario is here:
I have a DB that is complete but is 2 weeks old. I have an upto date (but damaged) DB, and it is very unlikely that any of the newer doc are damaged/missing most of the damage seems to be on docs over 1 year old.

In my damaged DB I have created a view that only displays documents created or modified in the last 2 weeks.
So, In the 2 week old (non corrupted) DB, I need a view that will only show documents if they appear in the view in the corrupted DB. That way I can delete them before I copy & paste from the damaged DB.
I am not sure if it is possible to use a @dblookup in a view selection?

Anyways I'm a bit rusty on such things, and time is of the essence.  Also worth noting, that this restored DB has local access protection enabled, so it can only be opened on a server, which then means the server see's it as dupe, it assign it a new replica ID.
Anyways each document has a unique filed called EnquiryNumber, so I guess if DocumentUniqueID is no good I can use that.

Expert Comment

ID: 24801819
Sorry, I'm not able to write an example of code at the moment. No time :(

Maybe someone else could oblige. And your own EnquiryNumber would do, if it's unique
LVL 10

Accepted Solution

doninja earned 2000 total points
ID: 24802750
You can't use dblookup etc in view selection or agent document selection I'm afraid

Best is to write an agent in your damaged database that does the lookup into the restored database, if a duplicate is found then mark it as duplicate.

I would recommend you make a view in restored DB or both that has sorted column showing @DocumentUniqueID  and contains the documents you want to restore (under 2 weeks old etc)

Then in restored db have agent that runs on all documents in view
Example code would be

Finally have view for all documents where IsDuplicate = "Y"

Test it first of course.
LVL 10

Expert Comment

ID: 24802759
just read your comment again, you could use enquiry number in stead of @documentUniqueID in above

Author Closing Comment

ID: 31600801
Thanks man, went about it in a slightly different way, but your solution really help me get there.

Featured Post

Upgrade your Question Security!

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question