Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Database Administration » Starting and Connecting to Your Database » The database server » Database server options

 

-c server option

Sets the initial memory reserved for caching database pages and other server information.

Syntax
{ dbsrv11 | dbeng11 } -c { size[ k | m | g | p ] } ...
Applies to

All operating systems and database servers.

Remarks

The amount of memory available for use as a database server cache is one of the key factors controlling performance. You can set the initial amount of cache memory using the -c server option. The more cache memory that can be given the server, the better its performance.

The size is the amount of memory, in bytes. Use k, m, or g to specify units of kilobytes, megabytes, or gigabytes, respectively.

The unit p is a percentage either of the physical system memory, or of the maximum non-AWE cache size, whichever is lower. The maximum non-AWE cache size depends on the operating system. For example:

  • 2.8 GB for Windows 32-bit Advanced Server, Enterprise Server, Datacenter Server, and Vista

  • 3.8 GB for the 32-bit database server running on Windows x64 Edition

  • 1.8 GB on all other 32-bit systems

  • On Windows Mobile, the p option specifies a percentage of available physical memory

If you use p, the argument is a percentage. You can use % as an alternative to p, but as most non-Unix operating systems use % as an environment variable escape character, you must escape the % character. To set the initial cache size to 50 percent of the physical system memory, you would use the following:

dbeng11 -c 50%% ...

On Unix operating systems, the cache size is set to the lesser of:

  • the value specified after -c

  • 95% of (available memory - 5 MB)

On Windows Mobile, the cache size will be set to the lesser of:

  • the value specified after -c

  • 95% of (available memory - 2 MB)

If no -c option is provided, the database server computes the initial cache allocation as follows:

  1. It uses the following operating-system-specific default cache sizes:

    • Windows Mobile   600 KB

    • Windows   2 MB

    • Unix   8 MB

  2. It computes a runtime-specific minimum default cache size, which is the lesser of the following items:

    • 25% of the computer's physical memory

    • The sum of the sizes of the main database files specified on the command line. Additional dbspaces apart from the main database files aren't included in the calculation. If no files are specified, this value is zero.

  3. It allocates the greater of the two values computed.

If your database is encrypted, you may want to increase the cache size. As well, if you are using dynamic cache resizing (-ca option), then the cache size that is used may be restricted by the amount of memory that is available.

See Increase the cache size.

The database server messages window displays the size of the cache at startup, and you can use the following statement to obtain the current size of the cache:

SELECT PROPERTY( 'CacheSize' );
See also
Example

The following example, entered all on one line, starts a server named myserver that starts with a cache size of 3 MB and loads the sample database:

dbeng11 -c 3m -n myserver "samples-dir\demo.db"

For information about samples-dir, see Samples directory.