db2 migration

49
Skill Ramp Up Session: SAP DB2 Migration Preparation IBM SAP DB2 Center of Excellence

Upload: jayanth

Post on 28-Nov-2015

132 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: DB2 Migration

Skill Ramp Up Session: SAP DB2 Migration Preparation

IBM SAP DB2 Center of Excellence

Page 2: DB2 Migration

23 May, 2008 2

Agenda – Day 1DB2 Overview

Product OverviewArchitectural Overview / DB2 Objects

Page 3: DB2 Migration

23 May, 2008 3

Agenda – Day 2DB2 Administration

Backup / RecoveryRUNSTATS / REORG Monitoring / TuningProblem determination

DB2 / SAP integrationDBA Cockpit SAP DB2 Tools

Layout planning for SAP / DB2 databasesTable space conceptsDesign recommendations

SAP migration overviewTerminology and conceptAvailable tools

Page 4: DB2 Migration

23 May, 2008 4

Agenda – Day 3Migration optimizations for DB2

Using DB2 load for SAP migrationsData transfer using socketsSAP incremental migrationSAP migration monitorIDS to DB2 optimizationsDB2 optimizations for migrations

SAP BW migrations specificsDB2 partition layoutMigration of partitioned tablesPost migration tasks

Page 5: DB2 Migration

23 May, 2008 5

What are we speaking about?

SAPSystem

SID

DB

TAB A

TAB B

InformixMS SQL ServerORACLE....

Migration

SAPSystem

SID

DB2

TAB A

TAB B

Export Import

Page 6: DB2 Migration

23 May, 2008 6

Workshop Migration Landscape

kitkat

NetWeaver 04 (SRC)

DB2 V8 FP12on LINUX

alete

NetWeaver 04 (TAR)

DB2 9.1 FP0on LINUX

Network

Page 7: DB2 Migration

23 May, 2008 7

SAP Migration Overview – Terminology and Concepts

YesYesSAP OS/DB Migration(heterogeneous system copy)

YesNoSAP DB Migration(heterogeneous system copy)

NoYesSAP OS Migration(heterogeneous system copy)

NoNoHomogeneous System Copy

Change of Database System

(DB)

Change ofOperating System

(OS)SAP Term being used

Page 8: DB2 Migration

23 May, 2008 8

SAP Marketplace - Informations

Quicklink: osdbmigrationFAQ-Section answers the most important questions about OS/DB Migration

What is it all about?Service Contract and Software DeliveryService Session DeliveryPlanning and performing the Migration

Page 9: DB2 Migration

23 May, 2008 9

SAP OS/DB Migration Check

Test the migrated System

Migration Test Run

Request Migration via OSS

SAP sends migration materials to customer

Customer chooses migration partner

Contractual arrangments with SAP

Customer draws up migration project

shedule together with Migration Partner

SAP checks and approves project plans

SAP ships migration tools

Going Live check

Final Migration

Going Live check

Going Live check

Analysis-Session4-6 weeks beforeon source system

Verification-Session2-4 weeks after

on target system

Next SAP - Upgrade

> 6 weeks

Page 10: DB2 Migration

23 May, 2008 10

SAP Migration QuestionairePrerequisite for the Remote Project AuditSAP-Questionaire.pdf

Page 11: DB2 Migration

23 May, 2008 11

Reasons for Copying a SAP System

RequirementTo copy a SAP System WITHOUT changing the OS or DBTo copy a SAP System WHILE changing OS and/or DB

Potential SolutionsClient transport?

(#96866 – Client copy tools not supported as system copy tools for productive systems)

Backup/Restore? (homogeneous or OS-Migration in some cases)

3rd party tools for data unload/load?Not supported by SAP

SAP system copy tools!Should be used (since 3.0D)

Page 12: DB2 Migration

23 May, 2008 12

Migration: The Backup / Restore processWith DB2 UDB Version 8, you can use redirected restore to create a Heterogeneous System Copy between two systems running on different platforms

Note 628156 - DB6: Cross-Platform System Copy using Backup/Restore with V8

Document:“Copying Your SAP/R3 System Across Platforms Using DB2 Universal Database V8 Redirected Restore”http://www-106.ibm.com/developerworks/db2/library/techarticle/0308nesiem/0308nesiem.html

Page 13: DB2 Migration

23 May, 2008 13

SAP Migration (Heterogeneous System Copy)Must be done by a SAP Technology Consultant with a special Certification for OS/DB-Migration (TADM70)SAP OS/DB Migration Service must be ordered for every productivesystem involvedCommon reasons

Hardware enhancementsPerformance improvementsAvailability of new technologiesAdministrative efficiencyCost reductionStandardization through group-wide platform strategyUNICODE-Conversion

Page 14: DB2 Migration

23 May, 2008 14

SAP Migration – typical challenges

Export Long runtimesInsufficient storage space in the export filesystemNot enough temporary database space for sorting (PSAPTEMP)Inconsistencies between ABAP dictionary and DB dictionary(QCM-tables → SAP Note 9385)

ImportLong runtimesDatabase space problems (tablespace, log space)Not enough temporary database space for sorting (PSAPTEMP)Permission problems on import files and directories

Page 15: DB2 Migration

23 May, 2008 15

Migrating a System Landscape

Two different strategiesDEV, QAS, PRD are all migrated (PRD as much test migrations as needed)

DEV and PRD are migrated, QAS is build up by homogeneous system copy

DEVQAS PRD

1x 1x >1x

DEVQAS PRD

1x 0x >1xsystemcopy

> 3 migrations

> 2 migrations

Page 16: DB2 Migration

23 May, 2008 16

Basic Definitions and Relationships

DBTSD

TAB(TA) TSI

IND_P

IND_S

TABARTTA

DD09LTABART↔Tab.

TA<DBS>TABART →TSD

TG<DBS>Table Stor. Param.

TS<DBS>DB Storage Units

SAPTA.STR

SAPTA.EXT

SAPTA.TSK

IA<DBS>TABART → TSI

DDARTTABART

IG<DBS>Index Stor. Param.

Definitions Tables Files

Package

Page 17: DB2 Migration

23 May, 2008 17

Types of TABARTs

Pool TablesPOOL

Source of screens and reportsSSRCDimension tablesDDIMBW / BIODS, PSA tablesDODSFact tablesDFACT

Repository switch (SAP Upgrade)SSEXCRepository switch (SAP Upgrade)SSDEFSpool and logsSPROTScreen and report loadsSLOADRepository switch (SAP Upgrade)SLEXCRepository switch (SAP Upgrade)SLDEFDocumentationSDOCUABAP Dictionary tablesSDICExchange tables for UpgradesSAUSSystem

Cluster tablesCLUSTSpecialCustomer data classUSER, USER1Organization and customizingAPPL2Transaction data, transparent tables (big tables)APPL1Master data, transparent tablesAPPL0DataUsageTABARTType

Page 18: DB2 Migration

23 May, 2008 18

ExcerciseHow many tables belong to which TABART?

select tabart,count(tabart) as "Tabs in TABART"

from sapsrc.dd09l group by tabart

Page 19: DB2 Migration

23 May, 2008 19

Excercise (continued)How many tables belong to which TABART?

select tabart,count(tabart) as "Tabs in TABART"

from sapsrc.dd09l group by tabart

Page 20: DB2 Migration

23 May, 2008 20

Excercise (continued)Same as before, but additionally with tableclassselect d9.tabart,

d2.tabclass, count(d2.tabclass)

from sapsrc.dd09l d9, sapsrc.dd02l d2

where d9.tabname=d2.tabname group by d9.tabart,

d2.tabclass

Page 21: DB2 Migration

23 May, 2008 21

Migration with R3load – Process Overview (< 6.x)

Page 22: DB2 Migration

23 May, 2008 22

Migration with R3load – Process Overview (≥6.x or BW)

Page 23: DB2 Migration

23 May, 2008 23

Migration Preparations (1)

Retrieve lastest SAP NotesHomogeneous/Heterogeneous system copyInstallation

Operating System LevelSet up the migration file systems / directoriesInstall migration toolsDe-schedule all OS/DB data backupsShut down external interfacesMake sure that the database is not being accessed during the export

Page 24: DB2 Migration

23 May, 2008 24

Migration Preparations (2)

Database LevelRun update statistics or other performance-relevant activities

SAP System LevelDelete unnecessary data (Spool, test clients)De-schedule all SAP jobs and data backupsRelease all repairs and corrections if changing SAP SIDDB02: Missing tables/indexes – compare?Check for DB-specific modificationsReport SMIGR_CREATE_DDL (create <TABART>.SQL files)Stop the SAP System

Page 25: DB2 Migration

23 May, 2008 25

Create R3load CTL files

R3szchkR3ldctl

DBR

ead

Write DDL<DBS>.TPL

SAP<TABART>.STR

SAP<TABART>.EXT

DDLOADDFiles

Tables

DDLOADHRead

Write

some minutes

up to several hours (check SAP Note 558746 if runtime is >> 2 hours)

Page 26: DB2 Migration

23 May, 2008 26

ExcerciseRun R3ldctl and put the files to /mig_exp/test, the logfile should be named test.log

R3ldctl -l test.log -p /mig_exp/test

Page 27: DB2 Migration

23 May, 2008 27

Excercise (continued)Run R3ldctl and put the files to /mig_exp/test, the logfile should be named test.logR3ldctl -l test.log -p /mig_exp/test

Page 28: DB2 Migration

23 May, 2008 28

Create template for DB-Size

R3SZCHK generates DBSIZE.XML for SAPINST on targetR3SETUP generates DBSIZE.TPL for R3SETUP on targetstep runs some minutes

Page 29: DB2 Migration

23 May, 2008 29

Create R3load *.cmd and *.TSK Files

runs a few minutes

DDL<DBS>.TPL

<PACKAGE>.STR

<PACKAGE>.cmd

<PACKAGE>.TSK ≥ 6.10 only

<PACKAGE>.cmd

[tsk: .../<installation>/<PACKAGE>.TSK]icf: .../DATA/<PACKAGE>.STRdcf: .../DB/DDL<DBS>.TPLdat: .../DATA bs=1K fs=1000Mdir: .../DATA/<PACKAGE>.TOC

Page 30: DB2 Migration

23 May, 2008 30

Unload DB with R3load

R3load

DB

read DDL<DBS>.TPL

read

<PACKAGE>.STR

write <PACKAGE>.TOC

<PACKAGE>.nnn

read / write

<PACKAGE>.log

<PACKAGE>.TSK

STOP

Do not use NFS (write)!

This step can take from some to many hours!!

Page 31: DB2 Migration

23 May, 2008 31

File Transfer (1)FTPTapeDVDUSB disk devicesLaptop with high capacity disk driveNetApp device

Be sure to use a safe copy method!!!

Page 32: DB2 Migration

23 May, 2008 32

File Transfer (2)

<PACKAGE>.STR<PACKAGE>.TOC<PACKAGE>.nnn

<export_dir>/DATA

<PACKAGE>.EXTDBSIZE.{TPL|XML}<TABART>.SQL (if exists)

<export_dir>/DB/<target_DBS>

DDL<target_DBS>.TPL<export_dir>/DB

LABEL.ASC<export_dir>

Filename(s)Directory

Do not transfer files from the <installation>-directory !! (*.cmd, *.TSK)

Page 33: DB2 Migration

23 May, 2008 33

Create SAP Instance

Install Central InstanceSame procedure as in a standard SAP installationInstall latest backwards-compatible SAP kernel

Install the database softwareSame procedure as in a standard SAP installationInstall the latest database patches

Check SAP product „platform / release“ combinations!

Page 34: DB2 Migration

23 May, 2008 34

Get Migration Key

Logon to SAP Marketplace.Use an S-User valid for the installation number of the

source system

Alias „migrationkey“

Accept migration key license agreement Customer task

Select installation number of the SOURCE system

Provide migration parameters Case sensitive!

Check migration key as soon as possible!

Note 338372 - Migration key does not workGives hints how to choose the right values for the fieldswhen acquiring a migration key.

Page 35: DB2 Migration

23 May, 2008 35

Create DB

Determine the DB configurationSize the table spacesDistribute the table spaces (disk layout)Configure the database logs (size, number, primary, secondary)Adjust DBSIZE.{TPL|XML}

Create DBMay be very time-consuming when large databases are involved (big table spaces)Can take place in parallel to the unload of the source DB

Page 36: DB2 Migration

23 May, 2008 36

Import Data with R3load

R3load

DB

read DDL<DBS>.TPL

write

<PACKAGE>.STR

write

<PACKAGE>.EXT<PACKAGE>.TOC

read / write

<PACKAGE>.log

<PACKAGE>.TSK

This step can take from some to many hours!!

<PACKAGE>.nnn<TABART>.SQL

Page 37: DB2 Migration

23 May, 2008 37

Migration Post Processing (1)

Operating System LevelABAP / DB DDIC consistency check SAP licenseCopy external SAP system files (job logs, archives, external spool files, interface data, etc.)Access to transport directoryExternal interfacesPerform file system backup

Page 38: DB2 Migration

23 May, 2008 38

Migration Post Processing (2)

DB LevelDB backupDB restore testUpdate statistics or other performance-relevant activitiesDB parametersDelete old SAP system monitor and statistics data

Page 39: DB2 Migration

23 May, 2008 39

Migration Post Processing (3)

SAP System LevelTransaction SICKInitialize TMS if SAPSID has changedConfigure TMSRegenerate ABAP LoadsSchedule Batch-Jobs (check if jobs are defined with target server, change if necessary!)Schedule data backupsAdjust printer definitionsAdjust RFC destinations, profiles and operation modesCheck that the install RFC reports have finished successfully

Page 40: DB2 Migration

23 May, 2008 40

Migration Post Processing (4)

RS_BW_POST_MIGRATIONVariants: SAP&POSTMGR, SAP&POSTMGRDB (DB was changed)Connect all data source systems to the target systemMake sure that the data source systems will keep active while the report is runningRun the report in background mode (may take several hours)Check spool protocol carefully

Page 41: DB2 Migration

23 May, 2008 41

Post Migration Test Activities

Functional tests (compare results to those in source system)Typical transactions from day-to-day businessCritical transactions (runtime tests)Performance tests under heavy loadTest month closing activities / reportsVerify communications to external systems (be sure not to mix test and productive data)Create a cut-over plan for the final migrationInclude the end users into the test procedure (key users, normalusers)

Page 42: DB2 Migration

23 May, 2008 42

Migration Scenarios

SAP Standard Migration ToolUse R3setup / SAPinst dialogs and run R3load for export and import without special options

IBM DB2 Fast MigrationUse unsorted export (Note 954268 - Optimization of export: Unsorted unload)Use R3load „fast LOAD“ option for DB2 to use DB2 Load API instead of insertsUse socket option if possible

Incremental MigrationUse if no other procedure is possible during downtime

Note 454173 - DB6: R3load migration accelerated with CLI LOAD API

Note 864861 - ORACLE DIRECT PATH LOAD SUPPORT IN R3LOAD 6.40 AND ABOVE

Page 43: DB2 Migration

23 May, 2008 43

SAP Standard Migration ToolSAP migration tool needs to be orderedNew license key required for target systemData unloaded into database independent formatData transferred from one system to another via flat file (e.g. FTP)Capacity: ~ 400 GB per weekendSource system needs to be available until SAP approval

Source

DB

Target

DB

ŽExport ImportTransfer

Capacity: ~ 400 GB/weekendHowever: 800 GB achieved in 60 hrs (~13,5 GB/h) incl. admin. tasks

Page 44: DB2 Migration

23 May, 2008 44

IBM DB2 Fast MigrationUnload, Transfer & Load done in parallel

Multiple processes, multiple sockets

Use of DB2 Load vs. DB2 InsertUse of sockets instead of filesEligible SAP systems

Capable of using SAP 4.6c kernelDetailed analysis needed

SAP authorization neededCurrently only SAP-internal IBM migration team authorized

Sockets

UnloadTransfer

Load

Ž

DB2 LOAD

Source

DB

Target

DB

Capacity: 800 GB in 22 hrs (~ 36,5 GB/h)Max. capacity depending on available hardware

Page 45: DB2 Migration

23 May, 2008 45

Incremental MigrationMigration happens in 3 phaseThe 30 largest tables are migrated while the productive system is running

Create shadow tables with additional columns for timestamp and row action for largest tables to track changes

Remaining tables are migrated on a weekend during downtime

Approx. 20%

Source Target

Initial Load

Apply Changes

Transfer Rest

Onl

ine

Offl

ine

Capacity: no specified limit on total DB size; process limited by size of largest tables and change rates

Page 46: DB2 Migration

23 May, 2008 46

Criteria for choosing the right methodSocketFastloader

DW < 48hDB < 2TB

Incremental MigrationDW < 24hDB > 2TB

Standard ProcessDW > 60h

DB < 500GB

FastloaderDW < 48DB < 1TB

DW: Downtime WindowDB: Database Size

Page 47: DB2 Migration

23 May, 2008 47

Directory Structure

/<installation>

<export>

/DB

/DATA

/DB6

...

...

TSK - cmd - log

DDL<DBS>.{TPL|XML}

SQL - EXT

STR - TOC - nnn

<sap-instance>/j2ee/sltools EXPORT.STA

/APPS *.SAR(application data

stored in filesystem)

/JDMP XML – EXPDUMP.nnn

/SDM SDMKIT.JAR

ADSKMPORTAL

Page 48: DB2 Migration

23 May, 2008 48

Tools - Files - Directories

6

5

4

3

2

1

<export>/DATA<export>/DATA<installation>

<Package>.TOC<Package>.nnn<Package>.log

R3load

<installation><Package>.cmdR3setup / SAPinst / MigMon

<installation><Package>.TSK

(since 6.10)R3load

<export>/DB/<DBS><Package>.EXT

[DBSIZE.{TPL | XML}]R3ldctl / R3szchk

<export>/DB<export>/DATA

DDL<DBS>.TPL<Package>.STR

R3ldctl

<export>/DB/<DBS><TABART>.SQL

(since 6.20)SMIGR_CREATE_DDL

DirectoryFileTool

Page 49: DB2 Migration

23 May, 2008 49

Questions ?

? ??

??

???

!!

!

!

!