markForDelete (NotesDatabase - JavaScript™)
Marks a database for deletion from a server in a cluster.
Defined in
NotesDatabaseSyntax
markForDelete() : void
Usage
Once a database is marked for deletion, it does not accept any new database open requests. After all active users are finished with it, the Cluster Manager pushes all changes to another replica (if there is another replica) and then deletes the database. Use this method if you want to remove a database that is obsolete or if you are copying a database from one server to another and want to delete the database from the original server. If you want to delete a database and all its replicas from a cluster, each database on each server must be marked for deletion.This method cannot be undone. You cannot remove a mark for deletion from a database once this method is used.
This method sets isPendingDelete to true and isInService to false.
This method differs from the remove method in that the
database must be in a cluster. If the database is not on a server
in a cluster, this method does not return an error, but the database
is not deleted. Additionally, the remove method fails if
the database is in use. The markForDelete
method
waits for all current users to finish, then deletes the database.
The Cluster Manager is responsible for deleting databases marked for
deletion in the cluster; the Adminp task is not called.
You
can programmatically determine if a database is available on other
servers in a cluster by querying the cldbdir.nsf
database,
which exists on every cluster and holds an up-to-date list of all
the databases in the cluster and their replicas. The cldbdir.nsf
database
also tracks each database's enabled or disabled status.
Use
the deleteReplicas method
of the NotesAdministrationProcess
class if you want
to delete a database and all replicas from the entire domain.
This method requires Manager access privileges.
Examples
This button marks a database for deletion. It is effective if the database is on a server on a cluster with the Cluster Manager running.var db:NotesDatabase = session.getDatabase("Cathy/Otus", "Test\\MarkForDelete");
if (db.isOpen()) {
db.markForDelete();
requestScope.status = "Is in service = " + db.isInService();
requestScope.status = "\nIs pending delete " + db.isPendingDelete();
} else {
requestScope.status = "Could not open Test\\MarkForDelete";
}