Example of database backup via services#33
Conversation
| // Build service start SPB | ||
| spb2 = utl->getXpbBuilder(&status, IXpbBuilder::SPB_START, NULL, 0); | ||
| spb2->insertTag(&status, isc_action_svc_backup); | ||
| spb2->insertString(&status, isc_spb_dbname, "fbtests.fdb"); |
There was a problem hiding this comment.
Most of samples use employee database which tends to be present on a server after installation.
Why not use it here?
There was a problem hiding this comment.
I, actually, thought about sequence of examples: create - backup - restore. Employee is just an alias, it could have a problem on last step. But if you wish, I'll change the name.
There was a problem hiding this comment.
@AlexPeshkoff what happens if file name used in isc_spb_dbname is different than one used in isc_spb_expected_db? Could someone authenticate with one plugin and backup a database that uses another authentication plugin?
There was a problem hiding this comment.
@aafemt I think it will be correct to use employee in backup and what else you wish at restore. employee_copy.fdb or anything else you wish. It's good idea when samples run out of the box.
BTW, nothing prevents us from adding to examples dir small .fbk file to be used in restore example.
There was a problem hiding this comment.
@asfernandes If databases in isc_spb_dbname and isc_spb_expected_db have same security database service will definitely work. If not - it depends upon mapping rules in a database isc_spb_dbname.
What about ability to authenticate with one plugin and backup a database that uses another authentication plugin - yes, it's possible if configuration and/or mapping enable attach to that database with such credentials. For example if both databases use same security database that's definitely possible.
There was a problem hiding this comment.
Doesn't backup service use embedded access and thus bypass database security completely?..
|
As you wish. |
Also made example 01 bult on Windows where there is no setenv().