Home | Previous Page | Next Page   Utility Reference > onutil: Check, Define, and Modify Storage Objects > CREATE DBSLICE >

Specifying Uniform Chunk Names in a Dbslice

When you create a dbslice, you can use embedded formatting characters in the pathname to generate uniform chunk names for the dbspaces that make up a dbslice. The pathname specification with the embedded formatting characters is referred to as a pathname_format. A pathname format generates unique chunk names for all of the dbspaces in a dbslice.

You can embed the following formatting characters within a pathname format:

%c
%n
%o
%r(first..last)

The onutil utility substitutes values stored internally for the %c, %n, and %o formatting characters.

Creating a Dbslice from Multiple Dbspaces on Each Coserver

When you intend to create a dbslice with multiple dbspaces on each coserver, you can use the following methods to specify unique pathnames for each dbspace on a coserver:

Generating Pathnames with Coserver Numbers

Use the %c formatting character to generate a pathname with the coserver number embedded in it. The coserver number is the number that the COSERVER configuration parameter in your ONCONFIG file specifies.

The following example shows the onutil CREATE COGROUP command to create a cogroup for eight coservers and the onutil CREATE DBSLICE command with the %c formatting character embedded in the pathname:

% onutil
1> CREATE COGROUP acctg_cogroup
2> FROM eds.%r(9..16);
Cogroup successfully created.
3> CREATE DBSLICE acctg_sl
4> FROM COGROUP acctg_cogroup 
5> CHUNK "/dev/dbsl.%c.acctgdbsp"
6> OFFSET 1024 SIZE 1024;

This example assumes the coserver numbers in the ONCONFIG file shown in Figure 83, and it generates the following pathnames.

Coserver Dbspace Identifier Pathname of Primary Chunk Offset
eds.9 acctg_sl.1 /dev/dbsl.9.acctgdbsp 1024
eds.10 acctg_sl.2 /dev/dbsl.10.acctgdbsp 1024
eds.11 acctg_sl.3 /dev/dbsl.11.acctgdbsp 1024
...
eds.16 acctg_sl.8 /dev/dbsl.16.acctgdbsp 1024

Generating Pathnames with Node Names

Use the %n formatting character to generate a pathname with the host name of the node, or node name, embedded in it. The node name is the value that the NODE configuration parameter in your ONCONFIG file specifies.

The following example shows the onutil CREATE COGROUP command to create a cogroup for eight coservers and the onutil CREATE DBSLICE command with the %n formatting character embedded in the pathname:

% 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.%n.acctgdbsp"
6> OFFSET 1024 SIZE 1024;

This example assumes the coserver numbers in the ONCONFIG file shown in Figure 83, and it generates the following pathnames.

Coserver Dbspace Identifier Pathname of Primary Chunk Offset
eds.1 acctg_sl.1 /dev/dbsl.node1.acctgdbsp 1024
eds.2 acctg_sl.2 /dev/dbsl.node2.acctgdbsp 1024
eds.3 acctg_sl.3 /dev/dbsl.node3.acctgdbsp 1024
...
eds.8 acctg_sl.8 /dev/dbsl.node8.acctgdbsp 1024

Generating Pathnames with Dbspace Ordinal Numbers

Use the %o formatting character to generate a pathname with the dbspace ordinal number embedded in it. The database server automatically generates the dbspace ordinal number when you create a dbslice. The ordinal number indicates the order in which the dbspaces were created. The ordinal number starts at 1 and increments to the total number of dbspaces in the dbslice.

The following example shows the onutil CREATE COGROUP command to create a cogroup for eight coservers and the onutil CREATE DBSLICE command with the %o formatting character embedded in the pathname:

% onutil
1> CREATE COGROUP acctg_cogroup
2> FROM eds.%r(9..16);
Cogroup successfully created.
3> CREATE DBSLICE acctg_sl
4> FROM COGROUP acctg_cogroup 
5> CHUNK "/dev/dbsl.%o.acctgdbsp"
6> OFFSET 1024 SIZE 1024;

The preceding example assumes the coserver numbers in the ONCONFIG file shown in Figure 83. Therefore, the preceding example generates the following pathnames.

Coserver Dbspace Identifier Pathname of Primary Chunk Offset
eds.9 acctg_sl.1 /dev/dbsl.1.acctgdbsp 1024
eds.10 acctg_sl.2 /dev/dbsl.2.acctgdbsp 1024
eds.11 acctg_sl.3 /dev/dbsl.3.acctgdbsp 1024
...
eds.16 acctg_sl.8 /dev/dbsl.8.acctgdbsp 1024

Generating Pathnames for Multiple Dbspaces per Coserver

You can create multiple uniform dbspaces per coserver within the same dbslice. Use the %r(first..last) formatting characters to generate unique pathnames for each dbspace on a coserver.

The following example shows the onutil CREATE DBSLICE command to create three dbspaces on each coserver within the acctg_cogroup cogroup created in the previous example:

% onutil
1> CREATE DBSLICE acctg_sl
2> FROM COGROUP acctg_cogroup 
3> CHUNK "/dev/dbsl_acctg.%r(1..3)"
4> OFFSET 1024 SIZE 1024; 

The database server creates the following dbspaces on the eight coservers.

Coserver Dbspace Identifier Pathname of Primary Chunk Offset
eds.9 acctg_sl.1 /dev/dbsl_acctg.1 1024
eds.9 acctg_sl.2 /dev/dbsl_acctg.2 1024
eds.9 acctg_sl.3 /dev/dbsl_acctg.3 1024
eds.10 acctg_sl.4 /dev/dbsl_acctg.1 1024
eds.10 acctg_sl.5 /dev/dbsl_acctg.2 1024
eds.10 acctg_sl.6 /dev/dbsl_acctg.3 1024
...
eds.16 acctg_sl.22 /dev/dbsl_acctg.1 1024
eds.16 acctg_sl.23 /dev/dbsl_acctg.2 1024
eds.16 acctg_sl.24 /dev/dbsl_acctg.3 1024

Generating Pathnames with a Combination of Formatting Characters

The following rules describe how to combine the formatting characters:

Creating Two Dbspaces on Each Coserver for Cogroup acct_cogroup

The following example shows the onutil CREATE COGROUP command to create a cogroup for eight coservers and the onutil CREATE DBSLICE command to create two dbspaces on each coserver 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.%n.%r(1..2)"
6> SIZE 1024;

The database server creates the following dbspaces on the eight coservers.

Coserver Dbspace Identifier Pathname of Primary Chunk Offset
eds.1 acctg_sl.1 /dev/dbsl_acctg.node1.1 1024
eds.1 acctg_sl.2 /dev/dbsl_acctg.node1.2 1024
eds.2 acctg_sl.3 /dev/dbsl_acctg.node2.1 1024
eds.2 acctg_sl.4 /dev/dbsl_acctg.node2.2 1024
...
eds.8 acctg_sl.15 /dev/dbsl_acctg.node8.1 1024
eds.8 acctg_sl.16 /dev/dbsl_acctg.node8.2 1024

Creating Three Dbspaces on Each Coserver in Different Directories

You might want to spread the dbspaces among different drives to improve performance and parallel I/O. The following example shows the onutil CREATE DBSLICE command to create a dbslice that contains dbspaces in three different directories on each coserver. The cogroup, workgroup, contains three coservers.

% onutil
1> CREATE DBSLICE slice5
2> FROM cogroup workgroup
3> CHUNK "/work%r(3..5)/dbspaces/slice5.%c"
4> SIZE 200 MBYTES;

In the chunk names, the formatting character %c is replaced with the coserver number. The %r formatting character expands into the following directory names on each coserver: work3, work4, and work5.

The database server creates the following dbspaces on the three coservers.

Coserver Dbspace Name Pathname of Primary Chunk
eds.1 slice5.1 /work3/dbspaces/slice5.1
eds.1 slice5.2 /work4/dbspaces/slice5.1
eds.1 slice5.3 /work5/dbspaces/slice5.1
eds.2 slice5.4 /work3/dbspaces/slice5.2
eds.2 slice5.5 /work4/dbspaces/slice5.2
eds.2 slice5.6 /work5/dbspaces/slice5.2
eds.3 slice5.7 /work3/dbspaces/slice5.3
eds.3 slice5.8 /work4/dbspaces/slice5.3
eds.3 slice5.9 /work5/dbspaces/slice5.3
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]