Subject Re: FireBird Services Manager, backup/restore and isc_service_query/start
Author benedicte_asselin
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
> >
> > Hello,
> >
> > I am looking at the API doc to use isc_service_start for database
> > backup/restore.
> > If I understand well, I can check if a task is already running
using
> > the "current" service_handle (using isc_service_query and
> > isc_info_svc_running).
> >
> > But, I would like to prevent my program from running several
> > tasks=backup/restore (in different service_handle) at the same
time.
> > Mainly, I would like to avoid several backups of the *same*
database.
> >
> > Is there something I missed that could help ?
> >
> >
> > Am I right to assume the "isc_service_start" call is
asynchronous ? I
> > cannot test it on a huge database for the moment to check
manually.
> >
> > We are using FB 1.5.
> >
> > Regards,
> > Bénédicte
> >
>
> I can't answer this directly but since noone else seems to have
made any
> comments I would have to pipe up that I think you are going about
this the
> wrong way. If there are many users on your system, I would
necessarily
> prevent ALL of them from backing up the database and make it an
activity for
> the server only.
> Alan
> PS - you could shutdown the database from a client who would
necessarily be
> SYSDBA and would also require that all other users NOT be SYSDBA.
Then you
> could backup without anyone attached.
> Please tell us why you think you need this ability. What are you
trying to
> avoid?

My app almost work this way:
I have one or several server processes, and several FB databases. All
the server processes can accesss all the databases (at the same time).

Most of the client apps will only do SELECT requests in the databases.
I have a special client, for administration only (it creates/removes
databases, performs manual backups, restore...). This client may be
used by one person only. Other clients don't do "backup".

There is no issue with SYSDBA or any other Firebird-oriented users.

I can setup automatic backups, which are launched automatically by
the server process. But I don't want to stop my server during the
backup preventing the client apps from accessing the data (one backup
may last one or several hours, with very large databases).

I don't want to launch an automatic backup if another one is running
(each automatic backup using a different service handle) even for a
another database. (because it may slow down hard drive performance).

I also want to prevent a user from launching a manual backup/restore
on a database which is currently being backed up automatically.

I have used the "isc_service_query" to wait for the end of the
backup/restore, but I can't find any way to know if other
backup/restore services are currently running.

I think I will not use any other kind of service. I can switch to FB
2.0 if needed but not right now.

Thanks for your help.
Bénédicte