User's Guide
PART 1. Working with Databases
CHAPTER 1. Running the Database Server
This section describes some of the most common command-line switches, and points out when you may wish to use them.
It covers the following areas:
Using configuration files
Naming the server and the databases
Performance
Permissions
Maximum page size
Special modes
Network communications (network server only)
These command-line switches may be used in the StartLine connection parameter, or typed at a command prompt.
If you use an extensive set of command-line options, you can store them in a configuration file, and invoke that file on a server command line. The configuration file can contain switches on several lines. For example, the following configuration file starts the sample database, with a cache of 10 Mb, and starts the personal server named Elora.
-n Elora -c 10M path\asademo.db
where path is the name of your Adaptive Server Anywhere installation directory.
If you name the file sample.cfg, you could use these command-line options as follows:
dbeng6 @sample.cfg
You can use the -n command-line option as a database switch (to name the database) or as a server switch (to name the server).
The server and database names are among the connection parameters that client applications may use when connecting to a database. The server name appears on the desktop icon and on the title bar of the server window.
If no database name is provided, the default database name is the root of the database file name (the file name without the .db extension). For example, in the following command line the first database is named asademo, and the second sample.
dbeng6 asademo.db sample.db
If no server name is provided, the default server name is the name of the first database started. For example, with the above command the server is named asademo.
You can name databases by supplying a -n switch following the database file. For example, the following command line starts a sample database and names it:
dbeng6 asademo.db -n MyDB
You can name the server by supplying a -n switch before the first database file. For example, the following command line starts a server named Cambridge on the asademo database:
dbeng6 -n Cambridge asademo.db
If a server name is used, you can start a database server with no database loaded. The following command starts a server named Galt with no database loaded:
dbeng6 -n Galt
For information about loading databases onto a running server, see Loading and unloading databases.
Server names and database names are case insensitive.
Several command-line options can have a major impact on database server performance. The following are some of these:
Cache size The -c switch controls the amount of memory that Adaptive Server Anywhere uses as a cache. This can be a major factor in affecting performance.
Generally speaking, the more memory made available to the database server, the faster it performs. The cache holds information that may be required more than once. Accessing information in cache is many times faster than accessing it from disk. The default cache size is 2 Mb, or 8 Mb if a Java-enabled database is started on the command line. On machines dedicated to running Adaptive Server Anywhere, you may wish to increase this value to match the available physical memory on your machine.
For a detailed description of performance tuning, see Monitoring and Improving Performance.
Number of processors If you are running on a multi-processor machine, you can set the number of processors with the -gt option.
By default, the database server uses all available processors.
Other performance-related switches There are several switches available for tuning network performance, including -gb (database process priority), and -u (buffered disk I/O).
For a full list of startup options, see The database server.
Some command-line options that control the permissions required to carry out certain global operations. These include the following:
Loading and unloading databases By default, any user can load an extra database onto a running server. The -gd option allows you to limit the users who can do this to users with a certain level of permission in the database to which they are already connected. The permissible values are dba, all, or none.
Creating and deleting databases By default, any user can use the CREATE DATABASE statement to create a database file. The -gu option allows you to limit the users who can do this to users with a certain level of permission in the database to which they are connected. The permissible values are dba, all, none, or utility_db.
For information about this option, The database server.
Stopping the server The dbstop utility is a command-line utility that stops a database server. It is useful in batch files, or in other cases where interactive stopping of the server (by clicking Shutdown on the server window) is impractical. By default, any user can run dbstop to shut down a server. If you wish to limit this ability to users with a certain level of permission in the database, you can do so with the -gk option. The permissible values are dba, all, or none.
The database server cache is arranged in pages—fixed-size areas of memory. As the server uses a single cache for its lifetime (until it is shut down), all pages must have the same size.
A database file is also arranged in pages, of size 1024, 2048, or 4096 bytes. Every database page must fit into a cache page. By default, the server page size is set to be the same as the largest page size of the databases on the command line. Once the server is started, you cannot load a database that has a larger page size than the server.
If you wish to allow databases of larger page size to be loaded after startup, you can force the server to start with a specified page size using the -gp option, which can take the values 1024, 2048, or 4096.
Adaptive Server Anywhere can be run in special modes for particular purposes.
Bulk load This is useful when loading large quantities of data into a database if it is being done through the Interactive SQL INPUT command. The -b option should not be used if you are using LOAD TABLE to bulk load data.
For more information, see The database server, and Importing and Exporting Data.
Starting without a transaction log The -f database option is used for recovery(either to force the database server to start after the transaction log has been lost, or to force the database server to start using a transaction log it would otherwise not find. Note that -f is a database option, not a server option.
Once the recovery is complete, you should stop your server and restart without the -f option.
For more information, see The database server.
Any communications between a client application and a database server require a communications protocol. Adaptive Server Anywhere supports a set of communications protocols for communications across networks and for same-machine communications.
By default, the database server starts up all available protocols. You can limit the protocols available to a database server by using the -x command-line switch. At the client side, many of the same options can be controlled using the CommLinks connection parameter.
The personal database server (dbeng6.exe) supports the following protocols:
Shared memory This is used for same-machine communications, and is always loaded.
TCP/IP This is provided for same-machine communications only, from TDS clients. Open Client or the jConnect JDBC driver. You must run TCP/IP if you wish to connect from Open Client or jConnect.
For more information on TDS clients, see Adaptive Server Anywhere as an Open Server.
Named Pipes Provided on Windows NT and OS/2 only. Named Pipes is provided for same machine communications to from Windows 3.x client applications using ODBC or Embedded SQL.
DDE Provided on Windows 95 only. DDE is used to communicate with a Windows 3.x client application running on the same computer.
The network database server (dbsrv6.exe) supports the following protocols:
Shared memory This is used for same-machine communications, and is always loaded.
TCP/IP This is supported on all platforms.
IPX This is supported on all platforms except for UNIX.
NetBIOS This is supported on all platforms except for NetWare and UNIX.
Named Pipes On Windows NT and OS/2 only. Named Pipes is provided for same machine communications to from Windows 3.x client applications using ODBC or Embedded SQL.
DDE On Windows 95 only. DDE is used to communicate with a Windows 3.x client application running on the same computer.
For more information on running the server using these options, see Supported network protocols.
You can instruct a server to use only some of the available network protocols when starting up, by using the -x command-line switch. The following command starts a server using the TCP/IP and IPX protocols:
dbsrv6 -x "tcpip,ipx"
The quotes are not strictly required in this example, but are needed if there are spaces in any of the arguments to -x.
Additional parameters can be added to tune the behavior of the server for each protocol. For example, the following command line (entered all on one line) instructs the server to use two network cards, one with a specified port number.
dbsrv6 -x tcpip{MyIP=192.75.209.12:2367,192.75.209.32} path\asademo.db
For detailed descriptions of the available network communications parameters that can serve as part of the -x switch, see Network communications parameters.