Home | Previous Page | Next Page   Disk, Memory, and Process Management > Managing Disk Space > Managing Dbspaces >

Creating a Dbspace that Uses the Default Page Size

This section explains how to use onspaces to create a standard dbspace and a temporary dbspace. For information on creating a dbspace with a non-default page size, see Creating a Dbspace with a Non-Default Page Size.

For information on using ISA to create a dbspace, see the ISA online help.

Any newly added dbspace (and its mirror, if one exists) is available immediately. If you are using mirroring, you can mirror the dbspace when you create it. Mirroring takes effect immediately.

To create a standard dbspace using onspaces
  1. On UNIX, you must be logged in as user informix or root to create a dbspace.

    On Windows, users in the Informix-Admin group can create a dbspace.

  2. Ensure that the database server is in online, single-user, or quiescent mode.
  3. Allocate disk space for the dbspace, as described in Allocating Disk Space.
  4. To create a dbspace, use the onspaces -c -d options.

    Kilobytes is the default unit for the -s size and -o offset options. To convert kilobytes to megabytes, multiply the unit by 1024 (for example, 10 MB = 10 * 1024 KB).

    See Creating a Dbspace with a Non-Default Page Size for information on additional onspaces options if you are creating a dbspace with a non-default page size.

  5. If you do not want to specify the first and next extent sizes for the tblspace tblspace in a dbspace, go to step 6.

    If you want to specify the first and next extent sizes for the tblspace tblspace in a dbspace, see additional information in Specifying the First and Next Extent Sizes for the tblspace tblspace.

  6. After you create the dbspace, you must perform a level-0 backup of the root dbspace and the new dbspace.

The following example shows how to create a 10-megabyte mirrored dbspace, dbspce1, with an offset of 5000 kilobytes for both the primary and mirror chunks, using raw disk space on UNIX:

onspaces -c -d dbspce1 -p /dev/raw_dev1 -o 5000 -s 10240 -m /dev/raw_dev2 5000

The following example shows how to create a 5-megabyte dbspace, dbspc3, with an offset of 200 kilobytes, from raw disk space (drive e:) on Windows:

onspaces -c -d dbspc3 \\.\e: -o 200 -s 5120

For more information on creating a dbspace with onspaces, see Dbspaces. and information on the onspaces utility in the IBM Informix Administrator's Reference.

To create a dbspace with ON-Monitor (UNIX)
  1. Select the Dbspaces > Create option.
  2. Enter the name of the new dbspace in the field Dbspace Name.
  3. If you want to create a mirror for the initial dbspace chunk, enter Y in the Mirror field.

    Otherwise, enter N.

  4. If the dbspace that you are creating is a temporary dbspace, enter Y in the Temp field.

    Otherwise, enter N.

  5. If you are specifying a page size for a standard dbspace, enter the size in kilobytes in the Page Size field. The size must be a multiple of the page size of the root dbspace. For more information on specifying page sizes, see Creating a Dbspace with a Non-Default Page Size.

    All tables, indexes, and other objects within the dbspace will use pages of the specified size.

  6. Enter the full pathname for the initial primary chunk of the dbspace in the Full Pathname field of the primary-chunk section.
  7. Specify an offset in the Offset field.
  8. Enter the size of the chunk, in kilobytes, in the Size field.
  9. If you are mirroring this dbspace, enter the mirrored-chunk full pathname, size, and optional offset in the mirrored-chunk section of the screen.

For more information, refer to the ON–Monitor chapter in the IBM Informix Administrator's Reference.

Specifying the First and Next Extent Sizes for the tblspace tblspace

Specify first and next extent sizes if you want to reduce the number of tblspace tblspace extents and reduce the frequency of situations when you need to place the tblspace tblspace extents in non-primary chunks. (A primary chunk is the initial chunk in a dbspace.)

You can choose to specify the first extent size, the next extent size, both the first and the next extent size, or neither extent size. If you do not specify first or next extent sizes for the tblspace tblspace, Dynamic Server uses the existing default extent sizes.

You can use the TBLTBLFIRST and TBLTBLNEXT configuration parameters to specify the first and next extent sizes for the tblspace tblspace in the root dbspace that is created when the server is initialized.

You can use the onspaces utility to specify the first and next extent sizes for the tblspace tblspace in non-root dbspaces.

You can only specify the first and next extent sizes when you create dbspace. You cannot alter the specification of the first and next extent sizes after the creation of the dbspace. In addition, you cannot specify extent sizes for temporary dbspaces, sbspaces, blobspaces, or external spaces. You cannot alter the specification of the first and next extents sizes after the creation of the dbspace.

To specify the first and next extent sizes
  1. Determine the total number of pages needed in the tblspace tblspace. The number of pages is equal to the sum of the number of tables, detached indexes, and table fragments likely to reside in the dbspace plus one page for the tblspace tblspace.
  2. Calculate the number of kilobytes needed for the number of pages. This number will depend on the number of kilobytes to a page on the system.
  3. Determine the space management needs on your system by considering the importance of having all of the extents for the tblspace tblspace allocated during dbspace creation and whether the extents should be allocated contiguously. The more important these issues are, the larger the first extent size should be. If you are less concerned with having non-contiguous extents, possibly in secondary chunks, then the first and next extent sizes can be smaller.
  4. Specify the extent size as follows:
    • If the space requirement is for the root dbspace, specify the first extent size in the TBLTBLFIRST configuration parameter and the next extent size in the TBLTBLNEXT configuration parameter. Then initialize the database server instance.
    • If the space requirement is for a non-root dbspace, indicate the first and next extent sizes on the command line using the onspaces utility to create the dbspace.

Extent sizes must be in kilobytes and must be multiples of the page size. When you specify first and next extent sizes, follow these guidelines:

Type of Extent Minimum Size Maximum Size
First extent in a non-root dbspace The equivalent of 50 pages, specified in kilobytes. This is the system default.
For example, for a two-kilobyte page system, the minimum length is 100.
The size of the initial chunk, minus the space needed for any system objects such as the reserved pages, the database tblspace, and the physical and logical logs.
First extent in a root dbspace The equivalent of 250 pages specified in kilobytes. This is the system default. The size of the initial chunk, minus the space needed for any system objects such as the reserved pages, the database tblspace, and the physical and logical logs.
Next Extent Four times the disk-page size on the system. The default is 50 pages on any type of dbspace. The maximum chunk size minus three pages.

You use the following onspaces utility -ef and -en options to specify the first and next extent sizes for the tblspace tblspace in non-root dbspaces:

For example, you can specify:

onspaces -c -d dbspace1 -p /usr/data/dbspace1 -o 0 -s 1000000 -e 2000 -n 1000

You can use Oncheck -pt and oncheck -pT to show the first and next extent sizes of a tblspace tblspace.

If HDR is being used and a dbspace is created on the primary database server, the first and next extent sizes are passed to the secondary database server via the ADDCHK log record.

For more information on the onspaces utility, oncheck commands, and specifying the first and next extent sizes for the tblspace tblspace, see the IBM Informix Administrator's Reference.

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