company logo

Client :: restoreDatabase - Restore database

The function restores the database from a previously made backup as server service. The function may run locally but also on a server client (client connected to a server).

When running restoreDatabase() on a server client, the restore request is passed to the server in order to restore the server database. In this case, symbolic file names defined in the servers file catalog have to be passed for the file location passed in sDatabasePath (e.g. "%MyDatabase%" in sDatabasePath) and in sSourcePath.

The function throws an exception, when the client handle passed is not valid or when the database could not be restored.

Implementation overview

Implementation details

  1. Restore database from different source
    Client  :: restoreDatabase ( odaba::String &sDatabasePath, odaba::String &sSourcePath )

    The function restores the database file passed in sDatabasePath from the backup file at . The function is usually called for local restore. In order to restore a database on server, a timeout interval for killing clients should be passed.

    When calling this function for a server client, active clients are killed immediately without warning.

    • sDatabasePath - File path to database location

      The database path refers to the location of the main database file (root base).

      In order to pass no database path, an empty string ( String() ) has to be passed.

    • sSourcePath - Source path

      The source path refers to a file location for the source file. The complete path includes file name and directory. It might, however, be defined as absolute path starting with the root device or folder or a relative path.

      In order to pass no file path, an empty string ( String() ) may be passed.

  2. to list
  3. Restore database on server
    Client  :: restoreDatabase ( odaba::String &sDatabasePath, odaba::String &sSourcePath, int32 iWait )

    The function restores the database file passed in sDatabasePath from the backup file at sSourcePath.

    In order to give clients a chance to close applications properly, a timeout limit for terminating running clients (kill time) can be passed in iWait. The kill time interval passed in iWait allows stopping clients after the given time interval (time in seconds). When a time interval has been defined, the clients are informed, that the client will be stopped after iWaitseconds. Suggested value for kill time are 300 seconds, but it depends on type of clients connected to the server.

    When passing 0 for iWait, the clients accessing the database to be restored are stopped immediately without warning.

    • sDatabasePath - File path to database location

      The database path refers to the location of the main database file (root base).

      In order to pass no database path, an empty string ( String() ) has to be passed.

    • sSourcePath - Source path

      The source path refers to a file location for the source file. The complete path includes file name and directory. It might, however, be defined as absolute path starting with the root device or folder or a relative path.

      In order to pass no file path, an empty string ( String() ) may be passed.

    • iWait - Number of seconds to wait

      The system waits the given number of seconds before executing the request.

  4. to list