Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 :)
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

661 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