DB2 Server for VSE: System Administration


Database Generation Parameters

Planning for the generation of a database entails establishing logical and physical limits for its capacity, and setting its initial DASD allocations.

The parameters that you must establish at this time are summarized in Table 3. This figure also shows the IBM-provided values used for the starter database.

Note:The parameters that have a Yes entry in the Fixed column must be established during generation of the database, and cannot be changed for the lifetime of the database. Also note that some parameters are established by running the VSAM IDCAMS program, whereas others are established by input to an IBM-supplied job called ARISQLDS.

Following the figure is a discussion of how to set these parameters, and of the issues to consider when setting them.

Table 3. Database Parameters Set at Database Generation Time
Parameter Default Minimum Maximum Starter Database Fixed Set by
Database directory size None
2 tracks

1 volume 34 cylinders No IDCAMS

Log data set (or data sets)
-Size (each)
-Number


None
None


1 cylinder
1


524,287
4Kb pages
2 volumes


8 cylinders
1


No


IDCAMS

Maximum number of storage pools (MAXPOOLS) 32 1 999 256 Yes ARISQLDS
Maximum number of dbextents (MAXEXTNT) 64 1 999 256 Yes ARISQLDS
Maximum number of dbspaces (MAXDBSPC) 1000 10 32000 10240 Yes ARISQLDS

Catalog dbspace
(PUBLIC.SYS0001)
Size (4 kilobyte pages)

None 128 8388607 12800 Yes ARISQLDS

First package dbspace
(PUBLIC.SYS0002)
Size (4 kilobyte pages)

None 128 8388607 2048 Yes ARISQLDS

HELP text dbspace
(PUBLIC.HELPTEXT)
Size (4 kilobyte pages)

None 2304 8388607 8192 No ARISQLDS

ISQL dbspace
(PUBLIC.ISQL)
Size (4 kilobyte pages)

None 128 8388607 1024 No ARISQLDS

SAMPLE dbspace
(PUBLIC.SAMPLE)
Size (4 kilobyte pages)

None 512 8388607 512 No ARISQLDS

Internal dbspaces
-Size (each)
(4 kilobyte pages)
-Number


None
None


128
5


8388607
31997


1024
80


No


ARISQLDS


Initial dbextents
-Size (each)
-Number


None
None


1 cylinder
1


1 volume
999


77 cylinders
1


No


IDCAMS

Notes:

  1. The cylinder specifications listed above for the starter database are for IBM 3380 storage devices. Make the appropriate adjustment for your storage devices.

  2. PUBLIC means that the dbspace is publicly owned.

Defining Database Directory Size

The DB2 Server for VSE directory (called BDISK) contains control information and page tables for mapping dbspace page references to physical DASD locations. Its size determines the maximum number of dbextent pages and the number of page table entries that can be supported by the database being generated.

Use the VSAM DEFINE CLUSTER command to define the BDISK data set. The directory size is established by the TRK, CYL, or BLK parameter. If necessary, you can later expand the directory to hold more dbspace pages, or more dbspace and dbextent pages. Refer to Expanding the Database Directory for more details.

Table 4 shows the recommended cylinder (or block) allocations for various DASD device types, based on assumed maximum database sizes.

Table 4. Recommended Directory Allocations for Various Database Sizes
Directory Space for Various IBM Storage Devices

Maximum
Database
Size


 
 
3375


 
 
3380


 
 
3390


 
 
9345


 
FB-512
BLOCKS


10 megabytes


TRK(3)


TRK(3)


TRK(3)


TRK(4)


BLK(124)


50 megabytes


TRK(7)


TRK(6)


TRK(6)


TRK(7)


BLK(310)


100
megabytes


CYL(1)


TRK(11)


TRK(10)


TRK(12)


BLK(496)


500
megabytes


CYL(5)


CYL(4)


CYL(4)


CYL(6)


BLK(2232)


1 gigabyte


CYL(10)


CYL(8)


CYL(7)



BLK(4480)


2 gigabytes


CYL(19)


CYL(16)


CYL(14)


CYL(21)


BLK(8866)


4 gigabytes


CYL(38)


CYL(32)


CYL(27)


CYL(42)


BLK(17696)


5 gigabytes


CYL(47)


CYL(40)


CYL(34)


CYL(52)


BLK(22080)


10 gigabytes


CYL(92)


CYL(80)


CYL(68)


CYL(101)


BLK(44144)


50 gigabytes


CYL(459)


CYL(400)


CYL(337)


CYL(504)


BLK(220286)

Note:The values in this table apply when the defaults are used for MAXPOOLs, MAXDBSPC, and MAXEXTNT. These parameters are described in Establishing Database Capacity Parameters.

Use Table 4 to choose the initial directory size. Detailed information for generating its values is contained in Appendix B, Estimating Database Storage. When estimating the maximum database size, include the sizes of the public, private, and internal dbspaces.

The directory data set for the starter database supports about 4.9 gigabytes of data. This includes space for internal dbspace definitions so the actual space supported for public and private dbspaces is about 4.6 gigabytes.

Directory Allocation Considerations

Maximum Database Size

The directory data set cannot extend beyond a single volume; therefore, the maximum database size is limited by the single volume capacity of the device type used. The absolute maximum size for a database is either 64 gigabytes or the limit imposed by the device type, whichever is smaller. For the limits imposed by various devices, see Table 38 and Table 39.

Placement of Directory

The directory data set will be used extensively by the database manager for resolution of data addresses. Thus, you should not allocate it to a volume that will contain either the log data sets or heavily used data dbextents. Instead, place it on a separate volume to avoid device contention.

If DASD is limited on your system and the directory must share a volume with data dbextents, put it on a volume with a dbextent that contains infrequently referenced data. For example, sharing a volume with private dbspaces or historical data is preferable to sharing one with public dbspaces or current, highly active data.

Defining the Database Log

The database manager requires at least one log data set and can support two. It is recommended that you use two log data sets.

The log data sets contain information, recorded during database processing, that is used to support database recovery facilities. This includes control information (for example, COMMIT statement and checkpoint records) and the specifics of database changes (for example, inserts, updates, and deletes).

If you define two log data sets they must be exactly the same size. Do not define them on different device types because it is almost impossible (because of rounding) to get identically sized data sets using space allocation algorithms.

To establish the size of the log data sets use the VSAM DEFINE CLUSTER commands for LOGDSK1 and (optionally) LOGDSK2. The size you specify will depend on the use of the database and on the type of recovery capabilities you want. If you underestimate this size at database generation time, you can redefine it afterwards, as described in Log Reconfiguration.

Log Size Considerations

The log size depends on the number of changes that you expect will be made to the database and on whether or not you plan to use archiving facilities. If either database or log archiving is enabled, the log must be large enough to hold all the logging done between archives; otherwise it need only be large enough to hold the logging done in a few hours.
Note:If you are putting dbspaces in nonrecoverable storage pools, keep in mind that only minimal logging is done for them, so the following log size considerations would not apply to those dbspaces.

Log Size without Archiving

If you run the database manager without the archiving facilities (LOGMODE=Y or N), log space is reclaimed as applications finish and checkpoints of the database are taken. Usually, this occurs every few seconds or every few minutes. Many uses of the database manager can be supported by a log size of only one or two cylinders; however, a long-running application may require more log space.

Typically, the largest demand for log space is online loading or reorganization jobs. These jobs run longer than most applications and cause a lot of logging to occur.

A starting estimate for the initial log size is twice the space requirements of your largest dbspace. If you have one exceptionally large dbspace, you can disregard it and use the size of the next largest dbspace. The data in the largest dbspace can be loaded and reorganized offline with logging inhibited.

Log Size with Archiving

If you are using the archiving facilities (LOGMODE=A or L), log space is not reclaimed until an archive is taken. That is, log space is not reused between archives of the log or database. Typically, you would only archive the database once or twice a week. You may choose to do log archiving more frequently, depending on database usage.

To estimate the size of the log, consider the amount of logging that will occur between archives. A useful approach is to estimate the percentage of data that will be generated, deleted, and changed over one archive period as follows:

   logsize estimate =  (percentage generated
                        + percentage deleted
                        + percentage changed x 2)
                       x database size

For example, assume that in a one-week period the database size grows by 5% but also shrinks by 4%, and that 6% of the database (rows) are changed. Your estimate for the log size would be:

   logsize estimate =  .21 x database size

If your database size were 100 megabytes and you wanted an archive period of one week, your log size estimate would be:

   logsize estimate =  21 megabytes

This is approximately 30 cylinders of an IBM 3390 DASD device.

Logging Generated by Loading

The log requirements for processing the DBS utility DATALOAD and RELOAD commands in multiple user mode are:

The log space consumption caused by these operations can be avoided by running the DBS utility in single user mode with LOGMODE=N specified, or by using the COMMITCOUNT option to force periodic checkpoints in multiple user mode.

Placement of Logs

Like the directory data set the log data sets are frequently referenced during processing. To avoid device contention, they should reside on separate volumes from the directory or heavily used dbextents.

Placement of Dual Logs

If two log data sets are defined, place them on separate volumes. If they were allocated to the same one, loss of that volume would cause the loss of both logs, thus defeating the purpose of dual logging.

Establishing Database Capacity Parameters

The MAXPOOLS, MAXEXTNT, MAXDBSPC, and CUREXTNT keyword control statements can be specified on control card input to database generation (done by program ARISQLDS with the STARTUP=C initialization parameter). The first three of these statements are optional. The last one must be specified.

The MAXPOOLS, MAXEXTNT, and MAXDBSPC values are fixed when the database is generated: once defined, they cannot be changed for its lifetime. To avoid future limitation problems, it is recommended that you set them to the allowed maximums. This will take about 1 cylinder of DASD on a 3380 device for the directory, and 280K virtual storage when the database manager is running.

Estimating MAXPOOLS

The MAXPOOLS specification determines the maximum number of storage pools that can be defined in the database. Storage pools control the location of data on DASD volumes - that is, what dbspaces are located on what volumes. You can make a generous estimate for MAXPOOLS, since the value specified results in only a small directory space allocation for each potential storage pool. You should plan on having one storage pool for each user group (or billing account), and one for each major application you expect the database to support.

Estimating MAXEXTNT

The MAXEXTNT controls the maximum number of dbextents that are defined to support the database being generated. Dbextents determine the physical allocation of DASD space for a storage pool.

Because a dbextent is a VSAM data set, it cannot span DASD volumes. This means that you need at least as many dbextents as volumes. You can, of course, define multiple dbextents on one volume. It also means that if you have a dbspace that spans multiple volumes, the corresponding storage pool requires multiple dbextents.

Because you should plan to support multiple dbextents for each storage pool and you should be prepared to extend most, if not all, of your planned storage pools, MAXEXTNT should be much larger than MAXPOOLS. Your estimate for it can be generous because this value results in only a small directory space allocation for each potential dbextent.

Estimating MAXDBSPC

MAXDBSPC controls the maximum number of dbspaces, including internal dbspaces, that can be defined for the database. See Determining the Internal Dbspace Requirements. A dbspace is a logical allocation of database space for holding one or more tables and their indexes. A dbspace is assigned to a storage pool when it is defined and draws on the actual DASD space available in that storage pool on an as-needed basis. Typically, dbspaces are defined to support private space allocations for individual users and space allocations for specific applications; thus, the number of dbspaces required generally depends on the number of users and the number of tables needed for applications. Each user probably requires from one to five private dbspaces over the lifetime of the database, and each application requires, at most, one dbspace for each table being accessed. For performance reasons, one table per dbspace is recommended.

As with the previous two parameters, your estimate for MAXDBSPC can be generous, because the value you specify will result in only a small allocation of directory space for each potential dbspace.

Estimating CUREXTNT

CUREXTNT determines the number of dbextents defined during database generation. This number should be sufficient to support your initial storage requirements. You can add more dbextents after database generation.

Establishing Initial Dbspace Requirements

Determining the System Dbspace Requirements

Any public dbspace that has SYS as the first three characters in its name is reserved for system use only. The system dbspaces established at database generation time are PUBLIC.SYS0001, PUBLIC.SYS0002, PUBLIC.HELPTEXT, PUBLIC.ISQL, and PUBLIC.SAMPLE.

This section presents only general concepts related to setting the initial dbspace sizes. For more information, see Specifying Initial Dbspaces and Appendix B, Estimating Database Storage.

The ARISDBU A-type member contains SQL statements to acquire the public dbspaces HELPTEXT, ISQL, and SAMPLE. If you want to increase their size, update the appropriate ACQUIRE DBSPACE statement in ARISDBU.

Except for PUBLIC.SAMPLE, the sizes that you establish for system dbspaces at database generation time can limit the logical capacity of your database. Because physical space is not actually used until required, you should establish large sizes for them. The large recommended sizes shown in Figure 7 will support most uses of the database manager.

Figure 7. Guidelines for the Sizes of the System Dbspaces

REQTEXT

Determining the Initial User Dbspace Requirements

When you generate the database, you need only consider the dbspace requirements for its initial use. To determine the initial user dbspace requirements, either consult with the database administrator or refer to the DB2 Server for VSE & VM Database Administration manual. The ADD DBSPACE facility can be used to add more later, up to the MAXDBSPC value.

For more information, refer to Chapter 7, Managing Database Storage.

Determining the Internal Dbspace Requirements

The database manager uses internal dbspaces to process commands that require sort operations and to process views that require materialization. For information on sorting and materialization, see the DB2 Server for VSE & VM Database Administration manual.

The internal dbspaces are held until a COMMIT or ROLLBACK statement is issued; therefore, a single application may hold a number of internal dbspaces at one time. For example, if each SELECT needs an average of two internal dbspaces, and a certain program issues five SELECTs before issuing a COMMIT statement, then that program will hold 10 internal dbspaces. Internal dbspaces that are not in use take up minimal space (approximately 4 bytes of directory space for each page).

Allocate at least 30 internal dbspaces; more if your installation has interactive users. The exact number required depends on the number of logical units of work (LUWs) that are concurrently active and the amount of sorting and view materialization required in those LUWs. Because the number of NCUSERS is comparable to the number of concurrently active LUWs, as a guideline, in addition to the minimum of 30, you may want to provide 10 internal dbspaces for each NCUSER (see the description of the NCUSERS parameter on NCUSERS). After the database has been generated, you can always add more internal dbspaces by using the ADD DBSPACE function. All internal dbspaces (and their storage pool assignments) are redefined on each run of this function.

The physical placement of the internal dbspaces affects performance, especially when you perform a sort operation on a large table. You should place internal dbspaces in their own storage pool, and use multiple dbextents over multiple devices. There are several ways of doing this. Suppose you had 300 3380-type cylinders for internal dbspace dbextents, you could use one of these strategies:

  1. Make the first dbextent small (less than 100 cylinders), and each succeeding dbextent twice the size of the preceding one. For example, have dbextents that are 20, 40, 80, and 160 cylinders in size.
  2. Graduate the sizes of the dbextents. For example, have dbextents that are 10, 20, 30, 40, 50, 60, and 90 cylinders in size. The last dbextent is extra large so that unusually large sorts can be accommodated.
  3. Have several small dbextents and a few big ones. For example, have five dbextents of 20 cylinders each, and two of 100 cylinders.

The purpose of all these strategies is to spread input/output activity over more devices as the size of a sort increases. The strategy you adopt determines how many dbextents a sort requires. With the first strategy, a sort requiring 60 cylinders uses two dbextents. With the second and third strategies, the same sort requires three dbextents. Use a strategy that is suitable for your organization.

Sorting is done for ORDER BY, GROUP BY, join, CREATE INDEX, or UNION operations. The internal dbspaces must be large enough to hold the rows being sorted. For example, if an ORDER BY operation is requested using all the columns of an entire table, the internal dbspace must be large enough to hold the whole table. Less space is required if all the columns are not selected. During index creation, space is required only for the key columns. To calculate the required size of an internal dbspace, use the formula (KEYSIZE + 8 bytes) * ROWCOUNT. Make the internal dbspaces large enough to hold the largest table or query result you want to be able to sort. The dbspace size estimates are discussed under Appendix B, Estimating Database Storage.

The number of internal dbspaces required also depends on the planned usage of the system. Fewer are needed for preplanned application processing than for dynamic query processing, as query users usually hold dbspaces longer than do preplanned applications.

Internal dbspaces can also be stored on a virtual disk. Only use virtual disks for internal dbspaces because information on a virtual disk is lost when the database is restarted. For more information on virtual disk support, see the DB2 Server for VSE & VM Performance Tuning Handbook manual.

Determining Initial Dbextent Requirements

Sufficient space must be allocated during database generation to support your initial dbspace data storage requirements. You must define at least one dbextent for each storage pool that initially contains dbspaces. The specific amount to allocate for each storage pool depends on the following considerations:

For more information on storage organization techniques, see Chapter 7, Managing Database Storage.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]