README.gbak 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. gbak enhancements in Firebird v4.
  2. ---------------------------------
  3. A new switch was added to gbak: -INCLUDE(_DATA).
  4. Author: Dimitry Sibiryakov <sd at ibphoenix com>
  5. It takes one parameter which is "similar like" pattern matching
  6. table names in a case-insensitive way.
  7. This switch, if provided, limit tables for which data is stored
  8. or restored in/from backup file.
  9. Interaction between -INCLUDE_DATA and -SKIP_DATA switches for
  10. a table is following:
  11. +--------------------------------------------------+
  12. | | INCLUDE_DATA |
  13. | |--------------------------------------|
  14. | SKIP_DATA | NOT SET | MATCH | NOT MATCH |
  15. +-----------+------------+------------+------------+
  16. | NOT SET | included | included | excluded |
  17. | MATCH | excluded | excluded | excluded |
  18. | NOT MATCH | included | included | excluded |
  19. +-----------+------------+------------+------------+
  20. gbak enhancements in Firebird v5.
  21. ---------------------------------
  22. 1. Parallel execution.
  23. Author: Vladyslav Khorsun <hvlad at users sourceforge net>
  24. a) gbak backup
  25. Backup could read source database tables using multiple threads in parallel.
  26. New switch
  27. -PAR(ALLEL) parallel workers
  28. set number of workers that should be used for backup process. Default is 1.
  29. Every additional worker creates own thread and own new connection used to read
  30. data in parallel with other workers. All worker connections shares same database
  31. snapshot to ensure consistent data view across all of its. Workers are created
  32. and managed by gbak itself. Note, metadata still reads by single thread.
  33. b) gbak restore
  34. Restore could put data into user tables using multiple threads in parallel.
  35. New switch
  36. -PAR(ALLEL) parallel workers
  37. set number of workers that should be used for restore process. Default is 1.
  38. Every additional worker creates own thread and own new connection used to load
  39. data in parallel with other workers. Metadata is still created using single
  40. thread. Also, "main" connection uses DPB tag isc_dpb_parallel_workers to pass
  41. the value of switch -PARALLEL to the engine - it allows to use engine ability
  42. to build indices in parallel. If -PARALLEL switch is not used gbak will load
  43. data using single thread and will not use DPB tag isc_dpb_parallel_workers. In
  44. this case engine will use value of ParallelWorkers setting when building
  45. indices, i.e. this phase could be run in parallel by the engine itself. To
  46. fully avoid parallel operations when restoring database, use -PARALLEL 1.
  47. Note, gbak not uses firebird.conf by itself and ParallelWorkers setting does
  48. not affect its operations.
  49. Examples.
  50. Set in firebird.conf ParallelWorkers = 4, MaxParallelWorkers = 8 and restart
  51. Firebird server.
  52. a) backup using 2 parallel workers
  53. gbak -b <database> <backup> -parallel 2
  54. Here gbak will read user data using 2 connections and 2 threads.
  55. b) restore using 2 parallel workers
  56. gbak -r <backup> <database> -parallel 2
  57. Here gbak will put user data using 2 connections and 2 threads. Also,
  58. engine will build indices using 2 connections and 2 threads.
  59. c) restore using no parallel workers but let engine to decide how many worker
  60. should be used to build indices
  61. gbak -r <backup> <database>
  62. Here gbak will put user data using single connection. Eengine will build
  63. indices using 4 connections and 4 threads as set by ParallelWorkers.
  64. d) restore using no parallel workers and not allow engine build indices in
  65. parallel
  66. gbak -r <backup> <database> -par 1
  67. 2. Direct IO for backup files.
  68. New switch
  69. -D(IRECT_IO) direct IO for backup file(s)
  70. instruct gbak to open\create backup file(s) in direct IO (or unbuferred) mode.
  71. It allows to not consume file system cache memory for backup files. Usually
  72. backup is read (by restore) or write (by backup) just once and there is no big
  73. use from caching it contents. Performance should not suffer as gbak uses
  74. sequential IO with relatively big chunks.
  75. Direct IO mode is silently ignored if backup file is redirected into standard
  76. input\output, i.e. if "stdin"\"stdout" is used as backup file name.