Skip to content

Example of database backup via services#33

Merged
AlexPeshkoff merged 1 commit into
FirebirdSQL:masterfrom
aafemt:backex
Jun 2, 2016
Merged

Example of database backup via services#33
AlexPeshkoff merged 1 commit into
FirebirdSQL:masterfrom
aafemt:backex

Conversation

@aafemt
Copy link
Copy Markdown
Contributor

@aafemt aafemt commented Jun 1, 2016

Also made example 01 bult on Windows where there is no setenv().

Comment thread examples/interfaces/10.backup.cpp Outdated
// 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");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of samples use employee database which tends to be present on a server after installation.
Why not use it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Copy Markdown
Member

@AlexPeshkoff AlexPeshkoff Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't backup service use embedded access and thus bypass database security completely?..

@aafemt
Copy link
Copy Markdown
Contributor Author

aafemt commented Jun 2, 2016

As you wish.

@AlexPeshkoff AlexPeshkoff merged commit 5d6030d into FirebirdSQL:master Jun 2, 2016
@aafemt aafemt deleted the backex branch June 17, 2016 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants