Firebird Documentation IndexFirebird 3.0.2 Release NotesMonitoring & Command-line Utilities → gbak
Firebird Home Firebird Home Prev: TracingFirebird Documentation IndexUp: Monitoring & Command-line UtilitiesNext: gsec

gbak

New “Skip Data” Backup Option
Long Names for Log Files
Run-time Statistics in Verbose Output
New Return Code

New “Skip Data” Backup Option

Alex Peshkov

gbak has a new option switch-- -skip_d(ata) to ignore the data from specific tables during a backup.

The switch -skip_d(ata) accepts a regular expression as its argument. For example, to skip two tables in the employee database (aliased here as 'employee'):

 gbak -skip_d '(sales|customer)' employee e1.fbk
      

Tip

The regex used is the SQL one—the same one that is used for Firebird's SIMILAR TO searches. A guide is available in the DML chapter of the v.2.5 release notes and also at the Firebird web site.

Long Names for Log Files

Alex Peshkov

This improvement allows the gbak log to take an extra-long name without encountering the message “Attempt to store 256 bytes in a clumplet”.

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 11.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

New Return Code

Alex Peshkov

From v.3.0.1, gbak returns a non-zero result code when restore fails on creating and activating a deferred user index.

Prev: TracingFirebird Documentation IndexUp: Monitoring & Command-line UtilitiesNext: gsec
Firebird Documentation IndexFirebird 3.0.2 Release NotesMonitoring & Command-line Utilities → gbak