Subject Re: [ib-support] Backup and restore of a database
Author Helen Borrie
At 03:05 PM 18/03/2003 +1000, you wrote:
> > You shouldn't be renaming database files in their normal location while
> > server is running, anyway. Of course you can expect corruption if you try
> > to do any filesystem-level things to the database whilst users are
> > connected, or trying to connect. You can't fix a puncture on a moving
>Is it possible to disconnect a single database without taking down the whole

Yes. You need to get exclusive access by performing a gfix -shut[down]
with the -force switch if necessary.

>I need to run 2 applications and allow access to one while
>maintaining the other.... Also, is renaming a database the same as copying
>the file? That is, can renaming the file corrupt the database as well?

No. In fact, if any connections are active, you won't be able to rename
the database. That's a good test for whether it's clear to carry on
maintenance. (Gbak backups and sweeps don't need a shut-down db though...)

>seem to be able to copy a database while connected and copy it back over

Yes, for sure you can copy it while connected (but don't!) On Win2K, I
can't manage to overwrite an open DB file but I can't say whether other OS
variants will allow it. Another problem that can give corruption occurs if
you allow users to log in during a database restore. Once the operating
system has begun to lay down the file to disk, there's nothing to stop this

>Not recommended that you try this at home.... However, if you
>try to rename the file, it says it is in use... Is it safe to rename an
>interbase database? If it works no one was connected...?

Eggzackerly...ONLY if no-one is connected - not even sysdba.

> > You shouldn't even try to perform metadata updates whilst you don't have
> > exclusive access to the database...
>Is it possible to enforce this without shutting down the server?

Yes - do a shutdown -force. Once the shutdown is in effect, nobody else
can then log in. You will have exclusive access then until you log
out. Warning: if another user tries to log in as sysdba, owner or root,
shutdown won't stop them. I assume you have these basic security things
taken care of.

>Also, what
>can I check to ensure my database isn't currently in use?

Just try to rename it.