Tweets & ReTweets

Association

DB2 Enterprise Unistall and Install for Linux Server

Written By Scooter-google on Senin, 14 April 2008 | 23.12

Uninstall DB2 for Linux

Pertama yang dilakukan adalah Login user sebagai admin sebagai contoh user db2ancur

1. Login user admin db2.
2. Jalankan db2, dengan perintah ( dari konsol db2) : db2 => db2start
3. Sebelum melakukan uninstalasi DB2 V.7.2, terlebih dahulu kita harus menghapus semua database yang terinstall. Untuk mengetahui database yang terinstall, ketikkan pada konsol db2:

db2 => list database directory

Maka akan ditampilkan database yang terinstall. Misalnya pada saat proses uninstall ini, database yang aktif adalah :

DBANCUR,
DWCNTRL,
SAMPLE.


4. Hapus / drop database yang ada dengan mengetikkan pada konsol db2, perintah:

db2 => drop database DB*****
db2 => drop database DWCNTRL
db2 => drop database SAMPLE


5. Stop db2, dengan perintah ( dari konsol db2) : db2 => db2stop
6. Keluar dari konsol db2, dengan perintah ( dari konsol db2) : db2 => quit
7. Uninstalasi db2 dilakukan melalui perintah “db2idrop”. Untuk menemukan lokasi file db2idrop ini, ketikkan : “locate db2idrop” atau “whereis db2idrop”.
Pada proses ini, file “db2idrop” ada di “usr/IBMdb2/V 7.1/instance”.
8. Pindah ke directory tersebut, dengan perintah : “cd /usr/ IBMdb2/V 7.1/instance”.
9. Jalankan perintah “db2idrop” dengan mengetikkan (dari directory : /usr/ IBMdb2/V 7.1/instance) : “./db2idrop –f db2admin”.
10. Hapus service name yang ada, dengan perintah : “./db2idrop –f db2cdb2admin”
11. Setelah selesai db2idrop, restart komputer dengan mengetikkan perintah : “shutdown –r now” (harus login sebagai root)
12. Masukkan CD Master db2 yang akan di uninstalasi (dalam hal ini db2 V 7.2) ke CD ROM yang sebelumnya telah di “mount” (klik kanan pada ikon CDROM, kemudian klik Mount).
13. Masuk ke konsol Linux, pindah ke CDROM, dengan mengetikkan perintah : “cd /mnt/cdrom
14. Cari lokasi file db2_deinstall dengan perintah locate (dalam hal ini, file tersebut ada di Media/DB2_Install).
15. Pindah ke folder tersebut, dengan perintah : “cd /Media/DB2_Install”.
16. Uninstall db2 yang ada dari folder tersebut (dalam hal ini ada di [root@BACKUPSERVER DB2_Install] ), dengan mengetikkan perintah : “./db2_deinstall –n”
17. Jika proses telah selesai, keluarkan CD Master tersebut (klik kanan ikon CDROM, pilih unmount,kemudian eject CDROM)
18. Setelah selesai uninstalasi, restart komputer dengan mengetikkan perintah : “shutdown –r now” (harus login sebagai root).
19. Setelah restart, masukkan CD Master yang akan di-install (dalam hal ini DB2 V. 7.1 Enterprise (jangan lupa untuk mount CDROM).
20. Dari konsol Linux, pindah ke folder CDROM, dengan mengetikkan: “cd /mnt/cdrom”.
21. Cari / locate file db2setup.
22. Dari folder lokasi file db2setup, ketikkan “./db2setup”.
23. Pada monitor akan tampil layar dialog dari setup db2. Pada layar dialog ini, hanya digunakan tombol-tombol pada keyboard, sedangkan tombol mouse tidak berlaku.
24. Pertama kali, layar dialog akan menampilkan pesan peringatan bahwa dengan menginstalasi db2 ini, maka akan merubah registry yang telah ada. Pilih tombol “Cancel” untuk tidak merubah registry yang ada, dan pilih tombol “OK” untuk merubah registry yang ada (re-create registry).
Untuk menjamin kesuksesan instalasi, sebaiknya dipilih tombol “OK”, agar registry yang ada benar-benar di create ulang.
25. Setelah itu, pilih customize dari “DB2 Administration Client”.
26. Kemudian, pilih “[ ] Java Support” dan “[ ] Control Center” (dengan menggunakan tombol spacebar).
27. Masuk ke “DB2 UDB Enterprise – Extended Edition”,pilih customize, kemudian “Select All”.
28. Masuk ke “DB2 Aplication Development Client”, pilih customize, kemudian “Select All”.
29. Masuk ke “DB2 Product Message”, pilih customize. Dialog ini digunakan untuk memilih bahasa untuk Product Message. Jika diinginkan untuk menginstalasi semua bahasa yang telah ada, pilih “Select All”
30. Masuk ke “DB2 Product Library (HTML)”, Pilih (melalui customize), bahasa yang ingin di-install.
31. Masuk ke “Control Center Help (HTML)”, Pilih (melalui customize), bahasa yang ingin di-install.
32. Setelah tekan “OK”, Pilih “[ ] Create a DB2 Instance” (dengan spacebar). Melalui pilihan ini, kita diberikan pilihan untuk meng-edit User Name, Group Name, dan Home Directory. Adapun default User Name dari DB2 adalah “db2inst1”. Pada proses instalasi ini, ditetapkan bahwa:
User Name : db2ancur
Group Name : db2ancur
Home Directory : /home/db2ancur
(Catatan: Harus diperhatikan bahwa sebelum instalasi dijalankan, user “db2admin” dan group “db2admin” ini sebelumnya telah ada pada user list Linux. Jika belum ada, user dan group tersebut harus di create dulu melalui “userconf”.
33. Kemudian Pilih “Properties”.
34. Pilih “Server”.
35. Pilih “TCP / IP Detect”, kemudian “Properties”.
36. Pada pilihan ini, akan ditampilkan Services Name, Port Number, dan Port Number (FCM). Pada proses instalasi ini, Services Name diganti dengan “db2cdb2admin”. Sedangkan untuk Port Number dan Port Number (FCM) tidak diganti (sesuai default).
37. Setelah itu, pilih “ [ü] Auto Start DB2 Instance at system bott” dan pilih “ [ü] Create a sample database for db2 instance”
38. Pilih “OK”, maka akan kembali ke layar dialog sebelumnya.
39. Kemudian akan tampil:
User Name : db2fenc1
User ID : 502
Group Name : db2fenc1
Group ID :
Pada instalasi ini, dialog ini tidak dirubah (dibiarkan sesuai default)
40. Pilih “ [ ] Setup DB2 Warehouse Control Database”
41. Pada dialog “Control Database”, pastikan control databasenya adalah “dwcntrl”.
42. Pilih “ Setup DB2 …………………. join for DB2 Data Source”
43. Setelah itu, akan kembali ke layar dialog sebelumnya.
44. Kemudian pilih “ [ ] Create a DB2 Administration Server”.
45. Pilih “ [ ] Use Default UID”
46. Pilih “ [ ] Use Default GID”, kemudian “OK”.
47. Sebagai proses terakhir, akan tampil list dari setting instalasi yang telah kita tentukan sebelumnya. Tekan “Cancel” untuk membatalkan atau “Continue” untuk melanjutkan.
48. DB2 akan melakukan instalasi sesuai dengan setting yang telah kita tentukan.
49. Setelah instalasi selesai, DB2 akan menampilkan report dari proses instalasi.
50. Restart komputer dengan mengetikkan perintah : “shutdown –r now” (harus login sebagai root).
51. Masuk ke db2 (dari konsol Linux). Secara default, jika kita memberikan perintah db2 => list database directory , maka db2 akan menampilkan database yang telah terbentuk pada saat proses instalasi, dimana pada proses instalasi ini, database yang terbentuk adalah : DWCNTRL dan SAMPLE
52. Untuk membentuk database baru, dapat dilakukan melalui Control Center DB2 pada NT Server, atau dapat langsung dari konsol dialog db2, dengan perintah (pada instalasi ini, akan dibentuk database DB*****):

db2 => CREATE DATABASE DB****** ON /home/db2ancur ALIAS DB***** USING CODESET IBM-1252 TERRITORY US COLLATE USING SYSTEM WITH "DB Host Banking ******
53. Setelah database berhasil dibentuk, dapat dilakukan proses restore database yang dinginkan.

23.12 | 0 comments | Read More

Create Instance Database DB2 Enterprise ver 7.2 on Linux

Dengan berkembangnya database yang ada tidak dapat dapat dipungkiri bahwa dikemudian hari akan memiliki lebih dari satu database untuk keperluan pengembangan beberapa product yang akan datang, dari ilustrasi sebelumnya muncul pertanyaan apakah kita harus membeli server lagi untuk database baru?.
Jawabanya adalah tidak selalu harus membeli server baru, kita bisa saja membuat dua atau lebih database dalam satu server yang dapat berdiri sendiri atau dengan kata lain seperti memiliki dua database dengan server yang berbeda. Dalam DB2 Enterprise Edition solusi ini bisa dilakukan dengan cara membuat multiple database instance, dimana secara administrative satu database Instance akan mengelola dan mengatur satu atau sekelompok database yang independent dan tidak terpengaruh oleh administrative database Instance lainnya.

Dalam kasus ini, kita akan menempatkan instance pada server database yang sudah memiliki satu database.

1. Login Root

2. Create group db2bilal [yang akan digunakan sebagai instance baru]
#groupadd –g 110 db2bilal
3. Create user db2bilal
#useradd –u 150 –p password –m –d /home/db2bilal –g db2bilal -s /bin/bash –r -c

Adapun fungsi-fungsi diatas :
a. -g adalah agar user db2bilal dapat langsung berada didalam group db2bilal
b. -u untuk menentukan user id pada linux
c. -p untuk memberikan password untuk user db2bilal

4. Create group db2fenc2
#groupadd –g 120 db2fenc2

5. Create user db2fenc2
#useradd –u 150 –p password –m –d /home/db2fenc2 –g db2fenc2 -s /bin/bash –r –c

6. Create instance dan port
#/usr/IBMdb2/V7.1/instance/./db2icrt –a SERVER –p 50010 –s ee –u db2fenc2 db2bilal


Adapun fungsi diatas :
-a tipe auttentikasi user(SERVER, CLIENT, or SERVER ENCRYPT) untuk create instance
-p port name / port yang akan kita tentukan
-fenc[id] Nama yang terdapat dalam server

Adalah Instance type apakah (ee ese arau client)
ee : Enterprise Editions
ese : Enterprise Server Editions

7. Login db2bilal

8. Create database
# db2 “create database DATBILAL using codeset IBM-1252 territory US”

9. Restore database
#db2 “restore database DATBILAL from /home/db2bilal/…

10. Lakukan test connect database dengan Client Configurations Assinstant (CCA)

11. Jika urutan di atas telah dilakukan dan berhasil tanpa mengalami error, maka tahap selanjutnya adalah test masuk ke DB2 dan create database

12. Masuk kedalam db2bilal
# su – db2bilal
password : ********

13. Selanjutnya masuk ke dalam DB2
# db2

jika masuk ke dalam DB2, maka create instance berhasil

kita dapat mengurangi langkah diatas bila saja CD dari DB2 ada kita tinggal menjalankan

#./db2setup


Pilih menu instalasi untuk Create Instance
Selamat mencoba semoga dapat bermanfaat...

Untuk informasi lebih lengkap dapat dilihat disini
20.53 | 0 comments | Read More

Manage Kernel for DB2

Written By Scooter-google on Jumat, 04 April 2008 | 21.18

Before installing a DB2 database system, we should update your Linux kernel parameters. The default values for particular kernel parameters on Linux are not sufficient when running a DB2 database system. DB2 automatically raises the IPC limits where necessary based on the needs of the DB2 database system. However, it may be more practical to set the limits permanently on your Linux system if you have products or applications other than a DB2 database system.

Red Hat and SUSE Linux

The following information can be used to determine if there are any necessary changes required for your system.

The following is the output from the ipcs -l command. Comments have been added following the to show what the parameter names are.


    # ipcs -l

    ------ Shared Memory Limits --------
    max number of segments = 4096 // SHMMNI
    max seg size (kbytes) = 32768 // SHMMAX
    max total shared memory (kbytes) = 8388608 // SHMALL
    min seg size (bytes) = 1

    ------ Semaphore Limits --------
    max number of arrays = 1024 // SEMMNI
    max semaphores per array = 250 // SEMMSL
    max semaphores system wide = 256000 // SEMMNS
    max ops per semop call = 32 // SEMOPM
    semaphore max value = 32767

    ------ Messages: Limits --------
    max queues system wide = 1024 // MSGMNI
    max size of message (bytes) = 65536 // MSGMAX
    default max size of queue (bytes) = 65536 // MSGMNB



Beginning with the first section on Shared Memory Limits, SHMMAX and SHMALL are the parameters that need to be looked at. SHMMAX is the maximum size of a shared memory segment on a Linux system whereas SHMALL is the maximum allocation of shared memory pages on a system.

For SHMMAX, the minimum required on x86 systems would be 268435456 (256 MB) and for 64-bit systems, it would be 1073741824 (1 GB).

SHMALL is set to 8 GB by default (8388608 KB = 8 GB). If you have more physical memory than this, and it is to be used for DB2, then this parameter should be increased to approximately 90% of the physical memory as specified for your computer. For instance, if you have a computer system with 16 GB of memory to be used primarily for DB2, then 90% of 16 GB is 14.4 GB divided by 4 KB (the base page size) is 3774873. The ipcs output has converted SHMALL into kilobytes. The kernel requires this value as a number of pages.

The next section covers the amount of semaphores available to the operating system. The kernel parameter sem consists of 4 tokens, SEMMSL, SEMMNS, SEMOPM and SEMMNI. SEMMNS is the result of SEMMSL multiplied by SEMMNI. The database manager requires that the number of arrays (SEMMNI) be increased as necessary. Typically, SEMMNI should be twice the maximum number of connections allowed (MAXAGENTS) multiplied by the number of logical partitions on the database server computer plus the number of local application connections on the database server computer.

The third section covers messages on the system.

MSGMNI affects the number of agents that can be started, MSGMAX affects the size of the message that can be sent in a queue, and MSGMNB affects the size of the queue.

MSGMAX should be change to 64 KB (that is, 65535 bytes), and MSGMNB should be increased to 65535 on Server systems.

To modify these kernel parameters, we need to edit the /etc/sysctl.conf file. If this file does not exist, it should be created. The following lines are examples of what should be placed into the file:


    kernel.sem=250 256000 32 1024
    #Example shmmax for a 64-bit system
    kernel.shmmax=1073741824
    #Example shmall for 90 percent of 16 GB memory
    kernel.shmall=3774873
    kernel.msgmax=65535
    kernel.msgmnb=65535


Run sysctl with -p parameter to load in sysctl settings from the default file /etc/sysctl.conf.

    sysctl -p


To make the changes effective after every reboot, boot.sysctl needs to be active on SUSE Linux. On Red Hat, the rc.sysinit initialization script will read the /etc/sysctl.conf file automatically.

many information you can get about DB2 from this
21.18 | 0 comments | Read More