Before you start upgrading your DB2® server, you must ensure that you have a sufficient amount of free space on your system catalog table space and temporary table space, and enough log space to upgrade your databases.
Ensure that you have SYSCTRL or SYSADM authority to be able to increase the size of table spaces and log space.
Additional considerations are required in partitioned database environments to increase table space sizes because table spaces span across database partitions. Also, you only need to increase the log space in the catalog database partition server.
To increase the size of your table spaces and log space:
db2 CONNECT TO sample
db2 "SELECT SUBSTR(TBSP_NAME,1,15) NAME, TBSP_TYPE TYPE,
TBSP_AUTO_RESIZE_ENABLED AUTO_RESIZE, TBSP_NUM_CONTAINERS CONTAINERS,
TBSP_TOTAL_PAGES TOTAL_PGS, TBSP_USED_PAGES USED_PGS, TBSP_FREE_PAGES FREE_PGS,
TBSP_MAX_SIZE MAX_SZ, TBSP_PAGE_SIZE PG_SZ
FROM SYSIBMADM.TBSP_UTILIZATION
WHERE TBSP_CONTENT_TYPE IN ('ANY','SYSTEMP')"
NAME TYPE AUTO_RESIZE CONTAINERS TOTAL_PGS USED_PGS FREE_PGS MAX_SZ PG_SZ
--------------- ---- ----------- ---------- --------- -------- -------- ------ -----
SYSCATSPACE DMS 1 1 8192 7576 612 -1 8192
TEMPSPACE1 SMS - 1 10 10 0 - 8192
2 record(s) selected.
Take note of the number of containers,
total pages, used pages, free pages, MAXSIZE, and page size. number_of_pages = ( used_pages - free_pages ) /
number_of_containers_in_SYSCATSPACE
Then
use the following command to increase the size of all containers in
the system catalog table space: db2 "ALTER TABLESPACE SYSCATSPACE EXTEND (ALL number_of_pages)"
db2 "ALTER TABLESPACE SYSCATSPACE
MAXSIZE (2*used_pages_in_SYSCATSPACE*page_size/1024) K"
number_of_pages = ( number_of_total_pages_in_SYSCATSPACE ) /
number_of_containers_in_TEMPSPACE1
Use
the following command to increase the size of all containers in the
temporary table space: db2 "ALTER TABLESPACE TEMPSPACE1 EXTEND (ALL number_of_pages)"
db2 "ALTER TABLESPACE TEMPSPACE1
MAXSIZE (2*total_pages_in_SYSCATSPACE*page_size/1024) K"
db2 GET DB CFG FOR sample |grep '(LOG[FPS]'| tee logsize.txt
Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 3
Number of secondary log files (LOGSECOND) = 2
db2 UPDATE DB CFG FOR sample using LOGSECOND
(current_value of LOGPRIMARY + current_value of LOGSECOND) * 2
If
you already have a large log space, you might not need to increase
it. db2 UPDATE DB CFG FOR sample using LOGARCHMETH1 DISK:archive-dir
db2 UPDATE DB CFG FOR sample using LOGSECOND -1
where archive-dir is
the directory to archive the log files. All applications must disconnect from this database before the new values become effective.