When you create a dbslice, the database server creates uniform dbspaces across one or more existing cogroups.
Each dbslice component in the FROM clause specifies the dbspaces to create for a dbslice. You must specify the cogroup, pathname, and size in each dbslice component. The following example shows the onutil CREATE DBSLICE command that creates a dbspace on each coserver in cogroup_all:
% onutil 1> CREATE DBSLICE dbsl 2> FROM cogroup cogroup_all 3> CHUNK "/dev/dbsl_all" 4> OFFSET 1024 SIZE 1024;
This example assumes that your ONCONFIG file defines 16 coservers, as shown in Figure 83. Therefore, cogroup_all consists of coservers eds.1 to eds.16.
This example creates the following dbspaces on all 16 coservers.
Coserver | Dbspace Identifier | Pathname of Primary Chunk | Offset |
---|---|---|---|
eds.1 | dbsl.1 | /dev/dbsl_all | 1024 |
eds.2 | dbsl.2 | /dev/dbsl_all | 1024 |
eds.3 | dbsl.3 | /dev/dbsl_all | 1024 |
... | |||
eds.16 | dbsl.16 | /dev/dbsl_all | 1024 |
The database server derives the names of the dbspaces from the name of the dbslice. These derived names are referred to as derived_dbspace_identifiers. For more details on derived_dbspace_identifiers, refer to Derived Dbspace Identifier.
A derived_dbspace_identifier contains a period and a number at the end of the dbspace name. The number is called the ordinal of the dbspace within the dbslice. The ordinal indicates the order in which the dbspaces were created.
This example assumes that one coserver exists on each node. In this case, you can use a regular pathname, rather than a pathname format when you create a dbslice with one dbspace per coserver.
The following examples show the onutil CREATE COGROUP command to create a cogroup for eight coservers and the onutil CREATE DBSLICE command to create a dbslice for this cogroup:
% onutil 1> CREATE COGROUP acctg_cogroup 2> FROM eds.%r(1..8); Cogroup successfully created. 3> CREATE DBSLICE acctg_sl 4> FROM COGROUP acctg_cogroup 5> CHUNK "/dev/dbsl_acctg" 6> OFFSET 1024 SIZE 1024;
This example generates the following dbspace names (also referred to as dbspace identifiers) and pathnames for the first chunk of each dbspace created on the corresponding coserver.
Coserver | Dbspace Identifier | Pathname of Primary Chunk | Offset |
---|---|---|---|
eds.1 | acctg_sl.1 | /dev/dbsl_acctg | 1024 |
eds.2 | acctg_sl.2 | /dev/dbsl_acctg | 1024 |
eds.3 | acctg_sl.3 | /dev/dbsl_acctg | 1024 |
eds.4 | acctg_sl.4 | /dev/dbsl_acctg | 1024 |
eds.5 | acctg_sl.5 | /dev/dbsl_acctg | 1024 |
eds.6 | acctg_sl.6 | /dev/dbsl_acctg | 1024 |
eds.7 | acctg_sl.7 | /dev/dbsl_acctg | 1024 |
eds.8 | acctg_sl.8 | /dev/dbsl_acctg | 1024 |