Icon Configuring and Starting the Server

Introduction
There are no extra steps required in order to use the TDBISAMEngine component in DBISAM as a client engine since the default value of the EngineType property is etClient. However, in order to use the TDBISAMEngine component in DBISAM as a database server you will need to make some property changes before starting the engine.

Configuration Properties
The TDBISAMEngine component has several key properties that are used to configure the database server, which are described below in order of importance:

PropertyDescription
EngineTypeIn order to start the TDBISAMEngine component as a database server, you must set this property to etServer.
EngineSignatureNormally this property is left at the default value. However, if you do choose to change this property, you must make sure that it is set to desired value before starting the server. The default value is "DBISAM_SIG". Please see the Customizing the Engine topic for more information.
ServerNameThis property is used to identify the database server to external clients once they have connected to the database server. The default value is "DBSRVR".
ServerDescriptionThis property is used in conjunction with the ServerName property to give more information about the database server to external clients once they have connected to the database server. The default value is "DBISAM Database Server".
ServerMainAddressThis property specifies the IP address that the database server should bind to when listening for regular incoming data connections. The default value is blank (""), which specifies that the database server should bind to all available IP addresses.
ServerMainPortThis property specifies the port that the database server should bind to when listening for regular incoming data connections. The default value is 12005.
ServerMainThreadCacheSizeThis property specifies the number of threads that the database server should actively cache for regular data connections. When a thread is terminated on the server it will be added to this thread cache until the number of threads cached reaches this property value. This allows the database server to re-use the threads from the cache instead of having to constantly create/destroy the threads as needed, which can improve the performance of the database server if there are many connections and disconnections occurring. The default value is 10.
ServerAdminAddressThis property specifies the IP address that the database server should bind to when listening for incoming administrative connections. The default value is blank (""), which specifies that the database server should bind to all available IP addresses.
ServerAdminPortThis property specifies the port that the database server should bind to when listening for incoming administrative connections. The default value is 12006.
ServerAdminThreadCacheSizeThis property specifies the number of threads that the database server should actively cache for administrative connections. The default value is 1.
ServerEncryptedOnlyThis property specifies whether all incoming regular data connections should be encrypted or not. If this property is set to True, then all incoming regular data connections to the database server that are not encrypted will be rejected with the error code 11277, which is defined as DBISAM_REMOTEENCRYPTREQ in the dbisamcn unit (Delphi and Kylix) or dbisamcn header file (C++Builder). The default value is False.

Information Administrative connections to the database server must always encrypted and will be rejected if they are not encrypted, regardless of the current value of this property.
ServerEncryptionPasswordThis property specifies the password to use for all encrypted connections. If an incoming encrypted connection does not use a password that matches this value of this property, the database server will return the error code 11308, which is defined as DBISAM_REMOTEINVREQUEST in the dbisamcn unit (Delphi and Kylix) or dbisamcn header file (C++Builder), when any call to the database server is attempted after the connection is made. The default value is "elevatesoft".

Information If you intend to use encrypted connections to a database server over a public network then you should always use a different encryption password from the default password.
ServerConfigFileNameThis property specifies the name of the configuration file that the database server will use for storing all server configuration information including users, databases, server-side procedures, user rights, and scheduled events. This file is compressed and encrypted, and a backup is made, with the extension ".scb", any time a modification is made. The default value is "dbsrvr.scf".

Information Any new configuration file name specified via this property will be given the default extension of ".scf" automatically.
ServerConfigPasswordThis property specifies the password to use to encrypt the contents of the server configuration file. This ensures that if someone does obtain physical access to the configuration file that they will still be unable to read its contents, especially user names and passwords, without this password.

Information All of the properties of the TDBISAMEngine component described above can only be modified when the Active property is False and the engine has not been started.

Starting the Server
Once you have configured the database server using the above properties, starting the server is quite simple. All you need to do is set the Active property to True. The following shows an example of how one might configure and start a database server using the default global Engine function in the dbisamtb unit (Delphi and Kylix) or dbisamtb header file (C++Builder):

with Engine do
   begin
   ServerName:='MyTestServer';
   ServerDescription:='My Test Server';
   { Only listen on this IP address }
   ServerMainAddress:='192.168.0.1';
   ServerConfigFileName:='mytest.scf';
   ServerConfigPassword:='test123456';
   Active:=True;
   end;

Information You can also use the TDBISAMEngine OnStartup event to configure the TDBISAMEngine component before it is started.

Default Login Information
The default user ID and password for the database server are:

User ID: Admin (case-insensitive)
Password: DBAdmin (case-sensitive)

This user has full administrator privileges and is widely known, so it is recommended that you delete it as a user once you have established another administrative user on the database server.

Database Servers Provided with DBISAM
DBISAM comes with a default GUI database server project for Delphi and Kylix called dbsrvr.dpr and a default command-line database server project for Delphi and Kylix called dbcmd.dpr. You can examine the source code of these projects to see how you would go about setting up a TDBISAMEngine component as a database server in a project. Both of these projects are also provided in compiled form with DBISAM.

The dbsrvr GUI database server can be run as a normal application in Windows or Linux or as a Windows service. If running the database server as a normal application there is nothing else to do besides start up the database server from the directory in which DBISAM was installed. You can find the GUI database server in the \server\dbsrvr sub-directory under the main directory for the Delphi, C++Builder, or Kylix version of DBISAM that you installed. If you wish to run the database server as a Windows service you must install it as a service by running the database server with the /install command-line switch set. For example, to install the database server as a service using the Run command window under Windows (2000 or higher) you would specify the following command:

dbsrvr.exe /install

To uninstall the database server as a Windows service you must run the database server with the /uninstall command-line switch set. For example, to uninstall the database server as a service using the Run command window under Windows (2000 or higher) you would specify the following command:

dbsrvr.exe /uninstall

If you wish to install the database server so that it does not interact with the desktop at all, which is required in instances where the current user will be logged out of the system, then you should use the /nointeract flag along with the /install command-line switch:

dbsrvr.exe /install /nointeract

This will install the service as a non-interactive service and the database server will not display a user interface when it is started.

To start the Linux version of the dbsrvr GUI database server, you must run the startdbsrvr script provided in the same directory as the server. Also, please make sure that both the startdbsrvr script and the dbsrvr application have the proper execute (X) permissions set. For example, to run the database server from a terminal window prompt in Linux would specify the following command:

startdbsrvr

The dbcmd command-line database server can only be run as a normal application in Windows or Linux. As with the dbsrvr GUI database server, you must use the startdbcmd script to start the server under Linux. You can find the command-line database server in the \server\dbcmd sub-directory under the main directory for the Delphi, C++Builder, or Kylix version of DBISAM that you installed.

Both the GUI and command-line database servers will accept commmand-line switches that affect their behavior. The following switches are supported when starting up either database server:

SwitchDescription
/snServer name parameter
The /sn switch specifies the user-defined server name that will be used to identify the server to remote sessions. You must enclose the server name in double quotes if there are spaces in the server name. The server name is informational only.
/sdServer description parameter

The /sd switch specifies the user-defined server description that will be displayed in the caption of the server's user interface. You must enclose the server description in double quotes if there are spaces in the server description. The server description is informational only.
/saServer address parameter

The /sa switch specifies the main server IP address that the server will bind to for accepting inbound data connections. The IP address must be specified directly after the /sp switch using dot notation (i.e. 192.168.0.1). The default IP address that the server will bind to if this switch is not specified is all IP addresses available on the machine. Using this option will cause the server to only listen on the specified address. This means that it will no longer listen on the local loopback 127.0.0.1 address.
/spServer port parameter

The /sp switch specifies the main server port that the server will bind to for accepting inbound data connections. The port number must be specified directly after the /sp switch. The default main port that the server will bind to if this switch is not specified is 12005.
/stServer thread cache size parameter

The /st switch specifies the main server thread cache size. The thread cache size controls how many threads the server will cache in order to speed up connect/disconnect times. The thread cache size must be specified directly after the /st switch. The default main thread cache size that the server will use if this switch is not specified is 10.
/aaAdministration address parameter

The /aa switch specifies the administration server IP address that the server will bind to for accepting administrative connections. The IP address must be specified directly after the /aa switch using dot notation (i.e. 192.168.0.1). The default administration IP address that the server will bind to if this switch is not specified is all IP addresses available on the machine. Using this option will cause the server to only listen on the specified address. This means that it will no longer listen on the local loopback 127.0.0.1 address.
/apAdministration port parameter

The /ap switch specifies the administration server port that the server will bind to for accepting administrative connections. The port number must be specified directly after the /ap switch. The default administration port that the server will bind to if this switch is not specified is 12006.
/atAdministration thread cache size parameter

The /at switch specifies the administration server thread cache size. The thread cache size controls how many threads the server will cache in order to speed up connect/disconnect times. The thread cache size must be specified directly after the /at switch. The default administration thread cache size that the server will use if this switch is not specified is 1.
/cfConfiguration file name parameter

The /cf switch specifies the server configuration file name. The configuration file is where the server stores all configuration information including databases, users, permissions, etc. You must enclose the configuration file name in double quotes if there are spaces in the configuration file name. Do not specify a file extension for the file since the server always uses the ".scf" extension for all configuration files. The default configuration file name that the server will use if this switch is not specified is "dbsrvr".
/cpConfiguration file password parameter

The /cp switch specifies the server configuration file password. The configuration file password is used to encrypt the contents of the configuration file. You must enclose the configuration file password in double quotes if there are spaces in the configuration file password. The default configuration file password that the server will use if this switch is not specified is "elevatesoft".

Information Do not lose this password. If you do the server will not be able to read the configuration information and there is no way for Elevate Software to retrieve the configuration information.
/enEncrypted connections only parameter

The /en switch specifies that the main server will require encrypted connections only. By default the administration server always requires encypted connections, but normally encrypted connections are not required for the main server.
/epEncrypted connnection password parameter

The /ep switch specifies the password to use for encrypting all data between any remote sessions and the main and administration server. This switch can be specified without the above /en switch to change the password for encrypted connections to the administration server only. If combined with the above switch, this switch will change the password for encrypted connections to both the main server and the administration server. You must enclose the encryption password in double quotes if there are spaces in the encryption password. The default encryption password that the server will use if this switch is not specified is "elevatesoft".

Information If this password is not set to the same value that is used by the remote sessions connecting to either the main or administration server, the remote sessions will receive errors and not be able to connect to the server at all.
/niNo interface parameter

The /ni switch specifies that the server should not display any user interface at all. When this switch is used you must use the task manager to stop the server process. This switch only applies to running the server as an application and does not apply to running the server as a service, which instead uses the /nointeract installation switch to determine if it should interact with the Windows desktop in any fashion. The server defaults to having an interface when it is run as an application.
/alAppend to log parameter

The /al switch specifies that the server should append to any existing server log file when the server process is started. The default behavior is to overwrite the log every time the server process is started.
/lfLarge file support parameter

The /lf switch specifies that the server should enable support for large files when the server process is started. The default is to not enable large file support. See the Enabling Large File Support topic for more information.

The only difference between starting the GUI database server as a normal application and starting the GUI database server as a Windows service is in the way the switches are specified. When the GUI database server is started as a normal application, you may specify the switches directly on the command-line that you are using to start the database server. For example the following command will start the database server with it using port 13000 for the main port and 13001 for the administration port:

dbsrvr.exe /sp13000 /ap13001

When the GUI database server is started as a Windows service, you may specify the switches via the Startup Parameters in the Services dialog of the Control Panel, or directly on the command-line that you are using to start the database server with the net start command. For example the following command will start the database server as a service with it using port 13000 for the main port and 13001 for the administration port:

net start dbsrvr /sp13000 /ap13001

Information In order to start the GUI database server as a Windows service the database server must have already been installed as a service using the /install command-line switch.

In addition to using command-line parameters, you may also use an .ini file to specify the parameters for the database server. This is required for starting the GUI database server as a Windows service automatically when the operating system boots up since there is no other way to provide parameters in such a scenario. A sample .ini file called sample.ini is shipped with DBISAM and you will find it in the \server\dbsrvr or \server\dbcmd directories where the database servers are located. The following is the contents of the file:

; Sample DBISAM Database Server Parameters INI File

[Server Parameters]
; Default server name is the EXE name
Server Name=Test Server
; Default server description is DBISAM Database Server
; plus the Server Name
Server Description=Test Server Description
; Default server IP address is all addresses on the machine
Server Address=127.0.0.1
; Default server port is 12005
Server Port=10001
; Default server thread cache size is 10
Server Thread Cache Size=20
; Default admin IP address is all addresses on the machine
Administration Address=127.0.0.1
; Default admin port is 12006
Administration Port=10002
; Default admin thread cache size is 1
Administration Thread Cache Size=4
; Default configuration file name is dbsrvr
Configuration File=Test
; Default configuration file password is elevatesoft
Configuration Password=cannotguessme
; 0=main server allows unencrypted connections (default)
; 1=main server allows only encrypted
Encrypted Only=0
; Default encryption password is elevatesoft
Encryption Password=cannotguessme
; 0=show user interface (default) 1=hide user interface
No User Interface=0
; 0=overwrite log file (default) 1=append to log file
Append To Log=0
; 0=no large file support (default) 1=enable large file support
Large File Support=0

Information The .ini file that contains the database server parameters must have the same root file name as the database server itself. For example, if you wanted to use the sample.ini file with the GUI database server (dbsrvr), you would need to rename it or copy it to dbsrvr.ini in order for the server to find it and use its contents. Likewise, if you wanted to use it with the command-line database server (dbcmd), you would need to rename it or copy it to dbcmd.ini.

Once you have the GUI database server started and the database server interface is available, you may view any context-sensitive help by simply right-clicking on any portion of the interface to bring forward a "What's This" button that you can click on to view the help. The command-line database server only displays minimal textual information once started, and you should use the remote administration facilities provided with DBISAM for getting more complete information from the database server.

Multiple instances of the database server can be started on the same physical machine. The root name of the database server (default dbsrvr for the GUI database server and dbcmd for the command-line database server) is used to determine the name of the log file and parameters .INI file to use when the database server is started. Also, when running as a Windows service the GUI database server relies on the root name of the database server to determine the service name. What this means is that to have multiple instances of the database server running on the same machine you must put them in separate physical directories if running them as a normal application, or copy the database server to different files with a different root name if running them as a service. For example, if you wanted to run two instances of the database server as services, you would copy the dbsrvr.exe to two separate files called dbsrvr1.exe and dbsrvr2.exe. Then you would install and run them as follows:

First database server

dbsrvr1.exe /install

net start dbsrvr1

Second database server

dbsrvr2.exe /install

net start dbsrvr2
Image