How to check in which server mode (e.g. SuperClassic or Superserver) a Firebird database is running? - firebird

The latest Firebird 2.5.x database can run in either Classic, SuperClassic, or SuperServer mode. How can I check in which of these modes an installed database is running?

There's no API that exposes this. But because you're on a server, you can check what process is running.
I.e. on Windows and Firebird 2.5:
One fb_inet_server.exe = very likely SuperClassic
Multiple fb_inet_server.exe = very likely Classic
fbserver.exe = very likely SuperServer

Firebird 4+ has RDB$CONFIG table.
To read ServerMode see record with rdb$config_name='ServerMode':
select rdb$config_value from RDB$CONFIG where rdb$config_name='ServerMode'

Related

Is Firebird database file compatible to Firebird Embedded database

Is it possible to open a Firebird database file also with a Firebird Embedded of the same Firebird version? Sure, I am aware I can't keep the same file open via FB Embedded and FB at the same time. But after closing the Firebird connection it should be possible to connect with FB Embedded, right? Are there any restrictions when connecting over FB Embedded. My question concerns Firebird Version 3.0 or higher.
I expect that this is possible without any restriction.
The Firebird Embedded library uses the exact same database engine as the full blown Firebird server (plugins\engine12.dll in the case of Firebird 3.0). The difference is that a Firebird server accepts remote connections over TCP/IP (and NetBEUI), and - on Windows - connections from other processes using XNET and uses authentication, while Firebird Embedded is an in-process database engine which can only be used from within that process, and relies only on filesystem permissions to decide if you're allowed to open a database.
In other words, it uses the exact same database file format.
As an aside, it is possible to use a Firebird server and Firebird Embedded together on the same database concurrently, if ServerMode is configured appropriately in the firebird.conf of both (to SuperClassic/ThreadedShared or Classic/MultiProcess), and both use the same lock-directory (which would be the default situation).
A Firebird 3.0 server can only open databases with On-Disk Structure (ODS) 12.x, while Firebird 4.0 can - by default - only open databases with ODS 13.0. It is possible to include the engine12.dll of Firebird 3.0 in Firebird 4.0, and configure Firebird 4.0 to open a Firebird 3.0 database with that specific plugin.

Postgresql with IBM App Connect Enterprise

I am trying to use IBM APP Connect Enterprise to connect to a Postgresql Datasource and execute Database complex queries (Complex SELECT, INSERT, UPDATE Statements)
All I can find is the loopback node which is using limited (select, insert and update) statements.
Is there any option that I can include an esql having a PASSTHRU function as the one used with ODBC (Oracle datasources)?
You could use App Connect for the interactions with Postgresql: https://www.ibm.com/docs/en/app-connect/containers_cd?topic=examples-connecting-app-connect-postgresql
You should be able to call your App Connecto flow using a Callable Flow (via the Switch Server): https://www.ibm.com/docs/en/app-connect/12.0?topic=pecf-preparing-environment-split-processing-between-app-connect-enterprise-app-connect-cloud
You should be able to add a postgresql database as an ODBC database through the UnixODBC layer (i.e. add an entry to the odbcinst.ini file), it's not directly supported though, so if you find an issue you'd need to reproduce with a supported database.
I haven't tried it myself yet, I should hopefully have time in the not too distant future.
Searching the internet for "unixodbc postgres odbcinst.ini" gave some good results, which is where I'd start.

Error SQLCODE -904 in firebird after installation

I installed firebird database for the first time in my life (version 1.5.6 on Windows 7), after installation I can not connect to the sample database (employee.fdb exists), or create a database. This gives the following error in ISQL Tool:
C:\Program Files\Firebird\Firebird_1_5\bin>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> CONNECT "C:\Program Files\Firebird\Firebird_1_5\examples\employee.fdb"
CON> user 'SYSDBA' password 'masterkey';
Statement failed, SQLCODE = -904
unavailable database
SQL> create database 'C:\test.fdb'
CON> user 'SYSDBA' password 'masterkey';
Statement failed, SQLCODE = -904
unavailable database
Firebird 1.5 was written (long) before Windows 7, and before things like UAC existed. It may simply be that Firebird 1.5 doesn't work correctly with Windows 7, or that it requires additional effort to work. I'd suggest to install Firebird 2.5.2 (update 1) as that is the latest version and is known to work with Windows 7.
Another problem might be that local system connections don't work as I seem to remember that Firebird 1.5 uses an older local protocol which doesn't work on newer Windows versions. This protocol was replaced in Firebird 2.0. To workaround that you need to include the hostname in the CREATE DATABASE or CONNECT statement, so for example:
create database 'localhost:C:\test.fdb' user 'SYSDBA' password 'masterkey';
Windows 7+ breaks the local api protocol. You have to use Tcpip protocol to connect to the database, even for local connections.

How to check remote Oracle server is up and running

I have my Oracle server installed in a remote machine and I want a script at my local machine which will check whether Oracle server is up and running or not. I know this can be check by creating a connection through sqlplus or JDBC. But in this case oracle client won't be present and I am saving JDBC approach as my last option. So is there any other simpler way to check this, which can be easily implemented in a shell script???
Thanks
Not really. The only way to be certain that the database is responding to queries is to run a query on it, such as the venerable:
select dummy from dual

How do I see what queries are running on an interbase database

I have a Interbase 7.x database being used by an application.
I want to know which queries are run by that application in different scenarios.
Does anyone know about how to "profile" an interbase database and see which queries are currently running?
Use InterBase Performance Monitor. It's built into IBConsole, or you can get a standalone version.
Alternately:
SELECT * FROM TMP$STATEMENTS;