need help with a view

Posted on 2009-07-07
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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 500 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Word Pro Conversion utility 13 35
Username format for Domino LDAP 3 102
Why the url within notes is no action 6 52
@Mailsend 3 69
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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