Saturday, January 12, 2008
HADR enhancements---db2haicu in V9.5
From version 9.5 there is no necessity to install heartbeat scripts seperately.Heartbeat scripts come with HADR and they need to be set up using db2haicu.
When db2haicu is run for the first time,it will search the database system for database configuration that is related to cluster configuration.Then it creates a cluster domain for instance if it does not exist.
db2haicu maintainance mode::
db2haicu will be run in maintainance mode once the cluster domain is created.Cluster elements such as databases or cluster nodes can be added or removed in maintainance mode.Also the failover mechanism can be defined using db2haicu in maintainance mode.
Saturday, January 5, 2008
MDC---PART 1
CREATE TABLE MAKEMDC(
ID INT,
MAKE CHAR(30),
MODEL CHAR(30)
)
ORGANIZE BY (MAKE,MODEL)
CELL: Every unique combination of dimensions form a cell.A cell can have one or more blocks.
BLOCK:It is a block of pages that contain a unique combination.Its size(blocking factor) is equal to the extent size defined.
A cell for unique combination of FORD(make) FOCUS(model) will be like this
DESIGN OF THE MDC TABLES:
Number of cells can be estimated by executing a select with distinct clause on the dimension columns to arrive at the unique combinations of the dimension values.
For example, for the above mentioned MDC table,the number of cells can be known by executing the following query:
SELECT DISTINCT MAKE,MODEL from MAKEMDC;
A large value of C/R might indicate the wastage of space where C indicates the number of cells and R indicates the total number of rows in the table.So,dimension columns should be wisely chosen.Choosing a firstname column as dimension column with employeeid might generate lot of cells and thereby wastage of space.A column like state with 10 possible values might be a good candidate as it would have only 10 possible values
Space occupied per cell(SC) = R/C * average row size
If SC is less than (extentsize*pagesize) then there is a wastage of space.So,the design should be done in a way such that SC matches up the (extentsize*pagesize) value.
Following are the options that can be used to design MDCs optimally:
1)Decrease the extent size if the blocks are not filled up.Page size can be increased if there are too many blocks per cell
2)Granularity can be varied to decrease the cells ..For example a new dimensional column can be added to the totalbalance table defined as totalbalance/100 to decrease the cells.
3)New dimensional keys can be added or existing ones can be removed depending on the situation.
4)A larger extent size might help in reducing the I/O but it might impact the usage of the space.
5)It is always better to do a comparison with the base table before the MDC table is actually used.For example MAKEMDC mentioned above should be compared with the MAKE table(base table) interms of space usage and performance before the decisions are actually taken.
Reference::Advanced DBA Certification Guide and Reference for DB2 UDB by Snow and Thomas
Friday, January 4, 2008
GET_DBSIZE_INFO procedure and database size
snapshot-timestamp:This indicates the time when the database size was actually calculated.This is an output parameter.
dbsize:This is the size of the database in bytes.This is an output parameter.
dbcapacity:This indicates the capacity of the database in bytes.This is an output parameter.
refresh-window:This is an input parameter.It indicates the number of minutes after which the database calculation values are refreshed.
Examples::
1)CALL GET_DBSIZE_INFO(?, ?, ?, -1) -1 which defaults to 30 minutes indicates that the cached values will be refreshed if 30 minute window is reached.
2)CALL GET_DBSIZE_INFO(?, ?, ?, 0) This indicates the cached values are refreshed immediately
3)CALL GET_DBSIZE_INFO(?, ?, ?, 100) indicates that the refresh happens every 100 minutes.
Wednesday, January 2, 2008
Automatic client reroute registry parameters
Example::
DB2_CONNRETRIES_INTERVAL=4
DB2_MAX_CLIENT_CONNRETRIES=2
DB2_CONNRETRIES_INTERVAL variable specifies the sleep time between consecutive connection retries, in seconds, for the automatic client reroute feature.This indicates that 2 clientretiries happen with a gap time of 4 seconds before the client rerooute actually happens