Firebird Documentation IndexFirebird 2.5 Release NotesCommand-line Utilities → gbak
Firebird Home Firebird Home Prev: fbsvcmgrFirebird Documentation IndexUp: Command-line UtilitiesNext: nBackup

gbak

Run-time Statistics in Verbose Output
Repair Switches for Malformed Strings
Preserve Character Set Default Collation
Improve Insertion Performance for Restore

Run-time Statistics in Verbose Output

Vlad Khorsun

gbak can now show some runtime statistics in its verbose output. A new command-line switch -STATISTICS has been added to specify which statistics items should be produced. Currently, four items are implemented:

Table 13.1. Arguments for gbak STATISTICS Output

Item Argument Data Reported
Total time T Time elapsed since the gbak process started, in seconds and milliseconds
Time delta D Time elapsed since the previous line of output, in seconds and milliseconds
Page reads R Number of page reads since the previous line of output, integer
Page writes W Number of page writes since the previous line of output, integer


At least one item is mandatory for the STATISTICS switch. The arguments are case-insensitive and they can be in any order. For example, “TDRW” and “WdrT” are equivalent.

The STATISTICS switch will have no effect if the -v[er] switch is not specified.

Verbose output with STATISTICS includes two special lines:

  • a line with headers for the specified statistics, printed before the other statistics lines:
    gbak: time delta reads writes
                
  • a line with total statistics summaries for the specified items, printed after the end of the main process:
    gbak: 46.684 0.002 171 82442 total statistics
                

Note

The feature is fully supported in the Services API with a new item in the SPB (Services Parameter Block). The fbsvcmgr utility also supports the SPB implementation.

Examples

  1. Show total time since gbak start:
    gbak -v -STATISTICS T -b employee emp_bkp.fbk -y log21.log
              
  2. Show delta time and page reads:
    ... -STAT DR ...
              
  3. Show all statistics items:
    ... -sta TDRW ...
              
  4. Sample of gbak verbose output:
    firebird>gbak -v -stat tdrw -r a.fbk a.fdb
    gbak:opened file a.fbk
    gbak: time delta reads writes
    gbak: 0.173 0.173 0 0 transportable backup -- data in XDR format
    gbak: 0.175 0.002 0 0 backup file is compressed
    gbak: 0.177 0.001 0 0 backup version is 10
    gbak: 0.270 0.092 0 650 created database a.fdb, page_size 8192 bytes
    gbak: 0.273 0.002 0 2 started transaction
    ...
    gbak: 18.661 0.002 0 0 restoring data for table TEST1
    gbak: 18.698 0.036 0 0 10000 records restored
    ...
    gbak: 25.177 0.036 0 0 1770000 records restored
    gbak: 25.220 0.042 0 1633 1780000 records restored
    ...
    gbak: 38.702 0.002 0 0 restoring privilege for user SYSDBA
    gbak: 38.707 0.004 22 0 creating indexes
    gbak: 45.015 6.308 82 38394 activating and creating deferred index T2_VAL
    ...
    gbak: 46.682 0.008 4 13 finishing, closing, and going home
    gbak: 46.684 0.002 171 82442 total statistics
    gbak:adjusting the ONLINE and FORCED WRITES flags
              

See also: Tracker ticket CORE-1999

Repair Switches for Malformed Strings

Adriano dos Santos Fernandes

Tracker reference CORE-1831.

The gbak utility has two new restore switches intended to repair malformed UNICODE_FSS character data and metadata, respectively, when restoring the backup of an affected database.

Switch Syntax

  -FIX_FSS_D(ATA) <charset> -- fix malformed UNICODE_FSS data
  -FIX_FSS_M(ETADATA) <charset> -- fix malformed UNICODE_FSS metadata
      

Hints with Malformed String Exceptions for Restores

(CORE-2754, A. dos Santos Fernandes)

When a restore fails with malformed string errors, gbak will supply a hint in verbose output, referring the user to the -FIX_FSS_METADATA and -FIX_FSS_DATA switches.

Preserve Character Set Default Collation

Adriano dos Santos Fernandes

An improvement allows the current value of RDB$DEFAULT_COLLATE_NAME in the system table RDB$CHARACTER_SETS to survive the backup/restore cycle.

Tracker reference CORE-789.

Improve Insertion Performance for Restore

Adriano dos Santos Fernandes

(v.2.5.1) Improved performance in the records insertion phase of restore.

Tracker reference CORE-3433.

Prev: fbsvcmgrFirebird Documentation IndexUp: Command-line UtilitiesNext: nBackup
Firebird Documentation IndexFirebird 2.5 Release NotesCommand-line Utilities → gbak