The problem is twofold:
First Firebird 3 uses tighter security and has the old authentication mechanism disabled by default. So clients depending on older connection libraries will not work out of the box.
To allow the old authentication mechanism to work, the following setting needs to be set in firebird.conf:
AuthServer = Legacy_Auth, Srp, Win_Sspi
(be sure to remove the #
prefix)
Second, the pure-java wire protocol implementation of Jaybird (the Firebird JDBC driver) uses an outdated authentication mechanism that is not supported by this Legacy_Auth
option. Using Jaybird to connect to Firebird 3 at this time will only work if you use the native option (with the jdbc:firebirdsql:native:
URL-prefix and jaybird2x.dll and fbclient.dll).
Addendum 1
Firebird 3 (since Alpha 1) has now also implemented the old authentication method used by Jaybird, so Jaybird will now also work without using the native library (as long as the legacy authentication is enabled, and the user has been setup with the legacy usermanager).
See also Jaybird and Firebird 3
Addendum 2
Jaybird 3 and higher support the more secure Srp authentication model out of the box, and Jaybird 3.0.4 introduced support for the wire protocol encryption. This means that it can connect to Firebird 3 without additional configuration.
Here's a short step-by-step walkthrough:
- disconnect users and disable incoming connections to the database
- make a copy of database file (or two copies) and work on that
- use GFIX with -v option to validate the database file
- use GFIX with -v and -f to do full validation
If problem is not too serious, you can try to backup the broken db and restore under a new name:
- use GFIX -mend to prepare corrupt database for backup
- use GBAK -b -g to backup the database. -g disables garbage collection
- use GBAK -c to restore backup to a new database.
If you succeed, you have fixed the problem and have a functional database. If not, you can try to create an empty database with the same structure and pump the data to it .
One of the reasons why backup or restore can fail is if some broken database triggers exist, and prevent connection to the database. For example, a database trigger might use some table which has a broken index, etc. To work around this, connect to database with isql tool using -nodbtriggers option and then disable those triggers. You can enable them later when you fix other problems and get a working database again.
Another reason restore might fail is when you have broken data, so some of validity constraints (check constraints, etc.) cannot be satisfied. In this case, you can try to restore your database using -N[O_VALIDITY] command switch to gbak.
If you're interested in a more detailed information of the process of fixing the database, as well as explanation of some types of corruption, take a look at the following page:
http://www.ibphoenix.com/resources/documents/search/doc_5
If all fails, you can try IBSurgeon tool, which is able to fix most problems and extract data. Also, IBSurgeon's website has a detailed
explanation of causes of database corruption and ways to fix it:
http://ib-aid.com/option,com_content/task,view/id,58/Itemid,62/
check this guide http://www.firebirdfaq.org/faq324/
Best Answer
Firebird has two distinct options for monitoring:
The monitoring tables, which provide a snapshot of activity on the server. For example
MON$STATEMENTS
provides the currently running statements. Note that content of monitoring tables are stable within a transaction, so to refresh it, you will have to commit and start a new transaction.The trace facility, which allows you to get information on activity in a database. It can be either be configured by an administrator to run server side, or users can do limited tracing of their own sessions remotely (users with administrator rights have more access). For details see Trace and Audit Services in the Firebird 2.5 release notes, and the article Audit and Trace Services in Firebird 2.5 by Thomas Steinmaurer.
Tooling included with Firebird is rather basic and low level, and you may want to look at third party tools that simplify access to this trace facility.
In addition, there are tools that act like a proxy for Firebird, allowing you to trace activity that way, for example FBScanner.
See also my answer on How to capture Firebird SQL queries? on Stack Overflow (as you already found).