Click to edit Master title style MIGRATE

advertisement
Recovery Management Solution
50 Ways to Move Your Data
(a.k.a., Make a New Plan Stan)
Phil Grainger
Donna Di Carlo
BMC Software
Session Code: 414
Wed, May 01, 2013 01:00 PM - 02:00 PM| Platform: DB2 for z/OS
Click to edit Master title style
Agenda
•
•
•
•
•
•
•
Data migration overview
Capturing a consistent image
Migrating with RMD Solution V10.1.00
New V11.1.00 Copy Migration feature
Migration scenarios
Summary
Questions
2
Click to edit Master title style
Why do we move data around?
• Production data is our business
• And it is often handy to have that data elsewhere
• From production DB2 to “somewhere else”
•
•
•
•
Data analytics and decision support
Application testing
System testing
Problem diagnostics
3
Click to edit Master title style
What are our choices?
• As with most things in DB2, we have choices to make
• We could use Unload and Load
• Costly process and time consuming
• We could use DSN1COPY
•
•
•
•
Much faster
But no knowledge of DB2 internals
DSN1COPY can complete without errors, but the data may still be inaccessible
There are more and more reasons NOT to use DSN1COPY:
• Schema changes that are not yet instantiated
• RRF vs BRF
• Object definition differences
• We could use hardware snapshots
• IF the object structures are IDENTICAL between subsystems
• For safety we would need to revert to Unload and Load
• Costly process and time consuming
4
Click to edit Master title style
There has to be a better way
• And there is
• Restore the data using a consistent image
• This process is very efficient
• And if the data movement needs to be repeated, we could
• Refresh the migrated data
• Or even propagate changes via log
5
6
Click to edit Master title style
Consistent image copy
• Image copy can’t have in-flight transactions
• All updates must be committed
UR 4
UR 1
UR 3
UR 2
Consistent
Point
Inconsistent
Point
Click to edit Master title style
Obtaining a consistent image
• SHRLEVEL REFERENCE image copy
• Requires a large outage
• Instant Snapshot Copy
• Uses intelligent storage to snap a SHRLEVEL REFERENCE copy
• Requires a small outage
• OUTCOPY ONLY
• Merges existing image copy with log to produce a copy
• Must specify a quiet point or use Timestamp Recovery feature
• Can use Log Master to find a quiet point
• QUIESCE not necessary
• Online Consistent Copy (OCC)
• Creates a SHRLEVEL CHANGE Snapshot
• Uses log to back out in-flight transactions
• No outage required
7
8
Click to edit Master title style
Recover Plus INCOPY feature
• Use when the target subsystem is remote
• Specify an unregistered consistent copy in the INCOPY clause
• Supply OBID translation values
• Values can be defaulted for single-table table spaces and indexes
DB2A
DB2B
Click to edit Master title style
Recover Plus INCOPY feature (cont.)
• Recover Plus INCOPY feature (cont.)
• Difficult to use with OBJECTSET
• An OBJECTSET allows you to process a group of objects in a single
statement
• All OBID translation values must be defaulted
• All image copy data set names must use the same data set model
• Can’t use cabinet copies
• A cabinet copy contains several small images in one data set
• Eliminates several data set allocate/open/close commands
• Needs BMCXCOPY information to read the cabinet
9
10
Click to edit Master title style
Recover Plus INDEP OUTSPACE
• Use when shared DASD is available
• Specify source object name and quiet point
• The appropriate image copy will be used based on the quiet point
• Will merge log with image copy to create a consistent image
• Can use Timestamp Recovery and specify a time instead of a quiet point
• Specify VSAM data set name of target
• Supply OBID translation values
• Defaults source values for single-table table spaces and indexes
DB2A
DB2A
Log
DB2B
VSAM DS
Click to edit Master title style
Recover Plus INDEP OUTSPACE (cont.)
• Can’t be used with cabinet copies or an OBJECTSET that
contains multi-table table spaces
11
Click to edit Master title style
V11.1.00 Copy Migration feature
• Copy Migration feature helps automate migration
• The migration file is key
• Supplies image copy names and translation ID values
• Used to verify compatibility between source and target attributes
12
Click to edit Master title style
V11.1.00 Copy Migration feature (cont.)
• Uses the following products
• Copy Plus
• EXPORT creates the migration file
• Recover Plus processes the migration file
• IMPORT automates INCOPY
• MIGRATE automates INDEP OUTSPACE
• Change Manager
•
•
•
•
EXPORT
IMPORT
Allows for multi-tasking
Allows BMCXCOPY access
• Instant Snapshot
• Cabinet copies
• Encrypted copies
• Allows LOB migration
13
14
Click to edit Master title style
Migration file
• Brains of Copy Migration
• Contains information from SYSCOPY,
BMCXCOPY and the DB2 catalog
•
•
•
•
Image copy names
Object ID values
Schema definitions
Versioning information
• Allows for a high level of error checking
• Created by the Copy Plus EXPORT
command
• Input to the Recover Plus IMPORT and
MIGRATE commands
BMCXCOPY
SYSCOPY
DB2 Catalog
Migration
File
Click to edit Master title style
Copy Plus EXPORT command
• The output descriptor defines the migration file allocation
• The object list names the table spaces to be exported
• TABLESPACE
• Can be wildcarded
• OBJECTSET
• APPLICATION
• Table spaces will be included if a full image copy is found
• Can request to include indexes with INDEXES YES
• Must have an available index image copy
• Image copy selection
• Most recent copy is default
• If INDEXES YES, index copy log point doesn’t have to match table space copy
• Can request a copy at a specific point
• If INDEXES YES, index copy log point must match table space copy
15
Click to edit Master title style
Copy Plus EXPORT example
OUTPUT EXPFILE UNIT WORK EXPOUT YES
DSNAME RDADMB.PBGMIG.EXPORT
EXPORT TABLESPACE DMDSRC*.*
EXPORTDDN(EXPFILE)
ATLOGPOINT LASTFULLCOPY
INDEXES YES
16
Click to edit Master title style
Recover Plus IMPORT command
• Automates the INCOPY technology
• The EXPORT runs on the source while the IMPORT runs on the target
• The object list names the table spaces to be imported
• TABLESPACE
• OBJECTSET
• No specification means import everything
• You have a choice on how to handle indexes
•
•
•
•
REBUILD
RECOVER
AUTO - let Recover Plus decide
NO - don’t process any indexes
• Command available to map object names from source to target
• Ability to migrate only data that has changed since last
EXPORT/IMPORT
17
18
Click to edit Master title style
IMPORT
TS
BMC
XCOPY
COPY
IC
IX
TS
BMC
XCOPY
IMPORT
SYSCOPY
IX
MIG
FILE
DB2
CATALOG
EXPORT
DB2
CATALOG
Click to edit Master title style
Recover Plus IMPORT example
IMPORT USING RDADMB.PBGMIG.EXPORT
NOCOPYPEND
INDEXES AUTO
SYNC AUTO
CHANGE TABLE
FROM RDADMB.DMDSRC* TO RDADMB.DMDTGT*
CHANGE INDEX
FROM RDADMB.DMDSRC* TO RDADMB.DMDTGT*
19
Click to edit Master title style
Recover Plus MIGRATE command
• Automates the INDEP OUTSPACE technology
• The EXPORT runs on the target while the MIGRATE runs on the
source
• The object list names the table spaces to be exported
• TABLESPACE
• OBJECTSET
• No specification means migrate everything
• Choices to handle indexes are limited
• Recovering the indexes is advisable
• Cannot rebuild the indexes with MIGRATE
• Must supply a model of the VSAM data set name
• Command available to map object names from source to target
20
21
Click to edit Master title style
MIGRATE
DB2
CATALOG
DB2
Catalog
TS
IC
EXPORT
MIGRATE
IX
Log
MIG
FILE
SYSCOPY
BMC
XCOPY
Click to edit Master title style
Recover Plus MIGRATE example
MIGRATE USING RDADMB.PBGMIG.EXPORT1
CHANGE TABLE
FROM RDADMB.DMDTGT* TO RDADMB.DMDSRC*
CHANGE INDEX
FROM RDADMB.DMDTGT* TO RDADMB.DMDSRC*
INDEP OUTSPACE
MODEL &VCAT.DSNDBC.&DB.&TS.I0001.&PART
22
Click to edit Master title style
Migration scenarios
• BACKOUT updates
• Log Master ongoing process
• Copy Migration refresh
23
Click to edit Master title style
BACKOUT updates
• IMPORT production to test
• On the source subsystem
• Create an OCC for the table spaces
• Execute Copy Plus EXPORT to create a migration file
• On the target subsystem
• Use Change Manager to
• Create the target objects
• Specify IMPORT to migrate the data
• Rebuild the indexes
• Execute Copy Plus to create copies of the new table spaces
• Perform testing
• BACKOUT AUTO to refresh data
• Forward recovery will be performed if one of the following occurs
• REORG
• LOAD
• REBUILD
24
Click to edit Master title style
Log Master ongoing process
• MIGRATE production to RO subsystem
• On the target subsystem
•
•
•
•
Use Change Manager to create the target objects
Create an image copy for the table spaces
Execute Copy Plus EXPORT to create a migration file
Stop the table spaces
• On the source subsystem
• Find and generate a quiet point with Log Master
• Run Recover Plus MIGRATE to move the data to the target VSAM
• On the target subsystem
• Start the table spaces
• Rebuild the indexes
25
Click to edit Master title style
Log Master ongoing process (cont.)
• Refresh from production
• On the source subsystem
• Collect Logical Log (LLOG) with Log Master ongoing process
• Use the quiet point from the MIGRATE as a starting point
• Specify end point with a date/time, LRSN or LOGMARK
• On the target
• Use High Speed Apply Engine to apply LLOG
• Repeat this process on a regular basis
• Some customers repeat as regularly as every 15 minutes
26
Click to edit Master title style
Copy Migration refresh
• IMPORT production to test
• On the source subsystem
• Create an OCC for the table spaces and indexes
• Execute Copy Plus EXPORT to create a migration file
• On the target subsystem
• Use Change Manager to
• Create the target objects
• Use Recover Plus to
• IMPORT the table space and indexes
27
Click to edit Master title style
Copy Migration refresh (cont.)
• Refresh test data
• On the source subsystem
• Create an OCC for the table spaces and indexes
• Execute Copy Plus EXPORT to create a migration file
• On the target subsystem
• Use Recover Plus to IMPORT with SYNC AUTO
• Only refreshes data that was changed on the source and/or the target
• No need to rebuild indexes
28
Click to edit Master title style
Summary
• BMC Software provides several different ways to
• Create consistent image copies
• Migrate data
• Refresh data
• Mix and match to suit your environment
• All options provide
• Speed
• Efficiency
• Ease of use
• If you would like a copy of this presentation
• We will be at the booth or email us
29
Phil Grainger
Donna Di Carlo
BMC Software
phil_grainger@bmc.com
donna_di_carlo@bmc.com
Session Code: 414
Recovery Management Solution
50 Ways to Move Your Data
(a.k.a., Make a New Plan Stan)
Evaluate my session online:
www.idug.org/na2013/eval
Download