Initiating multi- and single-file backups

From InterBase

Go Up to Performing backups and restores using the gbak command


When backing up a multifile database, specify only the first file name of the database.

For backing up to a single file

gbak [-b] [options] database target

For backing up to multiple files

gbak [-b] [options] database target1 size1[k|m|g] target2 [size2[k|m|g] target3
Arguments for gbak
Argument Description

<database>

  • Name of a database to back up
  • For a multifile database, the name of the first database file

<target>

Name of a storage device or backup file to which to back up

  • On UNIX, can also be stdout, in which case gbak writes its output to the standard output (usually a pipe).
  • No size need be specified when restoring to a single file, since the database always expands as needed to fill all available space.

<size>

Length of a backup file or restored database file

  • The only permissible unit for a restored database file is database pages; minimum value is 200.
  • Default unit for a backup file is bytes.
  • Size of backup files can also be specified in kilobytes, megabytes, or gigabytes.
  • Do not specify a size for the final backup file or database file; the last file always expands as needed to fill all available space.

Options: In the OPTION column of the following tables, only the characters outside the square brackets ([ ]) are required.

Table 8.2 lists the options to gbak that are available for creating backups.

Backup Options for gbak
Option Description

-b[ackup_database]

Backs up database to file or device.

-co[nvert]

Converts external files as internal tables.

-d[ump]

The first time you use the -d switch, it executes a full physical backup. Subsequent uses execute an incremental backup.

-e[xpand]

Creates a noncompressed back up.

-fa[ctor] n

Uses blocking factor <n> for tape device.

-g[arbage_collect]

This option instructs the server not to perform garbage collection on every record it visits. This enables the server to retrieve records faster, and to send them to the gbak client for archiving.

-ig[nore]

Ignores checksums during backup; Note: InterBase supports true checksums only for ODS 8 and earlier.

-l[imbo]

Ignores limbo transactions during backup.

-m[etadata]

Backs up metadata only, no data.

-nt

Creates the backup in nontransportable format.

-ol[d_descriptions]

Backs up metadata in old-style format.

-ov[erwrite_dump]

This switch causes the current set of online dump files to be deleted, and initiates a full database dump

-pas[sword] text

Checks for password <text> before accessing a database.

-role name

Connects as role <name>.

-se[rvice] servicename

  • Creates the backup files on the host where the original database files are located, using InterBase Service Manager.
  • <servicename> invokes the Service Manager on the server host; syntax varies with the network protocol in use:

IMPORTANT NOTE: If you are providing file path names with embedded spaces in them and using the InterBase service manager (-service switch in GBAK), you will need to multi-quote the file names:
<double_quote><single_quote>filepath<single_quote> <double_quote>

The above is required because the command shell strips away the external double_quotes and only leaves the internal single_quotes for InterBase to know that it is a single string value.

For example:

# gbak –service service_mgr –r “’/path/with space/foo.ibk’” “’/path/with space/foo.ib’” –user sysdba –password mas­terkey

-t[ransportable]

Creates a transportable backup [default].

-user name

Checks for user <name> before accessing remote database.

-v[erbose]

Shows what gbak is doing.

-y [file | suppress_output]

Direct status messages to <file>; <file> must not already exist; suppress_output suppress output messages.

-z

Show version of gbak and of InterBase engine.

Advance To: