Db2 インスタンスの作成/起動

ユーザを作成する

  • インスタンスユーザ: インスタンスを管理する
  • 分離ユーザ (Fence User): ストアドプロシージャとユーザ定義関数を実行する
[root@localhost ~]# adduser myinst
[root@localhost ~]# adduser myfenc

ポートを確認する

使用されていないポート番号を確認する。

[root@localhost instance]# cat /etc/services

インスタンスを作成する

[root@localhost instance]# cd /opt/ibm/db2/V11.5/instance
[root@localhost instance]# ./db2icrt -p 50010 -u myfenc myinst
DBI1446I  The db2icrt command is running.


DB2 installation is being initialized.

 Total number of tasks to be performed: 4 
Total estimated time for all tasks to be performed: 309 second(s) 

Task #1 start
Description: Setting default global profile registry variables 
Estimated time 1 second(s) 
Task #1 end 

Task #2 start
Description: Initializing instance list 
Estimated time 5 second(s) 
Task #2 end 

Task #3 start
Description: Configuring DB2 instances 
Estimated time 300 second(s) 
Task #3 end 

Task #4 start
Description: Updating global profile registry 
Estimated time 3 second(s) 
Task #4 end 

The execution completed successfully.

For more information see the DB2 installation log at "/tmp/db2icrt.log.334967".
DBI1070I  Program db2icrt completed successfully.

作成したインスタンスユーザに切り替える

[root@localhost instance]# su - myinst
Last login: Wed Sep  4 17:25:14 JST 2024 on pts/0

インスタンスを起動する

[myinst@localhost ~]$ db2start
09/04/2024 17:25:33     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.