![]() | ![]() |
Home |
|
|
Utility Guide |
|
| Chapter 1 Building Servers Using dataserver |
Chapter 1
Adaptive Server version 12.5 no longer uses the buildmaster binary to build the master device. Instead, Sybase has incorporated the buildmaster functionality in the dataserver binary . This chapter discusses how to use dataserver to build your server.
The dataserver binary in Windows NT is called sqlsrvr.exe. If you are using the Windows NT platform, substitute all reference to dataserver in this chapter with sqlsrvr.
For a detailed description of dataserver syntax, see dataserver. For a detailed description of sqlsrvr syntax, see sqlsrvr.
The dataserver command allows you to create master devices and databases with logical pages of size 2K, 4K, 8K, or 16K. Larger logical pages allow you to create larger rows, which can improve your performance because Adaptive Server accesses more data each time it reads a page. For example, a 16K page can hold eight times the amount of data as a 2K page, an 8K page holds four times as much data as a 2K page, and so on, for all the sizes for logical pages.
The logical page size is a server-wide setting; you cannot have databases with varying size logical pages within the same server. All tables are appropriately sized so that the row size does not exceed the current page size of the server. That is, rows cannot span multiple pages.
This section describes the process for creating a new master device using the dataserver utility. The master device is built using the build mode in dataserver. After the master device is built, the server shuts down. You must then manually start the server in the start mode. After this you can start, stop, and restart Adaptive Server whenever necessary without having to rebuild the master device
Adaptive Server uses three types of page sizes:
Logical page size - these are the pages that the database objects are built with. A databases and any of its related objects must use the same logical page size. Logical page sizes come in sizes of 2K, 4K, 8K, and 16K.
Virtual page size - this is the physical page allocation at the disk level, and is always done in 2K pages. All disk I/O is done in multiples of virtual page size.
Memory page size - the memory allocated and managed within Adaptive Server. The memory page size is always in units of 2K pages.
The following syntax creates a new master device with dataserver:
dataserver -ddevice_name
. . .
-b [master_device_size [k|K|m|M|g|G]
[-z logical_page_size [k|K]
-hWhere:
-d device_name - is the full path name of the device for the master database. The master database device must be writable by the user who starts Adaptive Server. The default master database device name is d_master.
-b - indicates that dataserver is in build mode and creating a new master device, and indicates the size of the master device. If you do not provide a unit specifier (k, m, g) for the size of the device, dataserver assumes a size in virtual pages. The size of a virtual page is always 2K. For example:
-b 51204 - specifies a device of 51,204 virtual pages (100.0078125MB).
-b 100M - specifies a device of 100Mb
-z - specifies the logical page size, which is always 2K, 4K, 8K, or 16K. That is, one logical page = N virtual pages. This parameter is optional during the build phase and is ignored during the start mode. If you do not include the -z parameter during the build mode, the master device is built with 2K logical pages.
-h - prints the syntax for the dataserver command.
See dataserver for a full list of dataserver parameters and their definitions.
When you start an Adaptive Server with the dataserver program, Adaptive Server derives its running environment from:
The configuration file you specify in -c configuration_file
The default configuration file, servername.cfg, if you did not specify the -c parameter
Default values if you did not specify either -c configuration_file or servername.cfg
For more information on these configuration parameters, see Chapter 17, "Setting Configuration Parameters," in the Sybase Adaptive Server Enterprise System Administration Guide.
To create a new Adaptive Server, issue dataserver using the -b and -z options.
For example, to:
Build a 100MB master device using the default logical page size (2K) and start the server:
dataserver -d /var/sybase/masterdb.dat -b100M -sMASTER2K
Build a 100MB master device with a logical page size of size 4K:
dataserver -d /var/sybase/masterdb.dat -b100M -z4K -sMASTER4K
Build a master device of 102,400 virtual pages of size 2K, create databases using a logical page size of 8K, and boot the server:
dataserver -d /var/sybase/masterdb.dat -b102400 -z8K -sMASTER8K
If the total requested space (102,400 x 2K = 200 MB) is insufficient to build all the required system databases using the specified logical page size, then an error message is reported, and the process fails.
The following is a sample output of dataserver building a 200MB device with a 2K logical page size, called personnel2k:
dataserver -d /var/sybase/personnel2k.dat -b200M -z2k -sPERSONNEL2K
dataserver uses a default configuration file if you do not specify one:
00:00000:00000:2001/04/16 10:24:31.73 kernel Warning: Using default file '/var/sybase/PERSONNEL2K.cfg' since a configuration file was not specified. Specify a configuration file name in the RUNSERVER file to avoid this message.
To specify your own configuration file, use dataserver's -c parameter. See Chapter 11, "Setting Configuration Parameters" in the Adaptive Server Enterprise System Administration Guide for more information.
Adaptive Server version 12.5 treats all installations as an upgrade, regardless of whether you have an existing version of Adaptive Server or not. For this reason, you see the following output when running dataserver:
00:00000:00001:2001/04/16 10:24:32.63 server Database 'master' appears to be at an older revision than the present installation; SQL Server will assess it, and upgrade it as required.00:00000:00001:2001/04/16 10:24:32.66 server Database 'master': beginning upgrade step [ID 1]: Initialize disk and create empty allocation units on master device. 00:00000:00001:2001/04/16 10:24:34.74 server Database 'master': beginning upgrade step [ID 2]: Bootstrap basic system catalogs in database.
dataserver continues creating the master database, including all of its tables such as systypes, sysobjects and sysusages:
00:00000:00001:2001/04/16 10:24:35.21 server Database 'master': beginning upgrade step [ID 3]: creating index (table systypes, index ncsystypes)00:00000:00001:2001/04/16 10:24:35.36 server Database 'master': beginning upgrade step [ID 4]: creating index (table sysobjects, index ncsysobjects)00:00000:00001:2001/04/16 10:24:35.44 server Database 'master': beginning upgrade step [ID 20]: creating table (table sysusages)[...]
When dataserver has created the master database, it creates the model database:
[...]
00:00000:00001:2001/04/16 10:24:43.14 server Database 'model' appears to be at an older revision than the present installation; SQL Server will assess it, and upgrade it as required.00:00000:00001:2001/04/16 10:24:43.14 server Database 'model': beginning upgrade step [ID 1]: Initialize disk and create empty allocation units on master device. 00:00000:00001:2001/04/16 10:24:43.83 server Database 'model': beginning upgrade step [ID 2]: Bootstrap basic system catalogs in database. 00:00000:00001:2001/04/16 10:24:43.89 server Database 'model': beginning upgrade step [ID 3]: creating index (table systypes, index ncsystypes)00:00000:00001:2001/04/16 10:24:43.91 server Database 'model': beginning upgrade step [ID 4]: creating index (table sysobjects, index ncsysobjects)[...]
When dataserver has created the model database, it creates the tempdb and sybsystemdb databases:
[...]
00:00000:00001:2001/04/16 10:24:45.23 server CREATE DATABASE: allocating 1024 logical pages (2.0 megabytes) on disk 'master'.00:00000:00001:2001/04/16 10:24:46.79 server Database sybsystemdb successfully created.
[...]
dataserver is successful when the server changes the default sort order and shuts down:
[...]
00:00000:00001:2001/04/16 10:24:47.23 server Now loading SQL Server's new default sort order and character set[...]
00:00000:00001:2001/04/16 10:24:47.31 server Default Sort Order successfully changed.00:00000:00001:2001/04/16 10:24:47.37 server SQL Server shutdown after verifying System Indexes.00:00000:00001:2001/04/16 10:24:47.37 kernel ueshutdown: exiting
If dataserver is not successful, you are unable to boot the server on that master device, and you see the following error message:
00:00000:00001:2001/04/16 19:02:39.53 kernel Use license file /var/sybase/SYSAM-1_0/licenses/license.dat.00:00000:00001:2001/04/16 19:02:39.54 kernel The master device's configuration area appears to be corrupt. The server needs this data to boot, and so cannot continue. The server will shut down.
If you run dataserver with a user-specified configuration file that includes options that make it impossible to allocate a shared segment and start up a server, dataserver fails with an error message, and you are unable to boot the server on that master device:
00:00000:00001:2001/04/16 19:04:01.11 kernel Use license file /var/sybase/SYSAM-1_0/licenses/license.dat.00:00000:00000:2001/02/09 19:04:01.25 kernel Using config area from primary master device.00:00000:00001:2001/04/16 19:04:01.36 server The value of the 'max total_memory' parameter (33792) defined in the configuration file is not high enough to set the other parameter values specified in the configuration file. 'max total_memory' should be greater than the logical memory '34343'.
To start an existing Adaptive Server, issue dataserver without the -b and -z options.
dataserver -d /sybase/masterdb.dat
Adaptive Servers earlier than version 12.5 used 2K logical page sizes. You cannot change an installation's page size by upgrading. That is, if your current Adaptive Server uses 2K logical pages, you can upgrade only to an Adaptive Server that uses 2K logical pages.
However, you can migrate databases with 2K logical pages from earlier versions of Adaptive Server. For information on how to use the dataxtr data migration tool, see the Adaptive Server Enterprise release bulletin for your platform.
To display information about Adaptive Server's limits:
dbcc serverlimits includes the size of your server's logical page size in its output. For example, enter:
dbcc serverlimits
Search for the string "logical page size" in the error log.
The global variable @@maxpagesize displays the server's logical page size. At the isql prompt, issue:
select @@maxpage size
-----------
8192|
|