Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

need help with a view

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
scribla
Asked:
scribla
  • 4
  • 2
  • 2
  • +1
1 Solution
 
akhafafCommented:
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
 
chuckaliciousCommented:
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
 
chuckaliciousCommented:
P.S. The above post was pre-morning coffee. The temp db mentioned in point 4 is the db created in point 1 :)
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
chuckaliciousCommented:
P.P.S. NotesDocument.UniversalID, not NotesDocument.DocumentUniqueID.

I'm going to stop now.
0
 
scriblaAuthor Commented:
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
 
chuckaliciousCommented:
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
 
doninjaCommented:
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
 
doninjaCommented:
just read your comment again, you could use enquiry number in stead of @documentUniqueID in above
0
 
scriblaAuthor Commented:
Thanks man, went about it in a slightly different way, but your solution really help me get there.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now