Deze pagina is automatisch vertaald. Lees het Engelse origineel. English

IBSurgeon-bibliotheek

Hoe verbindingsprotocollen voor Firebird op Windows in- of uitschakelen

Firebird op Windows heeft de volgende switches om verbindingsprotocollen expliciet in te schakelen:

  1. -i schakelt het INET-protocol in, dit wordt gebruikt wanneer de verbindingsreeks eruitziet als localhost:Disk\Path\database.fdb of server_name:Disk:\Path\database.fd b, voor 3.0 kan het ook inet://servername:disk:\path\bd.fdb zijn
  2. -x schakelt het XNET-protocol in. Op 2.5 en eerder is de verbindingsreeks het eenvoudige lokale pad Disk:\Path\database.fdb, op 3.0+ is het xnet://Disk:\Path\database.fdb
  3. -w schakelt het WNET (NetBEUI)-protocol in, voor verbindingsreeksen zoals \ \servername\disk:\path\database.fdb. Gebruik dergelijke verbindingsreeksen niet (het is het onderwerp van een ander artikel waarom dit slecht is)!

Standaard zijn alle protocollen ingeschakeld.

Echter, als een switch expliciet is opgegeven, worden niet-opgegeven protocollen uitgeschakeld!

Laten we naar het volgende voorbeeld kijken

Het standaardgedrag - alle 3 protocollen zijn ingeschakeld:

Code
C:\HQbird\Firebird30>firebird  -a

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  localhost:o:\OLTP30.V20190415.FDB
Database: localhost:o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  xnet://o:\OLTP30.V20190415.FDB
Database: xnet://o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  \\Win-0u7pnfkg57p\o:\OLTP30.V20190415.FDB
Database: \\Win-0u7pnfkg57p\o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL>exit;

Alleen XNET (lokale verbinding) is toegestaan:

Code
C:\HQbird\Firebird30>firebird  -a  -x

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  localhost:o:\OLTP30.V20190415.FDB
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "localhost".
-Failed to establish a connection.
Use CONNECT or CREATE DATABASE to specify a database
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  xnet://o:\OLTP30.V20190415.FDB
Database: xnet://o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  \\Win-0u7pnfkg57p\o:\OLTP30.V20190415.FDB
Statement failed, SQLSTATE = 08006
Unable to complete network request to host ".".
-Failed to establish a connection.
-The system cannot find the file specified.
Use CONNECT or CREATE DATABASE to specify a database
SQL> exit;

Alleen INET (TCP-verbinding) is toegestaan:

Code
C:\HQbird\Firebird30>firebird  -a  -i

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  localhost:o:\OLTP30.V20190415.FDB
Database: localhost:o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  xnet://o:\OLTP30.V20190415.FDB
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "xnet://Global\FIREBIRDHQBIRD".
Use CONNECT or CREATE DATABASE to specify a database
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  \\Win-0u7pnfkg57p\o:\OLTP30.V20190415.FDB
Statement failed, SQLSTATE = 08006
Unable to complete network request to host ".".
-Failed to establish a connection.
-The system cannot find the file specified.
Use CONNECT or CREATE DATABASE to specify a database
SQL> exit;

INET- en XNET-verbindingen, maar sta WNET niet toe:

Code
C:\HQbird\Firebird30>firebird  -a  -i -x

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  localhost:o:\OLTP30.V20190415.FDB
Database: localhost:o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  xnet://o:\OLTP30.V20190415.FDB
Database: xnet://o:\OLTP30.V20190415.FDB, User: SYSDBA
SQL> exit;

C:\HQbird\Firebird30>isql -user SYSDBA -pass masterkey  \\Win-0u7pnfkg57p\o:\OLTP30.V20190415.FDB
Statement failed, SQLSTATE = 08006
Unable to complete network request to host ".".
-Failed to establish a connection.
-The system cannot find the file specified.
Use CONNECT or CREATE DATABASE to specify a database
SQL> exit;

Deze switches kunnen worden gebruikt om Firebird te beheren in de applicatiemodus en in de servicemodus.

Als u bijvoorbeeld verbindingen met de Firebird-server via het netwerk wilt beperken, kunt u de switch -x gebruiken.

Een andere goede toepassing van switches: als u WNET-fouten in firebird.log ziet, betekent dit dat iemand een WNET-verbindingsreeks gebruikt. Specificeer -i -x, en u zult gebruikers met een WNET-verbindingsreeks gemakkelijk identificeren aan hun luide kreten :)

Vond u het leuk? Wilt u meer Firebird-tips, trucs en grappen? Abonneer u op het FirebirdSQL telegramkanaal!