Sunday, February 16, 2014

Important points to be noted when doing DB2 Database Refresh to UAT or DEV environments

Hey all, today i would discuss on the important points that needs to be kept in mind when refreshing from PROD to UAT or DEV environments. Below are the issues that i recently faced when doing a refresh activity from PROD to UAT.

1) Bufferpools unavailability, only hidden bufferpools started.
2) Server hangup during rollforward phase, even doesn't allow other users to login and kill it.
3) Rollforward fails saying no enough memory to allocate.
4) Rollforward fails due to archive log location is not valid.

Overall why are these incidents happened ? Answer for this is we have different physical configurations and different settings in PROD when noted to UAT or DEV. So before doing a refresh take a backup of all the DB CFG parameters for all the databases also DBM cfg of the instance for which you intend the refresh.

1) INSTANCE_MEMORY parameter
2) DATABASE_MEMORY parameter
3) Bufferpools size
4) LOGARCHMETH1 path

My  Scenario.

We have 120 GB phsyical memory available in prod so we used 110 GB for INSTANCE_MEMORY parameter. Also for one of the db we have 50 GB set to DATABASE_MEMORY parameter so what happened when did a backup and restore in UAT .

Restore was successful, then started rollforward of db then suddenly our prompt got hanged, not responding . When even tried to login from different session its not allowing to login. So we contacted system admin, and he told that total memory being used by DB2 and due to which its not allowing the users to ssh also. He then hard reboot the machine and then I checked and could see only 62 GB of physical RAM available on the server, but our DATABASE_MEMORY was set to 110 GB automatic so we understood that this is the main reason for server hangup. We then updated the DATABASE_MEMORY to 10 GB with automatic settings. A new issue started when trying to activate the db, as bufferpools memory settings in PROD are very high so only DB started only with hidden bufferpools which we didn't observe and started to rollforward again, which resulted in failure. So for time being i used this method, I made the bufferpools started with only 3000 pages initially, Here is the environment variable to set the BP intital pages to some number of pages, use command DB2SET DB2_OVERRIDE_BPF=3000 , after setting it check if reflected or not DB2SET -ALL , this command show all the environment variables that are set. Then tried rollforward again and this time it again resulted in failure as we are having LOGARCHMETH1 in prod location not matching in the UAT server which resulted in failure. We then updated the LOGARCHMETH1 parameter to valid path and then tried rollforward again and this time its SUCCESS.  Finally we have activated and connected to database and made valid changes to bufferpool size based on database_memory and restarted the DB.


Readers anybody has any doubts or any other errors that you faced please post your comments here and we shall discuss on them and update here.

No comments:

Post a Comment