FireDAC.Phys.FB.TFDFBNRestore

From RAD Studio API Documentation
Jump to: navigation, search

FireDAC.Phys.IBBase.TFDIBServiceFireDAC.Phys.TFDPhysDriverServiceFireDAC.Stan.Intf.TFDComponentSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTFDFBNRestore

Delphi

TFDFBNRestore = class (TFDIBService)

C++

class PASCALIMPLEMENTATION TFDFBNRestore : public Firedac::Phys::Ibbase::TFDIBService

Properties

Type Visibility Source Unit Parent
class public
FireDAC.Phys.FB.pas
FireDAC.Phys.FB.hpp
FireDAC.Phys.FB FireDAC.Phys.FB

Description

The class implementing Firebird-only database restore service.

Use the TFDFBNRestore component to add a Firebird-only restore from backup database capability to an application. This is a programmatic method to invoke the nbackup tool as a thread in the DB server process to restore a database.

To configure the connection to the database server, you must fill the following properties: DriverLink, Host, Protocol, UserName and Password.

To restore a database from a DB backup, an application should:

  • Specify Database - a primary database file to restore.
  • Specify BackupFiles - the file names to restore a database from.
  • Call Restore method.

Other properties and methods are optional.

Paths of backup files are relative to the server. Because TFDFBNBackup restores a backup on the DB server host, the DB Service Manager reads backup files from the server host.

Read http://www.firebirdsql.org/manual/nbackup.html for more details.

Example

FDFBNRestore1.DriverLink := FDPhysFBDriverLink1;

FDFBNRestore1.UserName := 'sysdba';
FDFBNRestore1.Password := 'masterkey';
FDFBNRestore1.Host := 'db_srv_host';
FDFBNRestore1.Protocol := ipTCPIP;

FDFBNRestore1.Database := 'e:\fb\addemo.fdb';
FDFBNRestore1.BackupFile := 'e:\fb\addemo.backup';

FDFBNRestore1.Restore;

See Also