IBM Maximo: Criando a database manualmente para o Maximo

From Wiki
Revision as of 12:53, 10 August 2021 by Ebasso (talk | contribs) (→‎Criando a instância do DB2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Criando a database do Maximo

Criando os usuários de Administração

groupadd -g 500 ctggrp1
groupadd -g 501 ctgfgrp1
groupadd -g 502 maximo

mkdir -p /opt/DB2HOME

useradd -u 500 -m --system -g ctggrp1 -d /opt/DB2HOME/ctginst1 ctginst1
useradd -u 501 -m --system -g ctgfgrp1 -d /opt/DB2HOME/ctgfenc1 ctgfenc1
useradd -u 502 -m --system -g maximo -d /opt/DB2HOME/maximo maximo

MY_PASSWORD=passw0rd
echo "ctginst1:$MY_PASSWORD" | chpasswd
echo "ctgfenc1:$MY_PASSWORD" | chpasswd
echo "maximo:$MY_PASSWORD" | chpasswd

Criando a instância do DB2

# /opt/ibm/db2/V11.5/instance/db2icrt -s ese -u ctgfenc1 -p 50005 ctginst1

Vericando as portas configuradas no arquivo /etc/services do Linux.

# cat /etc/services 
... 
DB2_ctginst1    60000/tcp
DB2_ctginst1_1  60001/tcp
DB2_ctginst1_2  60002/tcp
DB2_ctginst1_3  60003/tcp
DB2_ctginst1_4  60004/tcp
DB2_ctginst1_END        60005/tcp
db2c_ctginst1   50005/tcp

Criando a database DB2

Configurando a instância

su - ctginst1

mkdir -p /opt/DB2HOME/ctginst1/DATADIR

db2start
db2 update dbm config using SVCENAME 50005 DEFERRED
db2stop
db2set DB2COMM=tcpip
db2start

Criando a database

$ db2 CREATE DB maxdb76 ON /opt/DB2HOME/ctginst1/DATADIR USING codeset UTF-8 territory US pagesize 32 K

DB20000I  The CREATE DATABASE command completed successfully.

Configurando a database

db2 UPDATE DB CFG FOR maxdb76 USING SELF_TUNING_MEM ON
db2 UPDATE DB CFG FOR maxdb76 USING APPGROUP_MEM_SZ 16384 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING APPLHEAPSZ 2048 AUTOMATIC DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_MAINT ON DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_TBL_MAINT ON DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_RUNSTATS ON DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_REORG ON DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_DB_BACKUP ON DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING CATALOGCACHE_SZ 800 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING CHNGPGS_THRESH 40 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING DBHEAP AUTOMATIC
db2 UPDATE DB CFG FOR maxdb76 USING LOCKLIST AUTOMATIC DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING LOGBUFSZ 1024 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING LOCKTIMEOUT 300 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING LOGPRIMARY 20 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING LOGSECOND 100 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING LOGFILSIZ 8192 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING SOFTMAX 1000 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING MAXFILOP 61440 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING PCKCACHESZ AUTOMATIC DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING STAT_HEAP_SZ AUTOMATIC DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING STMTHEAP 20000 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING UTIL_HEAP_SZ 10000 DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING DATABASE_MEMORY AUTOMATIC DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_STMT_STATS OFF DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING STMT_CONC LITERALS DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING DFT_QUERYOPT 5
db2 UPDATE DB CFG FOR maxdb76 USING NUM_IOCLEANERS AUTOMATIC
db2 UPDATE DB CFG FOR maxdb76 USING NUM_IOSERVERS AUTOMATIC
db2 UPDATE DB CFG FOR maxdb76 USING CUR_COMMIT ON
db2 UPDATE DB CFG FOR maxdb76 USING AUTO_REVAL DEFERRED
db2 UPDATE DB CFG FOR maxdb76 USING DEC_TO_CHAR_FMT NEW
db2 UPDATE DB CFG FOR maxdb76 USING REC_HIS_RETENTN 30
db2 UPDATE ALERT CFG FOR DATABASE ON maxdb76 USING db.db_backup_req SET THRESHOLDSCHECKED YES
db2 UPDATE ALERT CFG FOR DATABASE ON maxdb76 USING db.tb_reorg_req SET THRESHOLDSCHECKED YES
db2 UPDATE ALERT CFG FOR DATABASE ON maxdb76 USING db.tb_runstats_req SET THRESHOLDSCHECKED YES
db2 UPDATE DBM CFG USING PRIV_MEM_THRESH 32767 DEFERRED
db2 UPDATE DBM CFG USING KEEPFENCED NO DEFERRED
db2 UPDATE DBM CFG USING NUMDB 2 DEFERRED
db2 UPDATE DBM CFG USING RQRIOBLK 65535 DEFERRED
db2 UPDATE DBM CFG USING HEALTH_MON OFF DEFERRED
db2 UPDATE DBM CFG USING AGENT_STACK_SZ 1024 DEFERRED
db2 UPDATE DBM CFG USING MON_HEAP_SZ AUTOMATIC DEFERRED
db2 UPDATE DBM CFG USING diagsize 512
db2set DB2_SKIPINSERTED=ON
db2set DB2_INLIST_TO_NLJN=YES
db2set DB2_MINIMIZE_LISTPREFETCH=YES
db2set DB2_EVALUNCOMMITTED=YES
db2set DB2_FMP_COMM_HEAPSZ=65536
db2set DB2_SKIPDELETED=ON
db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON
db2stop force

Criando Tablespaces, Schemas e definindo permissões

db2start
db2 CONNECT TO maxdb76
db2 CREATE BUFFERPOOL MAXBUFPOOL IMMEDIATE SIZE 4096 AUTOMATIC PAGESIZE 32 K
db2 CREATE REGULAR TABLESPACE MAXDATA PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE INITIALSIZE 5000 M BUFFERPOOL MAXBUFPOOL
db2 CREATE TEMPORARY TABLESPACE MAXTEMP PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL MAXBUFPOOL
db2 CREATE REGULAR TABLESPACE MAXINDEX PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE INITIALSIZE 5000 M BUFFERPOOL MAXBUFPOOL
db2 GRANT USE OF TABLESPACE MAXDATA TO USER MAXIMO
db2 CREATE SCHEMA maximo AUTHORIZATION maximo
db2 GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA, LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE TO USER MAXIMO
db2 GRANT  CREATEIN,DROPIN,ALTERIN ON SCHEMA MAXIMO TO USER MAXIMO
db2 connect reset
db2stop force

Iniciando a database

db2start

Ver também