Firebird FreeAdHoc UDF not working after restore on another server - firebird

I'm encountering a weird problem after I restored Firebird database. Production database (Firebird 2.1) runs on 64bit server and we're using FreeAdHoc library with extra functions. I've backed up production database with gbak, moved to local machine (64bit Ubuntu 13.10). Installed firebird 2.1.5 locally and downloaded latest FreeAdHoc library.
Now when I try to execute some function from it via iSQL:
/opt/firebird/bin/isql db.fdb -user sysdba -password masterkey -i /opt/firebird/bin/command.sql
and the content of command.sql is
select f_addday(current_timestamp,10) from rdb$database;
it runs properly and executes that UDF function.
HOWEVER, when I try to execute the same command via Flamerobin or PHP script, I get this error:
Engine Code : 335544343
Engine Message :
invalid request BLR at offset 59
function F_ADDDAY is not defined
module name or entrypoint could not be found
Can someone advise? I think that the fact that isql executes and flamerobin/php doesn't is a good lead but I lack an experience to figure out why it could be the case.
Thanks, Michal

Related

pg: unknown authentication message response: 10 (Golang) [duplicate]

I'm trying to follow the diesel.rs tutorial using PostgreSQL. When I get to the Diesel setup step, I get an "authentication method 10 not supported" error. How do I resolve it?
You have to upgrade the PostgreSQL client software (in this case, the libpq used by the Rust driver) to a later version that supports the scram-sha-256 authentication method introduced in PostgreSQL v10.
Downgrading password_encryption in PostgreSQL to md5, changing all the passwords and using the md5 authentication method is a possible, but bad alternative. It is more effort, and you get worse security and old, buggy software.
This isn't a Rust-specific question; the issue applies to any application connecting to a Postgres DB that doesn't support the scram-sha-256 authentication method. In my case it was a problem with the Perl application connecting to Postgres.
These steps are based on a post.
You need to have installed the latest Postgres client.
The client bin directory (SRC) is "C:\Program Files\PostgreSQL\13\bin" in this example. The target (TRG) directory is where my application binary is installed: "C:\Strawberry\c\bin". My application failed during an attempt to connect the Postgres DB with error "... authentication method 10 not supported ...".
set SRC=C:\Program Files\PostgreSQL\13\bin
set TRG=C:\Strawberry\c\bin
dir "%SRC%\libpq.dll" # to see the source DLL
dir "%TRG%\libpq__.dll" # to see the target DLL. Will be replaced from SRC
cp "%SRC%\libpq.dll" %TRG%\.
cd %TRG%
pexports libpq.dll > libpq.def
dlltool --dllname libpq.dll --def libpq.def --output-lib ..\lib\libpq.a
move "%TRG%"\libpq__.dll "%TRG%"\libpq__.dll_BUP # rename ORIGINAL name to BUP
move "%TRG%"\libpq.dll "%TRG%"\libpq__.dll # rename new DLL to ORIGINAL
At this point I was able successfully connect to Postgres from my Perl script.
The initial post shown above also suggested to copy other DLLs from source to the target:
libiconv-2.dll
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
libintl-8.dll
However, I was able to resolve my issue without copying these libraries.
Downgrading to PostgreSQL 12 helped

Employee database script is not running in Mysql

I am new to the mysql , I downloaded the employee database zip file extracted it. Then I run the script file but its always giving me error that this file is already being used.
Here's a snap of error.
MySQL Workbench
Run SQL Script
[WinError 32] The process cannot access the file because it is being used by another process:
'C:\Users\Kushagra\AppData\...\tmpd26qry86,cnf'
Can someone please explain how to solve the issue? Is there any another way to import ?
I'm using
MySQL Shell 8.0.25
MySQL Workbench 8.0 CE
Can you check the background process of MySQL using task manager? It may acquire the process and preventing the script from execution.
After finding a lot of solutions and none seemed to affect I downgraded my MySQL workbench version.
Initial version : 8.0.25
Downgraded version (worked fine) : 8.0.20

Is it possible to backup Firebird DB when using SuperServer on Windows Server 2016?

When I execute Firebird 3.0.x backup command:
c:\Db>"C:\Program Files\Firebird\Firebird_3_0\gbak.exe" -b c:\Db\Db1.fdb c:\Db\Db1_backup.fbk -garbage_collect -transportable -verify -user SYSDBA -pas PASSWORD
Error 1 happend:
gbak: ERROR:I/O error during "CreateFile (open)" operation for file "C:\DB\DB1.FDB"
gbak: ERROR: Error while trying to open file
gbak: ERROR: The process cannot access the file because it is being used by another process.
gbak:Exiting before completion due to errors
Example 2 with TCP/INET/localhost/remote protocols:
c:\Db>"c:\Program Files\Firebird\Firebird_3_0\gbak.exe" -backup inet://c:\Db\Db1.fdb d:\_Backups\Db1_20180702_230546.fbk -garbage_collect -transportable -verify -skip_data SOMETAB_TO_SKIP -user SYSDBA -password PASSWORD123
Error 2 happend:
gbak: ERROR:Your user name and password are not defined. Ask your database administrator to set up a Firebird login.
First of all ... to be honest I am not sure when this started or why. I did not look at my server maybe 3 months but today my backup disk broke down so I had to. I just saw this error first time today and I lived in conviction that my backup works. But I had Firebird 2.5 before.
The question is: is this specific only for Firebird 3 SuperServer on Windows? And there is no way how to backup Firebird 3 SuperServer database when is used by FB server?
Tested and failed on Firebird server 3.0.2 and 3.0.3 on Windows Server 2016.
Firebird is running as a service
Nothing is changed in firebird.config except:
WireCompression = true
RemoteServicePort = 1234
CpuAffinityMask = 8
ServerMode = Super or SuperClassic (when I testing it)
When I execute first command on SuperClassic it works.
When I execute first command on SuperServer 2.5.x it works.
Ok, so I finally figured out where is the issue. Here is the explanation:
My password is wrong!
BUT!
When I use SuperClassic I can use WRONG password and Firebird allows access to the database. (as local user)
When I use SuperServer I can use WRONG password and Firebird allows access to the database WHEN I am the FIRST connection! (as local user with and also without remote protocols)
When I use SuperServer and I use WRONG password Firebird denied access to the database WHEN I am the second (and more) connection! (local also remote user)
With only remote protocols you can not access database with wrong password.
(By remote protocols I mean this.)
This are the reasons of the differences in behavior and why I did not see using of WRONG password. Thanks to everybody who tried to help me.

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 recover sybase database (unknown db version)

I have a database file (*.db) that need to be recovered.
The bad is, the end-user have null idea of the version of the database. Not know the password. The original developer is lost. The computer where was installed was formatted. We have not experience in this database software. Yeah, nightmare.
My guess is a old database. I'm trying to open it in Sybase 11, dev edition.
I follow this steps: http://dcx.sybase.com/1101en/sachanges_en11/unloading-reloading-upgrading-newjasper.html
I try to use the UNLOAD utility from command line & from the Sybase central utility. From command line I do:
./dbinfo -c "DBF=/Users/mamcx/Downloads/CEMDE_ENDOCRINO_S.A.DB;UID=DBA;PWD=sql"
SQL Anywhere Information Utility Version 11.0.1.2045
Unable to start specified database: '/Users/mamcx/Downloads/CEMDE_ENDOCRINO_S.A.DB' was created by a different version of the software
Ok, I try to unload:
./dbunload -c "DBF=/Users/mamcx/Downloads/CEMDE_ENDOCRINO_S.A.DB;UID=DBA;PWD=sql" -n /Users/mamcx/Desktop/
SQL Anywhere Unload Utility Version 11.0.1.2045
Connecting and initializing
***** SQL error: Unable to start database server
Ok, from the server admin tool:
dbunload -v -c "UID=dba;PWD=***;DBF=/Users/mamcx/Downloads/CEMDE_ENDOCRINO_S.A.DB" -an "/Users/mamcx/Desktop/baba.db" -ap 4096 -ea None -ii -sa -so _sc866192545
Connecting and initializing
***** SQL error: Unable to start database server
An error occurred while attempting to unload the database '/Users/mamcx/Downloads/CEMDE_ENDOCRINO_S.A.DB'.
Exist a way to know the version of the database server used to create this? Is possible to recover this file?
I don't know how to get the version out of the Database File if you are not able to start it.
You could get a hint from the hopefully existing Client PC's. Check the ODBC Driver Version they have installed.
I had good success with the support of Sybase. If you or your client has a support contract you can get them involved.
HTH
Try to simply start a server with that database and capture the output with -z -o server.out. The server.out file should contain a more specific error telling you why it can't start the database. This error can occur if you are trying to start something that is not a SQL Anywhere database.
You may also want to post this question over at http://sqlanywhere-forum.sap.com/.