Subject Re: How to use gbak, gfix and isql on embedded server?
Author Sean
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 06:16 AM 15/01/2007, you wrote:
> >Hi,
> >
> >Our application uses embedded server w/o SS installed.
>
> Embedded is SS.
>
> >Can I use gbak, gfix and isql to connect ot embedded server for
maintenance
>
> Yes. They are embedded applications too, so the same rules apply to
> them with regard to relative locations of the executable and the
> client library as apply to any other embedded application.
>
> Gbak and gfix require an authenticated user for some operations. As
> the embedded client bypasses user authentication, you need to use
> some other way for the server to know that the user is
> authorised. In your own applications you can pass them via the
> Services API, which is the HIGHLY RECOMMENDED way to do admin tasks
> with embedded. For the command line tools you have only one option,
> which is to set the ISC_USER and ISC_PASSWORD environment variables
> in the local user's environment space.
>
> >tasks? I tried to figure out the command line parameters but
failed. :-(
>
> There is documentation for the command-line tools. You can read
> brief help at the command line by entering the name of the executable
> without any switches. Fuller documentation is in the OpGuide.pdf
> of the IB 6.0 docset. Even fuller documentation is in the last part
> of The Firebird Book. Newer features you can catch up on in the
> release notes. If ISC_USER and ISC_PASSWORD are set, none of the
> tools needs the -user or -password switches.
>
> And don't forget that v.1.5 embedded can't access databases via a
> network protocol.
>
> But, for deployment, you should not rely on users to do stuff via the
> command line tools. You can write batch files to set the variables,
> run one or more specific commands and unset the variables. Only a
> privileged user, e.g. Admin, should have access to these scripts, so
> you should password-protect them.
>
> And remember that, once attached, the current Windows user has an
> exclusive lock on the database file. If you have a script running,
> the ordinary user won't be able start his application, and vice versa.
>
> But by far the proper way to make admin tasks available for your
> deployed software is to write an admin program and use the Services
> API, which provides its own structure for supplying username and
> password. Most host language interfaces (Jaybird, Delphi, .NET,
> etc.) provide wrappers for the Services API.
>
> ./heLen
>

I totally agree. By .NET I wrote my own isql, and several maintenance
functions such as backup/restore, scheduled sweep, scheduled update
statistics.

I am worried that after deployment if a database gets corrupted, I
need better tools such as gfix to fix the problem. That's why I was
wondering how to use gfix / isql to manage an embedded database.

Back to the original question: I did the following
1. On a win2k3 server with firebird service installed, stopped the service
2. copied firebird embedded files into firebird 1.5 .\bin folder
3. added ISC_USER of SYSDBA, and ISC_PASSWORD of a junk password, and
double checked to make sure they were available in commnad prompt
4. in command prompt, went to the folder with the database, launched
isql by "isql <database path & name>"

I got an error of "Statement failed, SQLCODE = -904" "unavailable
database"

Are the steps wrong?

Best,
Sean