Working with instances, databases, and configuration Using DB2

Posted: Tuesday,October 28, 2008 in Kuliah
Tags: , , ,

1. Buka DB2 Command Window

Start -> Run -> db2cmd

2. Tambah Instance dengan nama newinst [ harus admin ]

db2icrt newinst

3. Pada new instance newinst, buatlah database newdb

set db2instance=newinst //ubah instance yg aktif

db2start

db2 create database newdb

4. Untuk mengetahui list instance

db2ilist

5. Ubah DB2 instance ke ‘DB2’

set db2instance=db2

db2 get instance //Buat liat instance yg aktif

6. Ubah konfigurasi pada dbm cfg paramater FEDERATED dari NO menjadi YES

db2 update dbm cfg using FEDERATED YES //update konfigurasi
db2 force applications all //putusin semua koneksi yg lagi terhubung
db2 terminate //putuskan koneksi ke sample (contoh database yg lagi aktif)

//buat restart instance nya
db2stop
db2start
db2 get dbm cfg //konfigurasi di tingkat instance

7. Connect ke database sample. Ada 3 cara :
db2 connect to sample //pake user yang lagi aktif
db2 connect to sample user prk //jika pakai user lain(nanti diminta pwdnya)
db2 connect to sample user prk using prk //jika pakai user lain(ga diminta pwdnya)

8. Melihat koneksi-koneksi/aplikasi yg terhubung pada instance current.

db2 list applications

9. Buka DB2 Command Window baru dan connect to sample. Kemudian lihat berapa banyak koneksi yang ada sekarang.

db2 connect to sample
db2 list applications

10. Menutup salah satu DB2 Command Window

db2 force application (application_handle) // contoh : db2 force application (63)

//nomor application_handle ini didapat dari : db2 list applications

11. Drop the instance newinst

set db2instance=newinst
db2stop
db2idrop newinst
set db2instance=db2

12. Drop and recreate the DAS (DB2 Administration Server), and start it

db2admin stop
db2admin drop
db2admin create
db2admin start

13. Ubah DB2 registry variable DB2COMM to tcpip and npipe

db2set db2comm=tcpip,npipe
db2stop
db2start

14. Unset the DB2COMM registry variable

db2set db2comm=
db2stop
db2start
15. Ubah konfigurasi tingkat database pada LOGSECOND db cfg parameter. Ubah menjadi 5.

db2 connect to sample
db2 get db cfg
db2 update db cfg using LOGSECOND 5
db2 get db cfg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s