Subject Re: [firebird-support] Re: Database shutdown required for applying gfix -write sync ??
Author Helen Borrie
At 10:12 PM 8/12/2010, tjjjohnson wrote:
>Interesting that you say its required. It seems the forced writes setting can be applied without shutting the database down ...

The gfix -w command must be run by sysdba in exclusive access. If there are users attached, a database shutdown is required. Now, this shutdown-thing is complicated, as what "shut down" means depends on what version of Firebird server you are running. V. 2.0 (AFAIR) brought in a variety of shutdown modes, whereas, previously it had been an on/off switch. In essence, though, it's shutdown first, as only sysdba or owner can connect to a shut-down database.

>will it not take effect until the database is shutdown?

We are talking here about a shut-down database, not a shut-down server. Note, though, that if you're on Windows and you modify the related MaxUnflushedWrites or MaxUnflushedWriteTime settings, *then* you must restart the server for it to take effect.

>I guess it sounds like it will be best to shutdown the database first anyway.

It should be a no-op if attempted using gfix -w on a non-shut-down database. You should see a message of some kind in firebird.log. If the request comes via the Services API it should except.

Pre 2.0.3? (not exactly sure which sub-release now) there was a loophole (legacy bug) whereby an ordinary user could change the Forced Writes setting (along with some other dangerous activities) via the regular API connection mechanism. Some utilities at that point that were built on drivers that exploited that loophole...hence, it was possible for non-privileged users of third-party applications to change it at will.