다음을 통해 공유


HrESEBackupSetup Function

Topic Last Modified: 2006-06-12

The HrESEBackupSetup function informs the Exchange Storage Engine (ESE) that the specified database is to be backed up.

Applies To

ESEbcli2 DLL Functions Interface

Syntax

HRESULT HrESEBackupSetup
(
        HCCX hccsBackupContext,
        __int64 hInstanceID,
        unsigned long btBackupType
);

Parameters

  • hccsBackupContext
    Input parameter. The backup context handle returned by the HrESEBackupPrepare Function in the phccxBackupContext parameter.
  • btBackupType
    The type of backup to be performed. This can be one of the following values: BACKUP_TYPE_FULL (0x01), BACKUP_TYPE_LOGS_ONLY (0x02), BACKUP_TYPE_FULL_WITH_ALL_LOGS (0x03).

Return Value

The following return codes can be returned. To retrieve the error string for an ESE error, use the standard FormatMessage function. For the general errors hrErrorFromESECall and hrErrorFromCallbackCall, more information about the error is available using the standard GetLastError function.

S_OK

Success.

ESE-specific error codes

ESE-specific error codes, as defined in esebkmsg.h.

Other

Other Microsoft® Win32® or remote procedure call (RPC) errors.

Remarks

See the Backup Overview topic for more information about the backup styles supported by the ESE.

Because all databases inside a single storage group share the same log files, each storage group must be treated as a unit for the purposes of backup and restore. Individual databases can be backed up and restored, but the log files must remain consistent among all the storage group databases.

This function should be called when the application is ready to back up databases in the specified storage group. After this function completes successfully, the ESE will not allow any other processes to attach or detach from the storage group until after the backup completes and the HrESEBackupInstanceEnd Function has been called.

Note

If the backup application requires user input after calling this function, the storage group may become inaccessible while the application waits for user input.

If the btBackupType parameter is passed as BACKUP_TYPE_LOGS_ONLY, the function checks to ensure that a full backup has been performed on the database. If a full backup (BACKUP_TYPE_FULL) has not been performed, this function will return an error.

After setting up the storage group with this function, call the HrESEBackupOpenFile Function to specify the specific databases to back up.

Applications that use this function must be run under a user account that has Microsoft Windows® server operating systems Backup and Restore privileges.