Wednesday, October 7, 2015

How to install/upgrade Firebird manually on El Capitan


Background: The current Firebird automatic installer on El Capitan is no longer working, its format has been
finally deprecated. The installer is currently undergoing a complete re-write to comply with the Flat Package Format. Until this work is completed, you can manually install Firebird using the following method.

Classic

Download FirebirdCS-2.5.4-26856-x86_64.pkg.zip
Unzip it
cd FirebirdCS-2.5.4-26856-x86_64.pkg
cd Contents
gunzip Archive.pax
pax -r -f Archive.pax (or unpack the file using Finder)
as sudo
cp -r Firebird.framework /Library/Frameworks/Firebird.framework
cd Resources
./postinstall

If you are upgrading from a previous version use:
./preupgrade
and then
./postupgrade

SuperServer

Download FirebirdSS-2.5.4-26856-x86_64.pkg.zip
Then follow the same steps as above, and ignore any errror messages that reference
a, /Resources/doc/doc: No such file or directory
b, chmod /Library/StartupItems/Firebird/Firebird: No such file or directory
c, /Library/LaunchDemons/org.firebird.gds.plist: service is already loaded.

a ps -eaf should show both fbserver and fbguard running.

Monday, July 27, 2015

gbak -stat

From the Bug Tracker:

Vlad Khorsun commented on CORE-1999:
------------------------------------

gbak now has a new command-line switch

    -ST(ATISTICS) TDRW    show statistics:
        T                  time from start
        D                  delta time
        R                  page reads
        W                  page writes

Sample output:

firebird>gbak -v -stat tdrw -r o a.fbk a.fdb
gbak:opened file a.fbk
gbak: time     delta  reads  writes
gbak:    0.173  0.173      0      0 transportable backup -- data in XDR format
gbak:    0.175  0.002      0      0             backup file is compressed
gbak:    0.177  0.001      0      0 backup version is 10
gbak:    0.270  0.092      0    650 created database s:\Temp\A+.FDB, page_size 8192 bytes
gbak:    0.273  0.002      0      2 started transaction
gbak:    0.274  0.001      0      0 restoring domain RDB$29
gbak:    0.275  0.001      0      0 restoring domain RDB$12
...
gbak:   18.661  0.002      0      0 restoring data for table TEST1
gbak:   18.698  0.036      0      0    10000 records restored
gbak:   18.735  0.036      0      0    20000 records restored
...
gbak:   25.177  0.036      0      0    1770000 records restored
gbak:   25.220  0.042      0   1633    1780000 records restored
gbak:   25.256  0.036      0      0    1790000 records restored
...
gbak:   38.702  0.002      0      0     restoring privilege for user SYSDBA
gbak:   38.707  0.004     22      0 creating indexes
gbak:   45.015  6.308     82  38394     activating and creating deferred index T2_VAL
gbak:   45.132  0.116      3      9     activating and creating deferred index TEST_S_UNQ
gbak:   46.486  1.354      0  10775     activating and creating deferred index RDB$PRIMARY1
gbak:   46.566  0.079      0      9     activating and creating deferred index T1_IDX
gbak:   46.661  0.095      5     15 committing metadata
gbak:   46.665  0.003      8     10 fixing views dbkey length
gbak:   46.666  0.001      1     18 updating ownership of packages, procedures and tables
gbak:   46.671  0.005      0      0 adding missing privileges
gbak:   46.673  0.001      0      0 fixing system generators
gbak:   46.682  0.008      4     13 finishing, closing, and going home
gbak:   46.684  0.002    171  82442 total statistics
gbak:adjusting the ONLINE and FORCED WRITES flags

Monday, June 1, 2015

The semantics of isc_tpb_autocommit

From Vlad Horsun:

A simplified overview of the autocommit code:

When a transaction, marked as TRA_autocommit performs any of following actions, it is marked also as TRA_perform_autocommit

  • insert
  • update
  • delete
  • select with lock
  • post event
The TRA_perform_autocommit flag is checked when
  • the engine receives input message
  • the engine sends an output message
  • the engine starts to execute a request
  • the engine finishes executing a DDL request
When the TRA_perform_autocommit flag is detected, the engine runs on-commit triggers (not for DDL, that looks like a bug) and performs commit retaining. A new transaction will have TRA_autocommit flag set and TRA_perform_autocommit not set.

Wednesday, February 18, 2015

Yosemite, SuperServer, and StartupItems


There seems to be a small problem with Firebird on Yosemite (OSX 10.10), it looks like Apple have finally deprecated StartupItems, and currently SuperServer uses this to start itself on reboot.

Apple state:
"Startup Items
Deprecation Note: Startup items are a deprecated technology. Launching of daemons through this process may be removed or eliminated in a future release of OS X."

Which is obviously what has happened.

This is followed by

"Unless your software requires compatibility with OS X v10.3 or earlier, use the launchd facility instead."

Which is currently what Classic does.


If you install Firebird after upgrading to Yosemite, you can start the server manually by simply using

/Library/StartupItems/Firebird/Firebird start

However if Firebird was already installed, it looks as if the StartupItems folder is removed during the upgrade, but you should be able to start the server using the following....

/Library/Frameworks/Firebird.framework/Resources/bin/fbguard -daemon -forever

But if you want Firebird SuperServer to start automatically on reboot you could use the following org.firebird.gds.plist file in /Library/LaunchDaemons



and the command

launchctl load org.firebird.gds.plist

should now start Firebird immediately and also on reboot.

Update 2nd July 2015

I got an email from David Nock suggesting that the following plist would do a better job at managing SuperServer on Yosemite (10.10). Some brief tests suggest that he is right. I will be committing the following for 2.5.5, but I am documenting this here in case anybody wants to use this.