| At line 1 changed 49 lines |
| !!INSTALLAZIONE DB2 |
| #tar -xzvf db2XXXXX.tar.gz (XXX dipende dalla versione db2 che vuoi installare...ad esempio db2exc_950_LNX_x86.tar.gz) |
| #lanciare db2_install (./db2_install) |
| #al prompt eseguire DB2.EXP o EXP (non cambiare percorso di installazione che propone e attendere fine installazione)\\in caso di dipendenze sulle librerie installare quanto richiesto (dipende dalla distribuzione/versione di linux ma in genere è necessario libaio1 e libstdc++5) |
| #eseguire i seguenti comandi\\ |
| groupadd -g 999 db2adm\\ |
| groupadd -g 998 db2udf\\ |
| groupadd -g 997 TUONOMEISTANZADB2\\ |
| useradd -u 1004 -g db2adm -m -d /home/db2adm db2adm\\ |
| useradd -u 1003 -g db2udf -m -d /home/db2udf db2udf\\ |
| useradd -u 1002 -g TUONOMEISTANZADB2 -m -d /home/TUONOMEISTANZADB2 TUONOMEISTANZADB2\\ |
| \\ |
| passwd db2adm (settando la tua PASSWORD)\\ |
| passwd db2udf (settando la tua PASSWORD)\\ |
| passwd TUONOMEISTANZADB2 (settando la tua PASSWORD)\\ |
| \\ |
| in base alla tua versione... (VX_Y)\\ |
| /opt/ibm/db2/VX.Y/instance/dascrt -u db2adm\\ |
| /opt/ibm/db2/VX_Y/instance/db2icrt -a server -u db2udf TUONOMEISTANZADB2\\ |
| /opt/ibm/db2/VX_Y/cfg/db2ln\\ |
| . /home/TUONOMEISTANZADB2/sqllib/db2profile\\ |
| \\ |
| su - TUONOMEISTANZADB2 (se non ti fa fare come root i seguenti)\\ |
| %%prettyif |
| {{{ |
| db2set DB2COMM=tcpip |
| db2licm -a 'path_dove_ho_fatto_il_tar'/exp/db2/license/db2expc_uw.lic |
| exit |
| }}} |
| Assegno il gruppo root come membro di TUONOMEISTANZADB2(faccio girare db2 come utente root)\\ |
| \\ |
| vi /etc/group\\ |
| TUONOMEISTANZADB2:x:997:root\\ |
| -------------------------------------------------------------\\ |
| db2start\\ |
| db2stop\\ |
| db2 update dbm cfg using svcename 50000\\ |
| db2start\\ |
| \\ |
| (usare db2set -all per vedere quelle già esistenti)\\ |
| db2set DB2COMM=tcpip\\ |
| db2set DB2AUTOSTART=yes\\ |
| \\ |
| --------------------------------------------------------------\\ |
| A livello generale vi /etc/profiles\\ |
| \\ |
| aggiungere\\ |
| \\ |
| . /home/TUONOMEISTANZADB2/sqllib/db2profile\\ |
| [Installazione|db2installazione]\\ |
| [Backup multi-database e esportazione DDL|db2backup]\\ |
| [Backup singolo database e Restore|db2restore]\\ |
| [Indici e auto_runstats] |
| At line 51 removed 50 lines |
| Per approfondimenti [http://www.linux.org/docs/ldp/howto/DB2-HOWTO/] |
| ---- |
| ! DB2 EXPRESS RESTRICTION |
| What are the restrictions for DB2 Express-C? \\ |
| The following restrictions apply:\\ |
| DB2 Express-C Version 9.5, Fixed Term License (FTL):\\ |
| Two processor cores with a total of maximum of four cores \\ |
| No more than 4 GB of memory \\ |
| DB2 Express-C Version 9.5 (no charge, non-warranted):\\ |
| Up to two processor cores \\ |
| No more than 2 GB of memory \\ |
| [http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.licensing.doc/doc/r0053243.html] |
|
| ! PROBLEMA ALLOCAZIONE SHARED MEMORY |
|
| Non so se in relazione alle restrizioni sopra succede che il db2, in fase di connessione ad uno o più db risponda:\\ |
| SQL1084C Shared memory segments cannot be allocated. SQLSTATE=57019\\ |
| \\ |
| Nel log del db2 dice:\\ |
| MESSAGE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG |
| "No Storage Available for allocation" |
| DIA8305C Memory allocation failure occurred. |
| DATA #1 : <preformatted> |
| Unable to attach 10 segments totalling 2521759744 bytes starting at address |
| 0x00000000. One possible cause may be an improper setting for the |
| shmmax Linux kernel tuneable. |
| \\ \\ |
| Leggendo su internet ho provato a cambiare la shmmax (per ubuntu) |
| %%prettyif |
| {{{ |
| #così vedi la shmmax allocata dal sistema operativo |
| vi /proc/sys/kernel/shmmax |
|
| #provare a modificare tale impostazione in questo modo |
| vi /etc/sysctl.conf |
| #e aggiungere in fondo |
| kernel.shmmax = 4153352000 |
|
| #Per applicare la modifica senza fare il reboot della macchina |
| sysctl -p /etc/sysctl.conf |
|
| #riverificare se è cambiato il valore shmmax rieseguendo il primo comando |
| }}} |
|
| NOTA:\\ |
| Il valore da impostare per shmmax è da stabilire...metà della ram disponibile???\\ |
| Dopo tale modifica non so per quanto il tutto possa funzionare\\ |
| Per approfondimenti:\\ |
| [http://www.ibm.com/developerworks/db2/library/techarticle/dm-0406qi/]\\ |
| [http://www.linuxforums.org/forum/redhat-fedora-linux-help/17025-how-can-i-change-shmmax.html]\\[http://listserv.sap.com/pipermail/linux.general/2005-January/004484.html]\\ |