Solved

need help with a view

Posted on 2009-07-07
9
214 Views
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.
0
Comment
Question by:scribla
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 15

Expert Comment

by:akhafaf
Comment Utility
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
0
 
LVL 4

Expert Comment

by:chuckalicious
Comment Utility
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.
0
 
LVL 4

Expert Comment

by:chuckalicious
Comment Utility
P.S. The above post was pre-morning coffee. The temp db mentioned in point 4 is the db created in point 1 :)
0
 
LVL 4

Expert Comment

by:chuckalicious
Comment Utility
P.P.S. NotesDocument.UniversalID, not NotesDocument.DocumentUniqueID.

I'm going to stop now.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Author Comment

by:scribla
Comment Utility
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.
0
 
LVL 4

Expert Comment

by:chuckalicious
Comment Utility
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
0
 
LVL 10

Accepted Solution

by:
doninja earned 500 total points
Comment Utility
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
@if(@dblookup(db;viewname;@DocumentUniqueID;1;[FAILSILENT])="";"";@setfield("IsDuplicate";"Y"))

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

Test it first of course.
0
 
LVL 10

Expert Comment

by:doninja
Comment Utility
just read your comment again, you could use enquiry number in stead of @documentUniqueID in above
0
 
LVL 2

Author Closing Comment

by:scribla
Comment Utility
Thanks man, went about it in a slightly different way, but your solution really help me get there.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now