I gave a presentation on db2pd in 2005, IDUG Europe. I believe this was the first presentation given on db2pd. I did a follow-up in Ohio to a Db2 Users Group. Its available for download on this site under presentations….I still use db2pd for a variety of tasks augmented by administrative views, MONREPORT and custom monitoring scripts.
SMS tablespaces have been deprecated for serveral releases. There isn’t a straight forward way to convert these to Automatic Storage Management tablespaces. A fast, reliable way to do this is to create an ASM Tablespace to replace the SMS tablespace, extract the DDL for the table to be moved using db2look, create the new table with a different name in the new tablespace and then use LOAD FROM CURSOR to load the table data into the new table. Upon completion, and verification of row counts from old to new, rename the old to old, and rename the new one to the old name. This method using load from cursor has been around since at least V8.2 of Db2 LUW. So get movin’ before it is too late. The above method can also be used to “rescue” an SMS tablespace that has run out of space..
Recently I have been contacted by several clients reporting various degrees of lock-related problems in OLTP systems. One of the first item I check is the setting of the DB CFG locktimeout configuration parameter. What I find is that many times the default of -1 is used which doesn’t allow for any lock timeouts. This is one of the first parameters you will want to change, a value of 10000 (10 secs) is a good starting point. Additionally, make sure that you are taking advantage of the lock avoidance registry variables ( Covered in a future post). Here are a few links to some info to help you along the way with understanding Db2 lock isolation levels along with JDBC driver settings:
https://www.ibm.com/developerworks/data/library/techarticle/dm-1107db2isolationlevel/
Review the locktimeout setting here: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.admin.config.doc/doc/r0000329.html
Often you might need to know if a Db2 registry variable can be changed online and immediate, without requiring a Db2 instance restart. This can be done by using the -info option of the db2set command. See the example below, you should add this bit of info to your Db2 toolbox.
Example:
C:\Program Files\IBM\SQLLIB_01\BIN>db2set -info db2_capture_locktimeout
Immediate change supported : YES
Immediate by default : YES
C:\Program Files\IBM\SQLLIB_01\BIN>db2set -info db2_use_alternate_page_cleaning
Immediate change supported : NO
Immediate by default : NO
New in Db2 11.5, the Db2 Community Edition (takes the place of the former Db2 Express) is a great edition for developers to try out any of the plethora of development environments supported by Db2. Docker and standard downloads available. I have clients using this in production up to the license limits with superior capability. Use it in test or in small production environments, with full features. Hard to beat, with a seamless upgrade to higher editions later if needed. Read more at Phil’s article here: https://www.ibm.com/cloud/blog/announcements/ibm-db2-developer-community-edition
With Db2 11.1 and 11.5 there have been some edition changes. I get lots of questions regarding Db2 editions, features and licensing from my clients. I’m currently working with a client moving from Db2 Express-C and Db2 Express -FTL 10.5 to 11.5. Editions available in Db2 11.5 are Db2 Community, Standard Edition and Db2 Advanced Edition. You can download the 11.5 Announcement here For details on new editions and features provided, check out the following links:
https://www.ibm.com/products/db2-database/pricing
Today is the day that Windows 7 and Windows 2008 Server support ends….Also, Db2 10.5 is nearing EOS in September 2020, so get moving…..
https://www.ibm.com/support/pages/db2-distributed-end-support-eos-dates
https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet
Database Member 0 — Database XXXXXXX — Active — Up 377 days 05:05:17 — Date 2019-12-17-12.57.47.749000
HADR_ROLE = PRIMARY
REPLAY_TYPE = PHYSICAL
HADR_SYNCMODE = SUPERASYNC
STANDBY_ID = 1
LOG_STREAM_ID = 0
HADR_STATE = REMOTE_CATCHUP
HADR_FLAGS =
PRIMARY_MEMBER_HOST = 10.221.37.1
PRIMARY_INSTANCE = XXXXXXX
PRIMARY_MEMBER = 0
STANDBY_MEMBER_HOST = 10.221.37.2
STANDBY_INSTANCE = XXXXXXX
STANDBY_MEMBER = 0
HADR_CONNECT_STATUS = CONNECTED
HADR_CONNECT_STATUS_TIME = 07/15/2019 11:41:45.384342 (1563205305)
HEARTBEAT_INTERVAL(seconds) = 30
HEARTBEAT_MISSED = 1
HEARTBEAT_EXPECTED = 1085939
HADR_TIMEOUT(seconds) = 120
TIME_SINCE_LAST_RECV(seconds) = 15
PEER_WAIT_LIMIT(seconds) = 0
LOG_HADR_WAIT_CUR(seconds) = 0.000
LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000000
LOG_HADR_WAIT_ACCUMULATED(seconds) = 0.000
LOG_HADR_WAIT_COUNT = 0
SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 8192
SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 8192
PRIMARY_LOG_FILE,PAGE,POS = S0742992.LOG, 866, 97283366969536
STANDBY_LOG_FILE,PAGE,POS = S0742992.LOG, 746, 97283366479849
HADR_LOG_GAP(bytes) = 1224
STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0742992.LOG, 746, 97283366479849
STANDBY_RECV_REPLAY_GAP(bytes) = 965
PRIMARY_LOG_TIME = 12/17/2019 12:57:47.000000 (1576605467)
STANDBY_LOG_TIME = 12/17/2019 12:57:32.000000 (1576605452)
STANDBY_REPLAY_LOG_TIME = 12/17/2019 12:57:32.000000 (1576605452)
STANDBY_RECV_BUF_SIZE(pages) = 1048575
STANDBY_RECV_BUF_PERCENT = 0
STANDBY_SPOOL_LIMIT(pages) = 5040000
STANDBY_SPOOL_PERCENT = 0
STANDBY_ERROR_TIME = NULL
PEER_WINDOW(seconds) = 0
READS_ON_STANDBY_ENABLED = Y
STANDBY_REPLAY_ONLY_WINDOW_ACTIVE = N
This payments processing database with standby read only enabled is quite busy and it regularly is up for over a year or so… DB2 Workgroup Server Edition, DB2 10.5 FP10, Windows Server. #IBMchampion #Db2 #IDUGdb2
Database Member 0 — Database XXXXXXXX — Active — Up 339 days 03:03:39 — Date 2019-11-09-10.54.20.617000
HADR_ROLE = PRIMARY
REPLAY_TYPE = PHYSICAL
HADR_SYNCMODE = SUPERASYNC
STANDBY_ID = 1
LOG_STREAM_ID = 0
HADR_STATE = REMOTE_CATCHUP
HADR_FLAGS =
PRIMARY_MEMBER_HOST = 10.221.37.1
PRIMARY_INSTANCE = XXX
PRIMARY_MEMBER = 0
STANDBY_MEMBER_HOST = 10.221.37.2
STANDBY_INSTANCE = XXX
STANDBY_MEMBER = 0
HADR_CONNECT_STATUS = CONNECTED
HADR_CONNECT_STATUS_TIME = 07/15/2019 11:40:48.347241 (1563205248)
HEARTBEAT_INTERVAL(seconds) = 30
HEARTBEAT_MISSED = 2
HEARTBEAT_EXPECTED = 976254
HADR_TIMEOUT(seconds) = 120
TIME_SINCE_LAST_RECV(seconds) = 8
PEER_WAIT_LIMIT(seconds) = 0
LOG_HADR_WAIT_CUR(seconds) = 0.000
LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000000
LOG_HADR_WAIT_ACCUMULATED(seconds) = 0.000
LOG_HADR_WAIT_COUNT = 0
SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 8192
SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 8192
PRIMARY_LOG_FILE,PAGE,POS = S0139127.LOG, 4736, 4323093384568
STANDBY_LOG_FILE,PAGE,POS = S0139127.LOG, 4736, 4323093380945
HADR_LOG_GAP(bytes) = 0
STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0139127.LOG, 4736, 4323093380945
STANDBY_RECV_REPLAY_GAP(bytes) = 0
PRIMARY_LOG_TIME = 11/09/2019 10:54:14.000000 (1573314854)
STANDBY_LOG_TIME = 11/09/2019 10:54:11.000000 (1573314851)
STANDBY_REPLAY_LOG_TIME = 11/09/2019 10:54:11.000000 (1573314851)
STANDBY_RECV_BUF_SIZE(pages) = 8192
STANDBY_RECV_BUF_PERCENT = 0
STANDBY_SPOOL_LIMIT(pages) = 3200000
STANDBY_SPOOL_PERCENT = 0
STANDBY_ERROR_TIME = NULL
PEER_WINDOW(seconds) = 0
READS_ON_STANDBY_ENABLED = Y
STANDBY_REPLAY_ONLY_WINDOW_ACTIVE = N
I served as a technical reviewer on this book and many others. This was a great reference at the time and is still good for many aspects of Db2. #Db2 #IBMchampion #IDUGdb2