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

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.

主站蜘蛛池模板: 新源县| 鄂托克前旗| 伽师县| 潞西市| 都兰县| 四川省| 崇礼县| 富宁县| 绥化市| 岑巩县| 法库县| 景洪市| 潜山县| 曲周县| 阜新市| 汤阴县| 博野县| 南阳市| 易门县| 瓦房店市| 昭觉县| 宁陕县| 德保县| 洛宁县| 哈巴河县| 莒南县| 塔城市| 乌恰县| 曲水县| 刚察县| 府谷县| 万源市| 苍溪县| 兰溪市| 准格尔旗| 宜丰县| 德钦县| 奉贤区| 西藏| 浪卡子县| 简阳市|