Reference Manual
CHAPTER 2. The Database Server
Start a personal database server or network database server.
{ dbeng6 | dbsrv6 }
[ server-switches ] [ database-file [ database-switches ] ]*
dbeng6w [ server-switches ] [ database-file [ database-switches ] ]*
load dbsrv6 [ server-switches ] [ database-file [ database-switches ] ]*
Switch |
Description |
---|---|
@filename |
Read in switches from a configuration file. See @filename |
@environment-variable |
Read in switches from an environment variable. See @environment-variable. |
-? |
Display usage information. See -? |
-b |
Run in bulk operations mode. See -b. |
-c |
Set maximum cache size. See -c. |
-ct |
Enable character-set translation. See -ct. |
-d |
Disable asynchronous I/O [OS/2, Windows NT, NetWare]. See -d. |
-df |
Force direct I/O [Windows 3.x]. See -df. |
-di |
Use direct I/O if possible [Windows 3.x]. See -di. |
-e |
Enable packet encryption [network server]. See -e. |
-ga |
Automatically unload the database after the last connection closed. In addition, shut down after the last database is closed . See -ga. |
-gb level |
Set database process priority class to level [Windows NT, OS/2]. See -gb. |
-gc num |
Set checkpoint timeout period to num minutes. See -gc. |
-gd level |
Set database starting permission. See -gd. |
-ge size |
Set the stack size for threads that run external functions [not UNIX or Windows 3.X]. See -ge. |
-gf |
Disable firing of triggers. See -gf. |
-gk level |
Set the permission that is required to stop the server. See -gk. |
-gm num |
Limit the maximum number of connections. See -gm. |
-gn num |
Set the number of threads. See -gn. |
-gp size |
Set the maximum page size to size bytes.. See -gp. |
-gr num |
Set the maximum recovery time to num minutes. See -gr. |
-gss size |
Set the thread stack size to size bytes. See -gss. |
-gt num |
Set the number of CPUs for request processing. See -gt. |
-gu level |
Set the permission level for utility commands: utility_db, all, none, dba. See -gu. |
-gw |
Set the interval (in milliseconds) for background processing. See -gw. |
-gx |
Modify operating system threading [Windows 95 and Windows NT]. See -gx. |
-m |
Truncate the transaction log after each checkpoint, for all databases. See -m. |
-n name |
Use name as the name of the database server. See -n. |
-o filename |
Output messages to the specified file. See -o. |
-p packet-size |
Set the maximum network packet size [network server]. See -p. |
-q |
Quiet mode—suppress output. See -q. |
-r |
Disable multiple-row fetching. See -r. |
-s |
Set the syslog facility ID (none, user, daemon, local0,..., local7) [UNIX]. See -s. |
-sc |
Disable the shared memory port, and enable Named Pipes. [NT personal database server ]. See -sc. |
-ta seconds |
Scan time for terminated applications—default 30 seconds[Windows 3.X, Windows 95, Windows NT]. See -ta. |
-ti minutes |
Client idle time before shutdown—default 240 minutes [network server]. See -ti. |
-tl seconds |
Default liveness timeout for clients in seconds—default 120 seconds [network server]. See -tl. |
-tq time |
Set quitting time [network server]. See -tq time. |
-u |
Use buffered disk I/O [Windows 95 and Windows NT]. See -u. |
-ud |
Run as a daemon [UNIX]. See -ud. |
-ut minutes |
Touch temporary files every min minutes [UNIX]. See -ut. |
-v |
Display database server version and stop.. See -v. |
-x list |
Comma-separated list of communication links to try. See -x. |
-y |
Run as a Windows 95 service [Windows 95]. See -y. |
-z |
Provide diagnostic information on communication links [network server]. See -z. |
Switch |
Description |
---|---|
-as filename |
Apply the named transaction log file. See -a. |
-f |
Force the database to start without a transaction log. See -f. |
Switch |
Description |
---|---|
-m |
Truncate (delete) the transaction log after each checkpoint. See -m. |
-n name |
Name the database. See -n. |
Network communications parameters
The dbeng6 command starts a personal database server. The dbsrv6 command starts a network database server.
The database-file specifies the database filename. If database-file is specified without a file extension, Adaptive Server Anywhere looks first for database-file with extension .wrt (a write file) followed by database-file with extension .db.
Server differences In addition, there are other minor differences, such as the default permission level that is required to start new databases, or the permissions required to execute the CHECKPOINT statement. |
Both personal and network database servers are supplied for each supported operating system, with the following exceptions:
Novell NetWare Only the network server is supplied.
Windows 3.x Only the personal server is supplied.
Windows CE Only the network server is supplied. The support for TCP/IP in the network server enables you carry out tasks from your desktop machine, including database management with Sybase Central.
In NetWare, the database file and the transaction log file must be on a NetWare volume, and the paths must be fully specified. NetWare allows you to have volumes that span two or more hard disks.
Adaptive Server Anywhere uses the Direct File System to maintain database files. The Direct File System is built into NetWare 4.0 and 4.1, but not in NetWare 3.11 or 3.12. Novell has provided a loadable module that contains the DIRECTFS functions for version 3.11 and 3.12. directfs.nlm comes with Adaptive Server Anywhere, and is installed during the installation if it is not found on your NetWare server. The DIRECTFS module is automatically loaded when you load dbsrv6.
Novell has also provided an updated clib.nlm for NetWare 3.11. This update contains bug fixes that are necessary for Adaptive Server Anywhere to work properly. It is installed during the installation of Adaptive Server Anywhere if it is not already on your NetWare server.
These switches apply to the server as a whole, not just to an individual database.
Read in command-line switches from the supplied file.
[ dbsrv6 | dbeng6 ] @filename ...
All operating systems and servers.
The command-line file may contain line breaks, and may contain any set of command line switches. For example, the following command file holds a set of command line switches for a server named myserver that starts with a cache size of 4Mb and loads the sample database:
-c 4096 -n myserver c:\asa6\asademo.db
If this configuration file is saved as c:\config.txt, it can be used in a command line as follows:
dbsrv6 @c:\config.txt
Read in command-line switches from the supplied environment variable.
[ dbsrv6 | dbeng6 ] @env-var ...
All operating systems and servers.
The environment variable may contain any set of command line switches. For example, the first statement sets an environment variable that holds command line switches for a database server that starts with a cache size of 4Mb and loads the sample database. The second statement starts the database server:
set envvar=-c 4096 c:\asa6\asademo.db dbsrv6 @envvar
Environment variable given priority |
Display usage information.
[ dbsrv6 | dbeng6 ] -?
All operating systems and servers.
Display a short description of each command-line option. The database does not carry out any other task.
Use bulk operation mode.
[ dbsrv6 | dbeng6 ] -b ...
All operating systems and servers.
This is useful for using the Interactive SQL INPUT command to load large quantities of data into a database.
The -b option should not be used if you are using LOAD TABLE to bulk load data.
When you use this option, the database server allows only one connection by one application. It does not keep a rollback log or a transaction log, and the multi-user locking mechanism is turned off.
When you first start the database server after loading data with the -b switch, you should use a new log file.
Bulk operation mode does not disable the firing of triggers.
Set the memory reserved for caching database pages and other server information..
[ dbsrv6 | dbeng6 ] -c [integer | integerK | integerM ] ...
All operating systems and servers.
The amount of memory available for use as a database server cache is one of the key factors controlling performance. You can set the amount of cache memory using the -c command-line option
By default, the database server uses 2 megabytes of memory for caching. The more cache memory that can be given the server, the better will be its performance.
If M or K is not supplied, any integer less than 10000 is assumed to be in kilobytes, and any integer 10000 or greater is assumed to be in bytes.
NetWare database server NetWare memory requirements increase with every new directory and file on the file server. To track memory usage on the NetWare server, load monitor.nlm (if it is not already loaded) and select "Resource Utilization". Extra memory for your NetWare server computer could improve database performance and/or file server performance dramatically. |
Enable character set translation.
[ dbsrv6 | dbeng6 ] -ct ...
All operating systems and servers.
Character set translation converting strings between character sets that represent the same characters, but at different values. This is useful when the client machine and the database use different character sets.
For more information, see Using character set translation.
Disable asynchronous I/O.
[ dbsrv6 | dbeng6 ] -d ...
Windows NT, OS/2, NetWare
Use synchronous I/O rather than asynchronous I/O. Asynchronous I/O is generally the preferred option.
Since Windows 3.x and Windows 95 systems use synchronous I/O by default, this option applies only to Windows NT, OS/2 and NetWare systems, which use asynchronous I/O by default.
Use direct, asynchronous I/O.
dbeng6w -df ...
Windows 3.x
The default I/O method for Windows 3.x is to use normal DOS input and output instead of direct input and output.
This option forces the use of direct, or asynchronous, I/O, rather than normal DOS calls.
Asynchronous I/O is not supported in Windows 95 environments.
Use direct I/O if possible.
dbeng6w -di ...
Windows 3.x
The default I/O method for Windows 3.x is to use normal DOS input and output instead of direct input and output.
When the -di option is supplied, the database server tests to see if it is possible for direct I/O to be used before it is implemented.
With this switch, the server will not use direct I/O under Windows for Workgroups 3.11 or for some highly fragmented database files.
Encrypt all packets transmitted to and from all clients.
[ dbsrv6 | dbeng6 ] -e...
All operating systems and servers.
By default, communication packets are not encrypted, thus posing a potential security risk. If you are concerned about the security of network packets, use the -e switch. Encryption does marginally affect performance.
Unload database after last connection dropped.
[ dbsrv6 | dbeng6 ] -ga ...
All operating systems except NetWare.
The meaning of this switch depends on whether you are running a personal server or a network server.
Network server Specifying this switch on the network server causes each database to be unloaded after the last connection to it is dropped. The database server itself does not shut down.
Personal server In addition to unloading each database after the last connection is dropped, the personal server shuts down when the last database is stopped.
Set the database process priority class.
[ dbsrv6 | dbeng6 ] -gb [ idle | normal | high | maximum ] ...
OS/2 and Windows NT
Set the database process priority class. The value idle is provided for completeness, and maximum may interfere with the running of your computer. Normal and high are the commonly used settings.
Set maximum desired interval between checkpoints.
[ dbsrv6 | dbeng6 ] -gc integer...
All operating systems and servers.
Set the maximum desired length of time in minutes that the database server runs without doing a checkpoint.
The default value is 60 minutes.
When a database server is running with multiple databases, the checkpoint time specified by the first database started is used unless overridden by this switch. If a value of 0 is entered, the default value of 60 minutes is used.
For information on database checkpoint times, see CHECKPOINT_TIME option.
Set permissions required to start a database.
[ dbsrv6 | dbeng6 ] -gd [ dba | all | none ] ...
All operating systems and servers.
This is the permission required for a user to cause a new database file to be loaded by the server. The level can be one of the following:
DBA Only users with DBA authority can start new databases.
ALL All users can start new databases.
NONE Starting new databases is not allowed.
The default setting is ALL for the personal database server and DBA for the network database server.
Set stack size for external functions.
[ dbsrv6 | dbeng6 ] -ge integer ...
OS/2, Windows 95, Windows NT, NetWare
Sets the stack size for threads running external functions, in bytes. The default is 16384 (16K).
Disable firing of triggers by the server.
[ dbsrv6 | dbeng6 ] -gf...
All operating systems and servers.
Set the permission that's required to stop the database server using dbstop.
[ dbsrv6 | dbeng6 ] -gk [ dba | all | none ] ...
All operating systems and servers.
DBA Only users with DBA authority can use dbstop to stop the server (the default).
ALL All users can use dbstop to stop the server.
NONE The server cannot be stopped using dbstop.
Limit the number of concurrent connections to the server.
[ dbsrv6 | dbeng6 ] -gm integer...
All operating systems and servers.
If this number is greater than the number that is allowed under licensing and memory constraints, it has no effect.
Set the number of execution threads.
[ dbsrv6 | dbeng6 ] -gn integer...
All operating systems and servers.
Set the number of execution threads that will be used in the database server while running with multiple users.
Set the maximum allowed database page size.
[ dbsrv6 | dbeng6 ] -gp [ 1024| 2048 | 4096 ] ...
All operating systems and servers.
Database files with a page size larger than the page size of the server cannot be loaded. This switch explicitly sets the page size of the server, in bytes.
If you do not use this switch, then the page size of the first database on the command line is used.
If you do not use this switch and start a server with no databases loaded, the default value is 1024.
Set the maximum length of time (in minutes) for recovery from system failure.
[ dbsrv6 | dbeng6 ] -gm integer...
All operating systems and servers.
When a database server is running with multiple databases, the recovery time that is specified by the first database started is used unless overridden by this switch.
For more information, see RECOVERY_TIME option.
Set the stack size per internal execution thread in the server.
[ dbsrv6 | dbeng6 ] -gss [ integer | integerK | integerM ]...
All operating systems and servers.
The number of execution threads is controlled by the -gn switch, and has a default value of twenty. The default stack size is 16 kb. You may want to use the -gss option to lower the memory usage of the database server in environments with limited memory.
Set the number of CPUs to use for request processing.
[ dbsrv6 | dbeng6 ] -gt integer ...
All operating systems and servers except NetWare and Windows 3.x.
By default, the database server uses all CPUs available on the machine.
Set permission levels for utility commands.
[ dbsrv6 | dbeng6 ] -gu [ all | none | dba | utility_db ] ...
All operating systems and servers.
Sets permission levels for utility commands such as CREATE DATABASE and DROP DATABASE. The level can be set to one of the following: utility_db, all, none, dba.
The utility_db level restricts the use of these commands to only those users who can connect to the utility database. The all, none, and dba levels permit all users , no users, or users with dba authority to execute utility commands.
Set the interval for background processing.
[ dbsrv6 | dbeng6 ] -gw milliseconds...
All operating systems and servers.
Sets the interval for background processing, in milliseconds. At each interval, the server carries out one I/O operation. The default setting is 500 (half a second).
Set the number of execution threads.
[ dbsrv6 | dbeng6 ] -gx integer ...
Windows 95, Windows NT.
By default, this is set to one more than the number of CPUs on the machine.
You may want to use a larger number of threads if you wish to use remote data access and use a large number of tables.
On UNIX, each task is executed in its own thread, so that the number of tasks (-gn) also determines the number of threads.
Delete the transaction log when a checkpoint is done.
[ dbsrv6 | dbeng6 ] -m ...
All operating systems and servers.
This option deletes the transaction log when a checkpoint is done, either at shutdown or as a result of a checkpoint scheduled by the server.
Caution
When this option is selected, there is no protection against media failure on the device that contains the database files.
This provides a way to automatically limit the growth of the transaction log. Checkpoint frequency is still controlled by the CHECKPOINT_TIME and RECOVERY_TIME options (which you can also set on the command line).
This option is useful where high volume transactions that require fast response times are being processed, and the contents of the transaction log are not being relied upon for recovery or replication.
To avoid database file fragmentation, it is recommended that where this option is used, the transaction log be placed on a separate device or partition from the database itself.
Replicated databases |
Set the name of the database server.
[ dbsrv6 | dbeng6 ] -n string ...
All operating systems and servers.
By default, the database server receives the name of the database file with the path and extension removed. For example, if the server is started on the file c:\sybase\asa6\asademo.db and no -n switch is specified, the name of the server is asademo.
If the string contains spaces, it must be enclosed in double quotes.
The server name specifies the name to be used on client application connection strings or profiles.
The server name can be used on the connect statement. In all environments, there is a default database server that will be used if no server name is specified, provided at least one database server is running on the computer.
There are two n switches For more information, see -n. |
Print all server window output to a file.
[ dbsrv6 | dbeng6 ] -o filename ...
All operating systems and servers.
Print all server message window output to a file.
Set the maximum size of communication packets.
[ dbsrv6 | dbeng6 ] -p integer...
All operating systems and servers.
The default is 512 bytes. The minimum value is 280 bytes and the maximum is 16000.
Do not display the server screen or its output.
[ dbsrv6 | dbeng6 ] -q...
All operating systems and servers, except NetWare.
Fetch only one row per client request.
[ dbsrv6 | dbeng6 ] -r ...
All operating systems and servers.
By default, when the database server gets a simple fetch request, it fills one network packet with several rows so that subsequent sequential fetches do not require network traffic. This is often referred to as blocking of fetches. This switch disables multiple-row fetching for all clients.
For more information, see the PREFETCH option.
Set the user ID for syslog messages.
[ dbsrv6 | dbeng6 ] -s login-id...
UNIX
Sets the system user ID used in messages to the syslog facility. The default is user.
Disable the shared memory communications protocol and use Named Pipes.
[ dbsrv6 | dbeng6 ] -sc...
Windows NT personal server.
This option disables the shared memory communications protocol that is used for same-machine communications, and starts the NamedPipes protocol.
This option was implemented as part of an initiative to obtain security certification. It is unlikely to be of general use.
Set the polling period for disconnecting clients.
[ dbsrv6 | dbeng6 ] -ta seconds...
Windows 3.x, Windows NT, and Windows 95.
The database server periodically scans the connection list and disconnects any connections associated with terminated applications connected directly to the server. The scan period can be controlled using the -ta switch, and has a default value of 30 seconds.
Set the value to zero to prevent scanning.
Disconnect inactive connections.
[ dbsrv6 | dbeng6 ] -n minutes ...
All operating systems and servers.
Disconnect connections that have not submitted a request for minutes. The default is 240 (4 hours). A client machine in the middle of a database transaction will hold locks until the transaction is ended or the connection is terminated. The -ti option is provided to disconnect inactive connections, freeing their locks.
Set the period at which to send liveness packets.
[ dbsrv6 | dbeng6 ] -tl seconds ...
Network database servers using TCP/IP or IPX.
A liveness packet is sent periodically across a client/server TCP/IP or IPX communications protocol to confirm that a connection is intact. If the server runs for a liveness timeout period (default 2 minutes) without detecting a liveness packet, the communication is severed. The server drops any connections associated with that client. UNIX clients do not do liveness checking. This switch applies only to the network server.
The -tl switch on the server sets the liveness timeout for all clients that do not specify a liveness period.
Liveness packets are sent at an interval of the (liveness timeout)/4.
Shut down the server at a specified time.
[ dbsrv6 | dbeng6 ] -tq [ datetime | time ]...
All operating systems and servers.
This is useful for setting up automatic off-line backup procedures (see Backup and Data Recovery). The format for the time is in hh:mm (24 hour clock), and can be preceded by an optional date. If a date is specified, the date and time must be enclosed in double quotes and be in the format YYYY/MM/DD HH:MM.
Open files using the operating system disk cache.
[ dbsrv6 | dbeng6 ] -u ...
Windows NT and Windows 95.
Files are opened using the operating system disk cache in addition to the database cache.
While the operating system disk cache may improve performance in some cases, in general better performance is obtained without this switch, using the database cache only.
If the server is running on a dedicated machine, you should not use the -u option, as the database cache itself is generally more efficient. You may want to use the -u option if the server is running on a machine with several other applications (so that a large database cache may interfere with other applications) and yet IO-intensive tasks are run intermittently on the server (so that a large cache will improve performance).
Run as a daemon.
[ dbsrv6 | dbeng6 ] -ud ...
UNIX
Using this option lets you run the server so that it continues running after the current operating system session ends.
Touch temporary files.
[ dbsrv6 | dbeng6 ] -ut minutes ...
UNIX
This switch causes the server to touch temporary files at specified intervals.
Display the software version.
[ dbsrv6 | dbeng6 ] -v
All operating systems and servers.
Supplies the database server version in a message box, and then stops.
Specify communications links.
[ dbsrv6 | dbeng6 ] -x { all
| none
| { dde | ipx | namedpipes | netbios | tcpip ] parmlist,... ]
} ...
parmlist:
{ keyword=value;...}
All operating systems and servers.
For example,
-x tcpip,ipx
allows only TCP/IP and IPX communications.
A shared-memory protocol is provided for same-machine communications. It is always made available for both network server and personal server.
The default set of communications links is to try all settings that are supported by the database server that you are running on your operating system. The Windows CE database server is an exception; the TCP/IP network link is not started unless it is explicitly requested.
The list is a comma-separated list of settings taken from the following list:
ALL Start all communications links that are supported on this platform by the server that you are starting. This is the default.
DDE Supported by Windows 95, for same-machine communication from Windows 3.x applications.
IPX Supported by NetWare, Windows NT, and Windows 95 network servers.
NamedPipes Supported on Windows NT and OS/2, for same-machine communication from Windows 3.x applications.
NetBIOS Supported by Windows NT, Windows 95, OS/2 network database servers.
NONE Do not start any communications links except for the shared memory link.
TCPIP Supported by the network server on all operating systems. This communications link is also supported by the personal database server for same-machine communications.
For some protocols, additional parameters may be provided, in the format
-x tcpip(PARM1=value1;PARM2=value2;...)
For UNIX, quotation marks are required if more than one parameter is supplied:
-x "tcpip(PARM1=value1;PARM2=value2;...)"
For a description of available parameters, see Network communications parameters.
Run as a Windows 95 service.
[ dbsrv6 | dbeng6 ] -y ...
Windows 95
If the server registered as a Windows 95 service, it continues to operate whether users log on or off, and shutdown commands are ignored.
Provide diagnostic information on communications links on startup.
[ dbsrv6 | dbeng6 ] -z ...
All operating systems and servers.
This should only be used when tracking problems. The information is displayed in the database server window.
These switches are for use in recovery situations only.
Apply the named transaction log.
[ dbsrv6 | dbeng6 ] -a log-filename...
All operating systems and servers.
This is used to recover from media failure on the database file. When this option is specified, the database server applies the log and then terminate—it will not continue to run.
For information on recovery, see Backup and Data Recovery.
Force the database server to start after the transaction log has been lost.
[ dbsrv6 | dbeng6 ] -f ...
All operating systems and servers.
If there is no transaction log, the database server carries out a checkpoint recovery of the database and then terminates—it does not continue to run. You can then restart the database server without the -f option for normal operation.
If there is a transaction log in the same directory as the database, the database server carries out a checkpoint recovery, and a recovery using the transaction log, and then terminates—it does not continue to run. You can then restart the database server without the -f option for normal operation.
For more information see Backup and Data Recovery.
These switches are entered after the database name, and apply only to that database.
Truncate the transaction log when a checkpoint is done.
[ dbsrv6 | dbeng6 ] [ server-switches ]. database-file -m ..
All operating systems and servers.
Truncate (delete) the transaction log when a checkpoint is done, either at shutdown or as a result of a checkpoint scheduled by the server. This provides a way to automatically limit the growth of the transaction log. Checkpoint frequency is still controlled by the CHECKPOINT_TIME and RECOVERY_TIME options (which you can also define on the command line).
The -m option is useful where high volume transactions requiring fast response times are being processed, and the contents of the transaction log are not being relied upon for recovery or replication. When this option is selected, there is no protection against media failure on the device that contains the database files.
To avoid database file fragmentation, it is recommended that where this option is used, the transaction log be placed on a separate device or partition from the database itself.
This switch is the same as the -m server switch, but applies only to the current database or the database identified by the database-file command-line variable.
Replicated databases |
Set the name of the database.
[ dbsrv6 | dbeng6 ] [ server-switches ]. database-file -n string ..
All operating systems and servers.
Both database servers and databases can be named. Since a database server can load several databases, the database name is used to distinguish the different databases.
By default, the database receives the name of the database file with the path and extension removed. For example, if the database is started on.c:\asa6\asademo.db and no -n switch is specified, the name of the database is asademo.