Page 1 of 1
Cloning a db2 subsystem
Posted:
Fri Sep 21, 2012 10:28 pm
by arshadhrashid
Hello there,
Just want some advise on this topic.
There are a lot of products avaiable which clone an entire db2 sub-system form lets say prod to test.
Is it something that can be done by one's own-self? I mean can I start looking for/developing procedures to do it myself or is is it something so complex or not doable that I have to buy a tool for it?
Any suggestion or pointing towards something of this nature would be highly appreciated.
Thanks a lot.
Re: Cloning a db2 subsystem
Posted:
Fri Sep 21, 2012 11:35 pm
by Peter_Mann
Define clone, if you currently have a instance of DB2 licensed and running, then the DB2 tools themself can clone (imagecopy) from one subsysetm to another, or some DASD subsystem tools can be used, or.......
Peter
Re: Cloning a db2 subsystem
Posted:
Fri Sep 21, 2012 11:48 pm
by arshadhrashid
Thanks for your reply Peter.
By clone I mean an exact copy.
I have a sub system called A and I want to make a comlpete copy of it as another subsystem B on the same LPAR.
The B will not share anything with A.
I can copy all the datasets that comprise a sub system to a new VACT but a clone takes more than that.
Some internals of db2 needs to be updated at the B system
IBM DB2 Tools is a seperate product and it doesnot come with a db2 license.
I was thinking to write JCLs and SQLs scripts to perform that.
thanks
Re: Cloning a db2 subsystem
Posted:
Sat Sep 22, 2012 12:30 am
by Peter_Mann
Well, I'll see if a DB2 expert can chime in here, but the only way I know to clone the DB2 tables is with a tool designed to do so, IBM's Inforsphere CDC tools is one, I would think a DB2 image copy would suffice, but like I said, I'm not a DB2 guy. I've seen folks unload a db2 table in it's raw form and reload to a new subsystem, we're currenty using an EMC DASD tool today to clone a DB2 subsysetm from PROD, for test refresh this is done every quater, I'm not sure what the DBA's do after the refresh is complete, but I know the process is not so difficult.
Peter
Re: Cloning a db2 subsystem
Posted:
Fri Sep 28, 2012 9:07 pm
by arshadhrashid
Peter
Since no reply received, as your requested, I think your shop has the solution.
As you mentioned after copying data using EMC DASD tool to clone then DBAs do something after wards , is the solution. I can make physical copies of data by any mean but what has to be done afterwards is the answer. If your DBAs can shed some light on what do they do afterwars , I would really appreciate.
Thanks
Re: Cloning a db2 subsystem
Posted:
Fri Sep 28, 2012 9:14 pm
by Peter_Mann
We're in the process of this right now, the DASD tool (EMC) today clones the volumes, the DBA's run DB2 utilities to change internal DB2 catalog info, I'll have to see if I can get some detail for you on what is done after the volumes are cloned.
Re: Cloning a db2 subsystem
Posted:
Fri Sep 28, 2012 10:53 pm
by Peter_Mann
Looking at the ENTIRE documention to CLONE DB2 from one subsystem to another is quite lengthy and detailed, some of the information is specifc to the DASD enviorment we have today and our setup internal to the DASD subsystem, I will try yo provide some HL steps, but you need to create a plan for your enviorment based on your hardware and document this process as the folks here have to do this without missing a beat, as I stated above I will provide a HL task list when I get some time
Re: Cloning a db2 subsystem
Posted:
Fri Sep 28, 2012 11:16 pm
by Peter_Mann
Here's a HL of the process we perform
DIsclamer: these steps and the process within are specific to our envirnement THIS IS THE INFO TO CLONE DBXX FROM DBXX.
NOTE1 - THIS PROCESS WILL TAKE ALL THE DB2CATRP DATASETS AND THE
VOLUME XXXXXX AND XXXXXX
THIS CAN BE DONE WHILE DBXX IS UP OR DOWN.
IF UP, DBXXL1 IS BEING COPIED, SO YOU WILL NEED TO DO
AN ARCHIVE LOG COMMAND UNTIL DS01 OR 03 OR 05 IS
THE CURRENT ACTIVE LOG FOR DBXX.
JOBS THAT EXECUTE MS/VCR PROGRAMS WILL
NEED TO RUN ON AN LPAR ON THE XXX.
JOB1 WILL VARY DEVICES ONLINE TO THE LPAR WHERE IT
RUNS AND THE DASD TASK 2 JOBS SHOULD RUN ON THIS SAME LPAR.
THE TARGET VOLUMES SHOULD ONLY BE VARIED ONLINE TO THIS
SAME LPAR TO PREVENT CONTENTION FROM OTHER LPARS.
BEFORE STARTING THIS PROCESS, THE TARGET VOLUMES AND CATALOG
SHOULD BE EMPTY. GET WITH SYSTEMS IF NEEDED ON THE CATALOG.
IF THIS IS THE FIRST TIME THE TARGET IS BEING CLONED, YOU MUST
BIND THE MS/VCR PLAN ON THE TARGET SO IT WILL BE ON THE CLONE.
*DURING THE BELOW TIME, THE SOURCE DB2(DBXX) IS SUSPENDED. THESE STEPS
SHOULD BE DONE AS QUICKLY AS POSSIBLE. SUSPEND/RESUME IS ONLY NEEDED
IF YOU ARE CLONING AN ACTIVE SYSTEM.
JOB1A - *ISSUE DB2 COMMAND TO SUSPEND DB2 ACTIVITY ON DBXX
- *SPLIT THE BCVS
JOB2 - *VCR JOB TO CREATE THE JOURNAL USED IN SUBSEQUENT STEPS. THIS
ALSO RESULTS IN THE BCVS BEING VARIED ONLINE AND CLIPPED TO
THE NAME SPECIFIED IN THE PARM FILE, CURRENTLY SCR001-SCR091
NOTE2 - IF THE ABOVE JOBS DO NOT FINISH CORRECTLY, YOU SHOULD RESUME
DB2 AS QUICKLY AS POSSIBLE AND PLAN A DO OVER. THIS APPLIES
ONLY IF YOU ARE CLONING THE SYSTEM WHEN IT IS UP
JOB3 - *RESUME THE SOURCE DB2
*DURING THE ABOVE TIME, THE SOURCE DB2 IS SUSPENDED. THESE STEPS SHOULD
BE DONE AS QUICKLY AS POSSIBLE.
- START FULL VOLUME MOVES FROM THE SPLIT BCV TO THE TARGET VOLS
JOB4 - BACKUP OF THE JOURNAL FILE FOR POSSIBLE REDO
JOB5 - CREATE BACKUP FOR UCATBKUP.BKP AND IEBGENER TO THE BACKUP
- ONCE SOURCE VOLS(BCVS) ARE COPIED TO TARGET VOLS
VARY THE BCV DEVICES OFFLINE TO PREVENT PROBLEMS SINCE
THESE VOLUMES CONTAIN IDENTICAL DATA AS THE TARGETS
MUST WAIT FOR DASD jobs above TO FINISH BEFORE CONTINUING
JOB6 - VCR STEP ISSUES VOLOPTIONS TO CHANGE THE VOLSERS IN VCR FILES
SINCE WE COPIED THE DATA FROM THE BCVS TO TARGET VOLUMES
JOB7 - VCR STEP DOES THE "CLONING" BY RENAMING AND CATALOGING THE
DATASETS THAT WERE COPIED FROM THE BCVS TO THE TARGET VOLS
JOB8 - CREATE AND FORMAT TARGET ACTIVE LOG FILES. THIS MAY RUN LONG
DEPENDING ON THE SIZE AND NUMBER OF ACTIVE LOGS. YOU CAN
CONTINUE TO JOB013 WHILE THIS JOB RUNS.
JOB9 - CREATE NEW BSDS02 FILE AND COPY DATA FROM PRIMARY BSDS01
JOB10 - VCR STEP UPDATES BSDS/DBD01 WITH TARGET INFORMATION
JOB11 - CREATE TARGET DSNDB07 WORK FILES
JOB12 - DELETE/RECATALOG DSNLOAD/DSNEXIT/RUNLIB.LOAD AND ENSURE THEY
ARE ON THE CORRECT APF VOLUME.
JOB13 - ASSEMBLE ZPARM WITH VCR SYSLIB. THIS ALLOWS UPDATES TO THE
CATALOGS. YOU WILL ALSO WANT TO CHANGE THE SYSADM USERID
TO YOUR USERID.
JOB14 - REMOVE ACTIVE LOGS FROM THE TARGET BSDS SINCE THOSE VOLUMES
WERE NOT BCV'D
JOB15 - ADD 1 ACTIVE LOG INTO THE TARGET BSDS
JOB16 - ADD REMAINDER OF ACTIVE LOG INTO THE TARGET BSDS
JOB17 - REMINDER THAT JOB008 MUST COMPLETE BEFORE CONTINUING
- VARY DFD VOLUMES ONLINE TO ALL SYSTEMS
JOB18 - START DB2 ACCESS(MAINT). UNCATALOGED DB01/06 MESSAGES ARE
NORMAL ON THIS FIRST EXECUTION OF TARGET DB2.
JOB19 - VCR STEP THAT COMPLETES THE RENAME/CATALOGING OF ALL DB01/06
JOB20 - VCR STEP UPDATES CATALOG/DIRECTORY INFO
JOB21 - BRING DOWN TARGET DB2
JOB22 - ASSEMBLE ZPARM WITHOUT VCR SYSLIB.
JOB23 - NORMAL START TARGET DB2
JOB24 - VCR STEP CHECKS AND FIXES DB01/06 SPACES FOR LPL ECT
JOB25 - VCR STEP CHACKS AND FIXES ALL OTHER SPACES FOR LPL ECT
JOB26 - BRING DOWN TARGET DB2
JOB27 - ASSEMBLE ZPARM WITH CORRECT SYSADM ID IF YOU CHANGED THEM
JOB28 - NORMAL START DB2
JOB29 - RUN THROUGH THE LOGS TO BE SURE THEY ARE COOL
JOB30 - DB2 MUST BE DOWN---REMOVE LOGS FROM NON SMS MANAGED VOLUMES
MAKE SURE ACTIVE LOG IS NOT THE ONE YOU ARE REMOVING.
Re: Cloning a db2 subsystem
Posted:
Sat Sep 29, 2012 12:12 am
by arshadhrashid
Peter,
Thank you very much for this detailed reply.
I will go over it and try to mimic it in my environment.
Once again thanks a lot.