Using gbak with InterBase Service Manager

From InterBase
Jump to: navigation, search

Go Up to Performing backups and restores using the gbak command


When you run gbak with the -service switch, gbak invokes the backup and restore functions of InterBase’s Service Manager on the server where the database resides. When run without the -service switch, gbak executes on the machine where it is invoked – typically a client – and writes the backup file on (or relative to) that machine. Using the -service switch to invoke the Service Manager saves a significant amount of time and network traffic when you want to create the backup on the same host on which the database resides. When the Service API is used, both the database and the backup file must be accessible to the server.

When you use the -service switch, you specify the host name followed by the string “service_mgr”. The syntax you use for this ies with the network protocol you are using. Together, these components are referred to as “host_service” in the syntax statements that follow in this section:

Network protocol Syntax

TCP/IP

hostname:service_mgr

NetBEUI

\\hostname\service_mgr

Local

service_mgr

OTW (Over-the-wire)

hostname/port number?ssl=true?...<other OTW parameters>...??:service_mgr

The syntax in the right column appears in the gbak syntax below as “host_service”.

The local case is trivial on NT. If you are backing up a local database, the results in terms of time and network traffic are the same whether you use the -service switch or not, even though the actual implementation would be slightly different. On UNIX systems, the local case is equivalent to specifying (for TCP/IP) localhost:service_mgr and saves both time and network traffic.

Syntax: Backing up with Service Manager

gbak -b [options] -se[rvice] host_service database filename

Syntax: Restoring with Service Manager

gbak {-c|-r} [options] -se[rvice] host_service filename database

You can back up to multiple files and restore from multiple files using Service Manager.

Important: On UNIX systems, in order to restore a database that has been backed up using the Service Manager, you must either use the Service Manager for the restore or you must be logged onto the system as the user that InterBase was running as when the backup was created (either root or InterBase). This is because the InterBase user (root or InterBase) is the owner of the backup file at the system level when the Service Manager is invoked, and the backup file is readable to only that user. When gbak is used to back up a database without the -service option, the owner of the backup file at the system level is the login of the person who ran gbak. On Windows platforms, the system-level constraints do not apply.

Advance To: