Shared mail Database not able to bring offline

Hi AllI’m working on the backup & restore application for Lotus Notes/Domino server. During the restore I’m not able to make shared mail database offline even when domino server is down.

I have configured shared mail database into different directory (C:\sharedmaildir) and the shared mail databases have been created as

sm000001.nsf

sm000002.nsf

sm000003.nsf

When I use NSFTakeDatabaseOffline api, I’m getting error message like “5098 : The database is in use and cannot be taken off-line”.

But I’m able to delete database files (sm000*.nsf) when domino server is down.

How can I found weather the given database file is sharedmail database?

Expecting your Help.

Balamurali C