- IBM DB2 9.7 Advanced Administration Cookbook
- Adrian Neagu Robert Pelletier
- 387字
- 2021-08-20 15:33:22
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...
- Navigate to the
/db2partinst/db2instp/sqllib
directory. Here, opendb2nodes.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.
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.
- Learning Single:page Web Application Development
- 大學計算機基礎(第二版)
- Learning C# by Developing Games with Unity 2020
- Docker進階與實戰
- 編程卓越之道(卷3):軟件工程化
- Yocto for Raspberry Pi
- BeagleBone Black Cookbook
- Unity 2018 Shaders and Effects Cookbook
- Learning Material Design
- Citrix XenServer企業運維實戰
- ExtJS Web應用程序開發指南第2版
- PHP 7從零基礎到項目實戰
- Drupal 8 Development Cookbook(Second Edition)
- 例解Python:Python編程快速入門踐行指南
- 零基礎學Java(第5版)