CADSのレポジトリDB作成 on Windows Server

CADSのレポジトリDBを作成します。

# DB2のレポジトリDBの作成

db2adminでWindowsにログインします。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/223763/931f8d77-2244-38f9-9793-607c1df6a673.png)


DB2 Command Windowを起動します。
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/223763/02772399-50b8-11c3-5a95-301026a57011.png)

db2 -tv
でCLPを開始します。

マニュアルに載っているDDLで、CADSのレポジトリ用のDBを作成します。
CREATE DATABASE SPSSCDS ON <パス>
に空き容量のあるパスを指定します。例では「e:」に作っています。

```db2
CREATE DATABASE SPSSCDS ON e: USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM;
CONNECT TO SPSSCDS;
CREATE Bufferpool CDS8K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 8 K;
CREATE REGULAR TABLESPACE CDS8K PAGESIZE 8 K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 8
OVERHEAD 10.5 PREFETCHSIZE 8 TRANSFERRATE 0.14 BUFFERPOOL CDS8K DROPPED TABLE RECOVERY ON;
COMMENT ON TABLESPACE CDS8K IS '';
CREATE Bufferpool CDSTEMP IMMEDIATE SIZE 250 PAGESIZE 32 K;
CREATE SYSTEM TEMPORARY TABLESPACE CDSTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE
EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL "CDSTEMP";
COMMENT ON TABLESPACE CDSTEMP IS '';
CONNECT RESET;
```

```:結果
C:\Program Files\IBM\SQLLIB\BIN>db2 -tv
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 11.5.7.0

You can issue database manager commands and SQL statements from the command
prompt. For example:
    db2 => connect to sample
    db2 => bind sample.bnd

For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
 ? CATALOG DATABASE for help on the CATALOG DATABASE command
 ? CATALOG          for help on all of the CATALOG commands.

To exit db2 interactive mode, type QUIT at the command prompt. Outside
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.

For more detailed help, refer to the Online Reference Manual.

db2 => CREATE DATABASE SPSSCDS ON e: USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM;
CREATE DATABASE SPSSCDS ON e: USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM
DB20000I  The CREATE DATABASE command completed successfully.

db2 => CONNECT TO SPSSCDS;
CONNECT TO SPSSCDS

   Database Connection Information

 Database server        = DB2/NT64 11.5.7.0
 SQL authorization ID   = DB2ADMIN
 Local database alias   = SPSSCDS


db2 => CREATE Bufferpool CDS8K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 8 K;
CREATE Bufferpool CDS8K IMMEDIATE SIZE 250 AUTOMATIC PAGESIZE 8 K
DB20000I  The SQL command completed successfully.

db2 => CREATE REGULAR TABLESPACE CDS8K PAGESIZE 8 K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 8
db2 (cont.) => OVERHEAD 10.5 PREFETCHSIZE 8 TRANSFERRATE 0.14 BUFFERPOOL CDS8K DROPPED TABLE RECOVERY ON;
CREATE REGULAR TABLESPACE CDS8K PAGESIZE 8 K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 8 OVERHEAD 10.5 PREFETCHSIZE 8 TRANSFERRATE 0.14 BUFFERPOOL CDS8K DROPPED TABLE RECOVERY ON
DB20000I  The SQL command completed successfully.

db2 => COMMENT ON TABLESPACE CDS8K IS '';
COMMENT ON TABLESPACE CDS8K IS ''
DB20000I  The SQL command completed successfully.

db2 => CREATE Bufferpool CDSTEMP IMMEDIATE SIZE 250 PAGESIZE 32 K;
CREATE Bufferpool CDSTEMP IMMEDIATE SIZE 250 PAGESIZE 32 K
DB20000I  The SQL command completed successfully.

db2 => CREATE SYSTEM TEMPORARY TABLESPACE CDSTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE
db2 (cont.) => EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL "CDSTEMP";
CREATE SYSTEM TEMPORARY TABLESPACE CDSTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE EXTENTSIZE 16 OVERHEAD 10.5 PREFETCHSIZE 16 TRANSFERRATE 0.14 BUFFERPOOL "CDSTEMP"
DB20000I  The SQL command completed successfully.

db2 => COMMENT ON TABLESPACE CDSTEMP IS '';
COMMENT ON TABLESPACE CDSTEMP IS ''
DB20000I  The SQL command completed successfully.

db2 => CONNECT RESET;
CONNECT RESET
DB20000I  The SQL command completed successfully.

db2 => terminate;
terminate
DB20000I  The TERMINATE command completed successfully.


C:\Program Files\IBM\SQLLIB\BIN>
```

# 環境
* Windows Server 2019
* CADS 8.4
* Db2 9.5

# 参考

Db2 - IBM Documentation 

https://www.ibm.com/docs/ja/sc-and-ds/8.4.0?topic=database-db2