db2 redirect restore using tsm

Upload: jaya-chandra

Post on 13-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 DB2 Redirect Restore Using TSM

    1/8

    Page 1

    Redirect Restore Of DB2 For an ABAP systemRedirect Restore Of DB2 For an ABAP system

    Overview : The redirected restore is intended to copy one database to

    another database with changed container layot!changed storage pathlayot"for atostorage enabled database# in the target database$

    Contents :

    1. Pre-requisite

    2. Steps in Source System

    3. Steps in target System

    4. Post-Copy Steps

    SourceSystem

    Target

    System

    DB2 DB2

  • 7/26/2019 DB2 Redirect Restore Using TSM

    2/8

    Page 2

    1. Pre-requisite :

    Update the tool brdb%brt (This tool is SAP provided) ad chec! "hether it supports

    autostorage or ot#

    The tool is a part o$ the SAP !erel (DB2%speci$ic !erel archive)

    &ogi as user adm#

    cd 'sapmt'SID'ee

    ecute *

    d+2cpp ,> +rd+-+rt %.

    2. Steps in Source System:

  • 7/26/2019 DB2 Redirect Restore Using TSM

    3/8

    Page 3The tool db2adult is used with Tivoli Storage Manager (TSM) to work with backup

    images.

    /or the target system to access the source system0s images o TS1 a priviledgeeeds to +e assiged to the target system0s data+ase admiistratio user "hich is

    typically d+2 i a SAP eviromet# Belo" is the commad to eecute thesame#

    db2ccp db2adutl grant user db2cc! on nodename ccc!ae2"cc! #or db ccp

    Success#ull$ added permissions #or db2cc! to access %%P on node ccc!ae2"cc!

    3# log i as root

    2# chage user to &''(D)adm> stopsap

    4# chage user db2&''(D)

    d+2stop

    I1P* i$ ot gettig do" the

    5 d+2 termiate6 agai

    5 d+2stop

    5 d+2start

    ,# 7hec! the +ac!up stored i TS1 usig this commad> d+2adutl 8uery $ull d+ srp odeame cccsrpe29srp o"er d+2srp

  • 7/26/2019 DB2 Redirect Restore Using TSM

    4/8

    Page &:ou ca 8uery the +ac!up images availa+le i TS1 o$ the source systemdata+ase# :ou ca ru this 8uery $rom either the source or the target system#

    ;# eerate the script usig +rd+-+rt utility+rd+-+rt =s %+m TI. %ts =replace

    ? 'd+2'?'d+2'd+2?d+2

    I$ Source SID ? SP 6 Target SID ? S@

    7ommad "ill +e

    +rd+-+rt %s SP %+m TI. %ts 233323C42 %replace

    SP?S@d+2srp?d+2sr8'd+2'SP?'d+2'S@

    -# Script "ill +e created "ith ame li!e SP9ED#scr i curret $older

    F# copy the script "ith ame #scr

    > cp TT19ED#scr #scr

    C# ope "ith vi editor &T'(D)$scr

    Search $or /E1 i the script G' H

    dit the lie li!e

    STE DATABAS SP%% Istace o"er user id ( d+2 )%% S555555555555555555555555555555

    %% US USI su % adm> startsap

    3#Tras$er the +ac!up image ad script $rom source system to target system

  • 7/26/2019 DB2 Redirect Restore Using TSM

    5/8

    Page '

    3. Steps in target System:

    3# &ogi to Target System as root#

    chec! sap istace status

    5 ps =ae$ Mgrep d"

    2# chage user to adm

    > stopsap

    A$ter success$ully stoppig the istaces> eit

    4# 7hage user to d+2

    ,# Start DB2 agai * d+2start

    1a!e sure Data+ase istace is ruig

    d+2 drop d+

    Stop DB2 agai * d+2stop $orce

    ;# Delete all sapdata ad saptemp directory $rom 'd+2'

    > rm =r$ sapdata saptemp

    -# 7reate e" directory "ith $ull permissio

    > m!dir sapdata3 sapdata2 sapdata4 sapdata, > chmod FFF sap

    F# Delete all the cotet $or the directory log9dir'ED

  • 7/26/2019 DB2 Redirect Restore Using TSM

    6/8

    Page

    C# chage directory to !db2!&T'(D)!restoread eecute the script

    d+2 %tv$ #scr

    # 1a!e sure that d+2 istace is ruig i$ ot ruig issue db2startto start the

    d+2 istace#

    The "arig ca +e igored#The "arig is li!e

    S@&32FF estore has detected that oe or more ta+le space cotaiers areiaccessi+le or has set their state to Nstorage must +e de$iedN#

    Eutput should +e li!e

    STE DATABAS TT1 7ETIUDB2****( The R+'TOR+ DATABA'+ command completed sccessflly#

    3# I$ oll$or"ard did0t $iished success$ully you "ill get this message

    33#:ou have to retrieve log $rom TS1 usig this commad *d+2adutl etract logs +et"ee AD d+

    odeame o"er

  • 7/26/2019 DB2 Redirect Restore Using TSM

    7/8

    Page

    The eecute *

    d+2 E&&/EOAD DATABAS complete#

    4. Post-copy Steps (on the target system) :

    3# 7hec! sap user eist or ot#

    5 cat 'etc'pass"d ad loo! $or sap

    2# 7reate sap user o$ source

    > useradd %create %c JSAP Data+ase 7oect UserJ %s '+i'csh %d'home'sap %g sapsys %m sap pass"d sap

    Also create a user d+2 o the target system#

    4# 7oect to the System Gas d+2 "hich "as ust createdH> d+2 coect to

    ecute the $ollo"ig *

    grat d+adm secadm o data+ase to user d+2grat d+adm o data+ase to user adm

    ,# logi as adm ad edit the +elo" $ile i the user0s home directory#

    vi ,!$dbenv-&hostname)$csh

    eample# vi Q'#d+ev9#csh

    Search $or the strig dbs-db%-schemaad set the varia+le as $ollo"s#

    /rom

  • 7/26/2019 DB2 Redirect Restore Using TSM

    8/8

    Page *setev d+s9d+-9schema sap

    To

    setev d+s9d+-9schema sap

    &ogo$$ ad logi agai as user adm so that the chage is i e$$ect#

    ;# Update pass"ord i dscd+-#co$ uder 'sapmt''glo+al usig the

    $ollo"ig commad *

    dscd+-up =create

    -# 7hec! schema user is coectig to DB2

    4tras =d ( it should retur value )

    C# Start target SAP applicatio

    >startsap

    ( ote * The SAP !erel level o the target should +e e8ual to or higher tha the

    !erel level o$ the source system )

    Disclaimer * This documet has +ee created durig a customer assigmet adthe cotets may ot $it eactly ito your sceario#