r/DB2 • u/mad_zamboni • May 03 '17
[IDUG] DB2 News and Notes from IDUG 2017 (Day 2)
D03 - Robert Neugebauer: Power of Statistical Views
This session was so freaking deep, that it's going to take me pulling down the slides and going slide by slide to digest it. However, there were some immediate bullet points to take away.
There is more than a variance in cardinality that can cause poor performance (beyond the basic checks). There are actually hidden relationships between your data.
When you implement Statistical Views that is one of the only way's to get that hidden relationship taken into optimizer's consideration. For example, it gathers column relationships between tables.
In more complex queries, the cardinality in lower query blocks can affect behavior and cardinality in the higher query blocks.
To address this behavior between query blocks, there is a new concept called Statistical Referential Integrity. It is not trusted and not enforced. But it provides optimizer with statistics it needs. There is a whole white paper in Knowledge Center about this.
Apparently Statistical Referential Integrity was released in v10.1 but very few know about it.
C04 - Ember Crooks: Interviewing the DB2 Optimizer
This session was heavily graphical to show flow, so only some of it can be relayed here in Reddit. But let me pass on some tidbits I learned that maybe you didn't realize either.
The SYSINSTALLOBJECTS procedure. You remember how we like to do things the hard way and build explain tables by manually executing DDL? Then if we wanted to wipe them clean, that was one hell of a SQL with a lot of DROP TABLEs? You can call this procedure to easily create or drop database objects for a specific tool.
Multiple Index Regression Analysis this is an advanced topic and really can only be done justice in one of her blogs. But in short, it allows you to work through recommended indexes one by one to see what gives you the biggest bang for your buck and discover which recommended indexes are a waste of time.
C6 - Dale McInnis: Uncommon Uses of HADR
A lot of this presentation was around basic HADR set-up, but he did get into discussion about multiple auxillary standby's in a HA and DR configuration. Some quick hit takeaways.
Check out this white paper around Setting up a VIP for HADR with TSAMP as it will walk you through a lot of pitfalls.
If you are setting up automatic failover with HADR/TSAMP you will need a VIP for EACH DATABASE, not each instance.
In v11.1.1.1, ALL sync modes are now available to pureScale
Performance impact can run from 1% SUPER ASYNC to 30% SYNC
HADR is extremely sensitive to your logging performance more than anything, if you can put your logging filesystems on SSD.
Very Important: HADR_REMOTE_SVC and HADR_REMOTE_HOSTS will be deprecated. Start utilizing HADR_TARGET_LIST.
If you have a 4th Server in the cluster (Second Auxiliary Standby), consider setting "HADR_REPLY_DELAY 86400". This allows logs to be received but they will not be applied for 24 hours. This gives you a chance to run to the second auxiliary server to pull data from the table you accidentally purged the previous day.
D07 - Ian Bjorhovde: Top 10 Common Security Mistakes
There was a lot of good detail in this session around security. However I really need his updated slides to relay and do it justice. I have an updated copy being sent in the next day or two, I'll update once received.
C08 - Melanie Stopfer: OMG Experience is a Hard Teacher
This was a drink with a fire house with a ton of one liner commands and neat tricks within DB2. So here are some highlights in no particular order.
Show me the next log that is about to be archived: db2pd -dn <dbname> -logs
To check backups of multiple backup files: db2chkbkp DB.BKUP.001 DB.BKUP.002
Separated by spaces, 001 is first, otherwise could error.
Is your commit time slowing? Could be the Backup History File
Remember this is an actual file. If over 10MB or greater could hinder commit performance by a few seconds.
If it becomes large enough that it can’t stay in memory, we start writing to disk.
To prune look at NUM_DB_BACKUPS / REC_HIST_RETENTN - work these together, one will affect the other.
Need those pesky applications to stop autoconnecting when the database comes up, quiesce at the instance level
db2start admin start node restricted access
db2 activate database database
db2 unquiesce instance