官术网_书友最值得收藏!

Creating and configuring a multipartitioned database

In this recipe, we will proceed to create the NAV database as a multipartitioned database.

Getting ready

We will use nodedb21 and nodedb22 for all recipes in this chapter. The NAV database will be created under instance db2instp, created and configured in the Creating and configuring instances for a multipartitioned environments recipe in Chapter 1, DB2 Instance—Administration and Configuration.

For database storage, we have defined a new Linux partition /data. The database storage path will reside on the /data/db2 directory.

How to do it...

  1. Navigate to the /db2partinst/db2instp/sqllib directory. Here, open db2nodes.cfg with your preferred editor; you should find three nodes already configured in the Creating and configuring an instance for multipartitioned environments recipe, in Chapter 1, DB2 Instance—Administration and Configuration.
[db2instp@nodedb21 sqllib]$ more db2nodes.cfg 0 nodedb21 0 1 nodedb22 0 2 nodedb21 1

These three nodes will host the initial NAV multipartitioned database.

Note

You can set the database path at database creation, or you can set the database manager parameter DFTDBPATH to the desired database path.

As user db2instp executes the following command to create the NAV multipartitioned database:

[db2instp@nodedb21 ~]$ db2 "CREATE DATABASE NAV AUTOMATIC STORAGE YES ON '/data/db2' DBPATH ON '/data/db2' USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM PAGESIZE 8192 RESTRICTIVE WITH 'Aviation Geo Data'" DB20000I The CREATE DATABASE command completed successfully. [db2instp@nodedb21 ~]$ 

How it works...

By creating the database using automatic storage option the containers belonging to USERSPACE1 and TEMPSPACE1 table spaces are spanned on all partitions. No matter what storage option we choose, the SYSCATSPACE catalog table space represents an exemption from this rule. The containers of SYSCATSPACE table space are placed only on the partition where the CREATE DATABASE command was executed. The partition which hosts the SYSCATSPACE table space is named the catalog partition. In our case, the catalog partition has been created on partition 0.

There's more...

The database can be created from any partition within the configuration. To set the current node you should use the DB2NODE environment variable. A more detailed coverage about using this variable can be found in Removing database partitions recipe in this chapter.

Within multipartitioned databases all table spaces are organized inside database partition groups. This subject will be covered in the Creating database partition groups recipe in this chapters.

主站蜘蛛池模板: 上杭县| 子长县| 蓝山县| 太康县| 建平县| 湘乡市| 阳春市| 乡宁县| 淅川县| 金塔县| 靖边县| 南开区| 安图县| 弋阳县| 昌图县| 武邑县| 昭通市| 确山县| 泉州市| 潼关县| 遵义县| 类乌齐县| 平定县| 哈密市| 中卫市| 浦江县| 讷河市| 额尔古纳市| 沁水县| 韩城市| 卢氏县| 乡宁县| 霍州市| 洛宁县| 临沭县| 临猗县| 高州市| 镇坪县| 梅河口市| 青神县| 中超|