Subject Re: [firebird-support] How can I check if a database is online or shutdown?
Author Teträm Corp
hi,

afaik, the only way to know if a database is shutdown is to connect to
with a non-SYSDBA user. It will fail if the database is shutdown.

which components are you using? because, if i remember well, with IBX
and UIB, you can process a shutdown even if the database already is.

Jose Ostos a écrit :
> I am using firebird 2.0.1 and delphi 7.
>
> I want to to a program a procedure to backup and/or restore a database.
> My program would first do the following:
> a) That only the user doing the backup is logged in
> b) check that the user is only user is SYSDBA
> c) Chech if the database is "online" or "Shutdown". (don't know how to
> do this)
> d) Shudown DB if not already shutdow.
> e) do the operation (backup or restore)
> f) Bring DB Online
>
> If something goes wrong somewhere in between, the DB can be "online" or
> "Shutdown" depending on where it failed. I get an error if I try to
> "shutdown" a DB that is already "Shutdown" or if I try to bring "online"
> a DB that is already "online" so I can't seem to run any of these
> processes "just to make sure".
>
> Thanks in advance,
> Jose Ostos
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>