2011년 11월 30일 수요일

DB2 Data 테이블스페이스 생성 (Manual)



Overview

This creation and setup of a DB2 database assumes that the user installing Jazz has only DBADM authority over the database and that the database and its underlying tablespace storage has been created ahead of time by a sysadm user. It is assumed that the sysadm user will know what storage configurations make the most sense in their environment. The following configuration parameters and tablespace options are recomendations and are the settings are what are used during the fully automatic install.

The Jazz database consists of tables that contain fixed length strings, variable length strings up to 1000 bytes, integers, time stamps and blobs, of which the vast majority will be small but can be up to a 1 gig max in length. There are no stored procs or UDFs currently being used. We currently use two tablespaces, one of type LARGE holding most of the tables and indexes and the other of type User temporary for occasional temp tables. In general we have found that DMS storage with pre allocated file space has given us the best performance for Jazz on disk systems, but depending on the system this may not necessarily be the best.

https://jazz.net/wiki/bin/view/Main/ReducedDB2Privileges


Install Steps



  1. Create a database wilth 16k pages and code set UTF-8. The We generally recommend managing storage manually and pre-allocating disk space for the two Jazz tablespaces in DMS mode. We have found that generally gives the best performance on single disk systems. This may or may not be entirely applicable to your environment and you should setup the the tablespace for optimal performance rather than ease of use. The following are the database configuration parameters that we change in the fully automatic install:
    LOGPRIMARY 20
    LOGSECOND  20
    APP_CTL_HEAP_SZ  10000 -> APPL_MEMORY  AUTOMATIC (V9.5부터 자동처리됨)
    APPLHEAPSZ 10000
    BUFFPAGE  16384
    LOGFILSIZ 4096
    DBHEAP 8192   
    
    (설정방법 예) db2 update db cfg using logfilsiz 4096 dbheap 8192 ...
    
    
    
    * DB CFG PARAMETER; http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/nav/5_0_6
    db2 connect to db-name 
    db2 get db cfg show detail
    db2 update db cfg using parameter-name parameter-value
    db2 disconnect db-name 
    * DBM CFG PARAMETER; http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/nav/5_0_5
    db2 attach to instance-name
    db2 get dbm cfg show detail
    db2 update dbm cfg using parameter-name parameter-value
    db2 detach
    
    
    It should be noted that the APP_CTL_HEAP_SZ and APPLHEAPSZ settings are in response to problems that we encountered in various fixpacks with DB2 9.x See technote ##
  2. Create two tablespaces. The first is of type LARGE and will be used to hold the bulk of the Jazz data and a user temporary tablespace. The names of these two tablespace will have to be added to the teamserver.properties file in order to install the Jazz tables correctly by repotools application. As an example of how the LARGE tablespace might be set up here is how the fully automatic Jazz install creates the tablespace:
    CREATE LARGE TABLESPACE CONTENTTS MANAGED BY DATABASE USING (file '' 250000) 
    DROPPED TABLE RECOVERY OFF AUTORESIZE YES   
    
    Note that this is only an example and the LARGE tablespace should be created with settings appropriate to your environment. The second tablespace is a user temporary space. Below is how it is set up in the automatic mode install.
    CREATE USER TEMPORARY TABLESPACE JAZZTMPSPACE MANAGED BY DATABASE USING (file '' 2500) 
    AUTORESIZE YES   
    Note that for the automatic install Jazz uses database managed storage that are backed by a file. This has shown to give much better performance on small systems such as a Windows machine with a single disk. It may not be appropriate for you environment, so please adjust accordingly. Also note that even though in the automatic install case Jazz assumes that the database has automatic storage enabled, it is not required for the manual install.

  3. Create and/or grant a user DBADM authority over the database created in step 1 above. To be clear about what the jazz user needs to be able perform on the database created in step 1 is the following: to be able to create and drop tables, select/insert/delete and update those tables, run statistics on the tables and also to be able create a deadlock monitor for Jazz and have use of the user temporary tablespace created in step 2 above.
    GRANT DBADM ON DATABASE TO USER 
    GRANT USE OF TABLESPACE CONTENTTS TO USER 
    GRANT USE OF TABLESPACE JAZZTMPSPACE TO USER 
    
    
  4. The following parameters need to be added to the teamserver.properties file for a DB2 install before running repotools -createTables with the correct substitutions for the tablespace names and the user name. If no tablespace names are given, the install will use the default names, CONTENTTS and JAZZTMPSPACE.
    com.ibm.team.repository.db.db2.automatic.setup=false
    com.ibm.team.repository.db.vendor=DB2
    com.ibm.team.repository.db.db2.temp.tablespace.name=사용자임시테이블스페이스명
    com.ibm.team.repository.db.db2.data.tablespace.name=사용자데이터데이블스페이스명
    com.ibm.team.repository.db.jdbc.location=//localhost:50000/JAZZ:user=연결계정;password={password};
    
    
  5. Run
    repotools -createTables
    
    
    
  6. If desired, a db user without DBADM authority over the database can be used as the Jazz db user once the tables to support Jazz have been created by explicitly granting read/write privileges on all the Jazz created tables to the user and granting that user use of the temp table space.


DB2 테이블스페이스 생성 정보 (자동)

- 테이블스페이스 ; CONTENTTS (LARGE / DMS / 자동크기재조정 / IBMDEFAULTBP)
db2 list tablespaces show detail
 전체 페이지 수                            = 250000
 사용된 페이지 수                         = 26560
 사용 가능한 페이지 수                    = 223392
 페이지 크기(바이트)                      = 16384
 Extent 크기(페이지)                      = 32
 프리페치 크기(페이지)                    = 32
 컨테이너 수                              = 1
        컨테이너 ; C:\DB2\NODExxxx\SQLxxxxx\jazzdata / 4GB

- 테이블스페이스 ; JAZZTMPSPACE (사용자 임시 / DMS / 자동크기재조정 / IBMDEFAULTBP)
 전체 페이지 수                            = 2500
 사용된 페이지 수                         = 64
 사용 가능한 페이지 수                    = 2400
 페이지 크기(바이트)                      = 16384
 Extent 크기(페이지)                      = 32
 프리페치 크기(페이지)                    = 32
 컨테이너 수                              = 1
        컨테이너 ; C:\DB2\NODExxxx\SQLxxxxx\jazztemp / 40MB

- 버퍼 풀 ; IBMDEFAULTBP (페이지크기 16 / 자체성능조정)
db2 select * from syscat.bufferpools

- 데이터베이스 구성 매개변수 변경값
db2 get db cfg show details
          데이터베이스 힙(4KB)(DBHEAP)                    = 8192 
          버퍼 풀 크기(페이지)(BUFFPAGE)                  = 16384  
          디폴트 응용프로그램 힙(4KB)(APPLHEAPSZ)         = 10000
          응용프로그램 메모리 크기(4KB)(APPL_MEMORY)      = AUTOMATIC(10016) 
          로그 파일 크기(4KB)(LOGFILSIZ)                  = 4096
          1차 로그 파일 수(LOGPRIMARY)                    = 20 
          2차 로그 파일 수(LOGSECOND)                     = 20 
                C:\DB2\NODExxxx\SQLxxxxxx\SQLOGDIR\

댓글 없음:

댓글 쓰기