mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 18:03:03 +01:00
61 lines
3.0 KiB
Plaintext
61 lines
3.0 KiB
Plaintext
Services API enhancements in Firebird v2.
|
|
-----------------------------------------
|
|
|
|
1) Services API extension for new shutdown modes.
|
|
(Alex Peshkov, peshkoff@mail.ru, 2008)
|
|
|
|
New DB shutdown modes can now be set using services. A number of new
|
|
isc_spb_prp_* constants should be used for it.
|
|
|
|
isc_spb_prp_shutdown_mode and isc_spb_prp_online_mode are used to perform
|
|
database shutdown/online operation. They have a single byte parameter,
|
|
setting new shutdown mode: isc_spb_prp_sm_normal, isc_spb_prp_sm_multi,
|
|
isc_spb_prp_sm_single and isc_spb_prp_sm_full. They exactly match gfix's
|
|
shutdown modes. When performing shutdown operation, you must specify
|
|
also type of shutdown: one of isc_spb_prp_force_shutdown,
|
|
isc_spb_prp_attachments_shutdown or isc_spb_prp_transactions_shutdown.
|
|
They have single int (4-byte) parameter, specifying timeout for desired
|
|
operation.
|
|
Please note that old-styled parameters are also supported and should be
|
|
used to enter default shutdown (currently 'multi') and online ('normal')
|
|
modes.
|
|
|
|
Samples of use of new parameters in fbsvcmgr utility (supposing login and
|
|
password are set using some other method):
|
|
Shutdown database to single-user maintenance mode:
|
|
fbsvcmgr service_mgr action_properties dbname employee prp_shutdown_mode prp_sm_single prp_force_shutdown 0
|
|
After it enable multi-user maintenance:
|
|
fbsvcmgr service_mgr action_properties dbname employee prp_online_mode prp_sm_multi
|
|
After it go to full shutdown mode, disabling new attachments during 60 seconds:
|
|
fbsvcmgr service_mgr action_properties dbname employee prp_shutdown_mode prp_sm_full prp_attachments_shutdown 60
|
|
Return to normal state:
|
|
fbsvcmgr service_mgr action_properties dbname employee prp_online_mode prp_sm_normal
|
|
|
|
2) Services API extension - nbackup support.
|
|
(Alex Peshkov, peshkoff@mail.ru, 2008)
|
|
|
|
Nbackup performs two logical groups of operations - locking/unlocking database
|
|
and backup/restore it. It doesn't make sense duplicating locking/unlocking in
|
|
services, cause that functionality is present remotely in much better (from any
|
|
point of view) in SQL language interface (ALTER DATABASE). But backup and restore
|
|
must be run on localhost and the only way to access them is nbackup utility.
|
|
Therefore expanding services API with this functionalty is very useful.
|
|
|
|
The following actions were added:
|
|
isc_action_svc_nbak - incremental nbackup,
|
|
isc_action_svc_nrest - incremental database restore.
|
|
The following parameters were added:
|
|
isc_spb_nbk_level - backup level (integer),
|
|
isc_spb_nbk_file - backup file name (string),
|
|
isc_spb_nbk_no_triggers - do not run DB triggers (option).
|
|
|
|
Samples of use of new parameters in fbsvcmgr utility (supposing login and
|
|
password are set using some other method):
|
|
Create backup level 0:
|
|
fbsvcmgr service_mgr action_nbak dbname employee nbk_file e.nb0 nbk_level 0
|
|
Create backup level 1:
|
|
fbsvcmgr service_mgr action_nbak dbname employee nbk_file e.nb1 nbk_level 1
|
|
Restore database from this files:
|
|
fbsvcmgr service_mgr action_nrest dbname e.fdb nbk_file e.nb0 nbk_file e.nb1
|
|
|