Bringing a Notes Database Back Online

Often as an Admin we run into an error such as database is being taken offline and cannot be opened“. This can be a pain to recover from sometimes, but with a few lines of code you may be able to recover without any server downtime. However, I have even seen times where this might not succeed.

Here is the Lotusscript code that you can run. If you add it to something like catalog.nsf, you could have it grab the filepath of the currently selected database and pass it into the agent. But here is really all you need in an “Action menu selection” agent with a target of “All documents in database”. It will use the server that the database containing the agent is in as the server to use for the datbase.

Option Public
Dim db As NotesDatabase
Dim doc As NotesDocument
Declare Private Function NSFBringDatabaseOnline Lib “nnotes” Alias “NSFBringDatabaseOnline” ( ByVal dbPath As String, ByVal Z As Long) As Integer

Sub Initialize

Call NSFBringDatabaseOnline(“path/db.nsf”,0)

End Sub

 

A Google cache of IBM documentation is here, and I have reproduced some of it below.

Description:

This function will bring a database online for access after it has been taken offline by NSFTakeDatabaseOffline.

Parameters:

Input:
dbPath – Path to the database to be brought online.
options – Reserved, must be zero

Output:
(routine) – Return status from this call — indicates either success or what the error is. The return codes include:

NOERROR – Successful.
ERR_xxx – Errors returned by lower level functions. Call OSLoadString to interpret the error code for display.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s