- 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.
- Unity Virtual Reality Projects
- Python神經(jīng)網(wǎng)絡(luò)項目實戰(zhàn)
- C語言從入門到精通(第4版)
- The Data Visualization Workshop
- C語言程序設(shè)計上機(jī)指導(dǎo)與習(xí)題解答(第2版)
- Qt5 C++ GUI Programming Cookbook
- iOS開發(fā)項目化入門教程
- 一步一步學(xué)Spring Boot:微服務(wù)項目實戰(zhàn)(第2版)
- Java程序設(shè)計及應(yīng)用開發(fā)
- C#網(wǎng)絡(luò)編程高級篇之網(wǎng)頁游戲輔助程序設(shè)計
- Learning Apache Thrift
- LiveCode Mobile Development Hotshot
- Scratch 3.0少兒積木式編程(6~10歲)
- Learning Ext JS(Fourth Edition)
- 測試基地實訓(xùn)指導(dǎo)