Link to home
Start Free TrialLog in
Avatar of TSO Fong
TSO FongFlag for Sweden

asked on

Undead profile documents -- can't delete

A profile-document mishap has left me with some "undead" profile documents that I can't get rid of. The problem is, one of these documents seems to be "attached" to a user, preventing him from performing a funciton in the database.

I've created a LotusScript agent that gathers all the profile documents in a doc collection (with Set dc = db.GetProfileDocCollection) and cycles through them. I've stepped through it in debug mode to take a look at these two rogue documents. Both seem to be entirely empty.

The UniversalID and NoteID are both empty. There are no items. The size is 0 (zero). The IsDeleted property is True.

I've tried removing the "good" profile docs from the doc collection and then cycling through calling dc.DeleteDocument(doc) and then doc.Remove(True), but that doesn't delete these zombies. I've also tried using dc.RemoveAll(true), but that crashes Notes, saying that some line of code has referenced memory location 0x0000000000.

All this is in Notes 5.08, by the way.

Any ideas how to exorcise these two documents?


-- b.r.t.
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You could also try to call GetProfileDocument, update a field, save the document and then delete it, hoping Notes corrected itself.

Already tried to run Fixup or Compact on that particular db?
Avatar of TSO Fong


I've compacted the database, but I've not tried modifying the record. I'll try that.


-- b.r.t.
Avatar of HemanthaKumar

In yout replication settings of the db, goto space savers and enable remove Documents not modifiec in the last 90 days. And change the 90 to 0click ok and then close the dialog. If you want you can compact the db at this point.

After that check if there is any profile doc is left behind. And if so , then reset the changes that you made above in replica settings

Sjef --

When I change that dc.RemoveAll(true) to dc.StampAll("Garbage", Now) I get this error:
Notes error: Document has been deleted

I've also tried grabbing another "good" profile doc and using call goodDoc.CopyAllItems(doc, True) but I get the same error.

The IsDeleted property of the document is read-only, so I can't set that to false.

If I try to stuff a new item into the document using set item = new NotesItem(doc, "AnItem", "Help!") I get a "Could not create field" error.

After all this I tried to get the document using the user's name, as was your first suggestion. Darned if that didn't work. But the thing is, there were two of these zombie documents out there, and I don't know who the other one is attached to. Eventually I get the impression it's going to reach up and bite me.

Any ideas how to get rid of it, too?


Hemanth --

If I tell the db to remove documents not modified in the last 0 days, why wouldn't that delete all documents in the database? I don't think that would be in my best interests...

-- b.r.t.
Last resort: try creating a new replica of the database, either local, or on the server in a separate directory. Then, move the old db from the Notes data directory outside the Notes data tree (either dbcache flush, or shut down the server if that's possible) and replicate the new replica back in place. The effect is a compact, but it's a whole new file.

There must be some Compact-option, I don't know them by heart (great Help-file!):
    Load Compact -c yourdb.nsf
This will do the same as the above.

See for the other options the Administrator's Help db
Alas, I'm but a lowly rogue developer, expected to make things right in a dozen or so databases used by my business unit -- one small part of a multi-national company. They don't let me anywhere near the servers. (I'm so low in the company, when my boss's boss's boss asks me to create a new database, it still takes me two weeks' worth of jumping through hoops to even get someone to put it out on a server.) So I don't think that's going to be an option for me, Sjef.

I guess at this point it's going to be a matter of waiting until whoever it is tries to perform this action and gets the error message. Not the best solution, but it is job security, I guess.

I'll keep this open a bit longer to see if anybody else has any suggestions.

-- b.r.t.
oh yeah.. it is possible I just wanted you to play with a backup copy and not live one.. so that you can remove profile docs and then copy/replicate the original documents.. It is just a hint, I haven't tried it as other methods worked gr8 for me.
OK, you all saw him! Hemanth was trying to get me to delete all my documents! I'm telling mom!
Oh, wait. Sorry. I thought this was the Lounge there for a moment...

You can build a list of all users (either all names in the NAB, or all names in whatever groups have DB access).  Then, cycle through that user list and try to get the profile for each.

You can also try using NotesPeek to find the profile.

This really sounds like a corupt doc, and an exhaustive fixup should do the trick.
Given that I have no administrative authority (other than Manager access to the database), how do I run fixup?
Ah... yu don't.  try getting friendly with an admin, and telling him you think you have a corrupt DB.
Or tell him that your boss's boss's boss has a corrupt mail db, they might start running for you :)

By the way, do you have ANY rights on the server?? And on the db? Are you allowed to create replica's on the server?

Or is everything so secure that they make you forget what you did yesterday?? You can't remember, you say. Ah...
I have no server rights to speak of, Sjef.

Officially, I'm not even supposed to be doing database work. My company has a division to do that. (Of course, they're in, uh, New York, I think, while I'm in Alabama.) But when I started here 5 years ago (as a tech writer) and my boss found out I could do Notes development, she jumped on the opportunity, and at that point corporate wasn't so strict. So I'm kind of grandfathered in as a developer for my business unit. (The "official" group sees me as a rogue developer, I'm told. I see them as good functional coders working on designs that don't take usability or appearance into consideration.)

As for getting friendly with an admin, there aren't even any in the state (despite no fewer than four corporate offices in the state). There's a guy I work with who used to be a Notes admin for our office, but they've taken that away from him and moved him to PC network support and AS/400 support. Now all the Notes admin work is handled remotely. (There are more than 250 Notes servers in my company worldwide, according to the All Server Documents view in the PAB.)

And, alas, it's not a mail database, so I can't use that as incentive to get them motivated. I can put in a call to the help desk, but my experience with that has been that they might get to it in a month.

Of course, that's better than nothing, I guess. So maybe I'll do that and check in a month or so to see if that last zombie document is gone. At least the function that will be limited for this one person is one that they may never have to use again, so even if the document stays there forever it might not cause any troubles.

Thanks, everyone, for all the help!

-- b.r.t.
If you don't mind my asking, what company do you work for?