Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2013
    Posts
    5

    Unanswered: DB2 Redirect Restore

    Hello Experts,

    I'm a newbie for DB2.
    I'm facing problem while performing DB2 restore from one SAP machine to another. System Environment(both source and target system): AIX 6.1 with DB2 9.7 running SAP ECC 6.0 EHP5

    Im trying to restore ECP(source db) offline backup on ECQ(target db), through redirect restore. But currently I'm in middle to redirect restore. I followed these steps:

    1) Take offline backup of ECP

    2) Generated restore redirect script on source (ECP)

    db2 RESTORE db ECP from /db2/backup taken at 20130113150420 REDIRECT GENERATE SCRIPT /db2/backup/ECPrestore.clp

    3) Copied offline backup of ECP and the generated script file on test server.

    4) Edited the script file by replacing ECP(source db) with ECQ(target db) and run the script:
    db2 -tvf /db2/backup/ECPrestore.clp

    Hereafter, I got following message:

    SQL1277W A redirected restore operation is being performed. Table configuration can now be viewed and table spaces that do not use autostorage can have their containers reconfigured.

    DB20000I The RESTORE DATABASE command completed successfully.



    Please note that I was unable to execute from the originally generated script, so I edited the file, and finally executed following script:

    RESTORE DATABASE ECP

    FROM '/db2/backup'

    TAKEN AT 20130113150420

    ON '/db2/ECQ/sapdata1'

    , '/db2/ECQ/sapdata2'

    , '/db2/ECQ/sapdata3'

    , '/db2/ECQ/sapdata4'

    -- DBPATH ON '/db2/ECQ'

    INTO ECQ

    --NEWLOGPATH '/db2/ECP/log_dir/NODE0000'

    WITH 1 BUFFERS

    BUFFER 1024

    REPLACE HISTORY FILE

    REPLACE EXISTING

    REDIRECT

    PARALLELISM 1

    WITHOUT ROLLING FORWARD

    WITHOUT PROMPTING

    ;

    (please note that all my table space both in ECP(source) and ECQ(target) server is automatic.)

    5) Thereafter I executed following with error message:
    3CECQAS:db2ecq 4> db2 restore db ECP continue
    DB21080E No previous RESTORE DATABASE command with REDIRECT option was issued for this database alias, or the information about that command is lost.


    Now please let me know, how to proceed further. Also my db config parameter shows "Restore Pending = Yes"

    Also please note that the session through which I have executed the script is now closed (somewhere I read the that the full redirect restore activity should be performed from same session only)


    Please suggest in this situation how can I proceed further.



    Regards,

    Krishan

  2. #2
    Join Date
    Jan 2013
    Posts
    3
    Hi Kris,

    You do not need to do redirected restore if your db is with automatic storage. Just restore db with "into" command:

    db2 restore db <oldnamedb> from /db2/backup on /db2/newserverdir dbpath on /db2/newserverdir into <newnamedb> without rolling forward


    Rergards,
    Ivan

  3. #3
    Join Date
    Jan 2013
    Posts
    5
    Hi Ivan,

    Thanks for your input.

    But as of now I have already executed the script for redirect restore(as mentioned with initial details) :
    RESTORE DATABASE ECP
    FROM '/db2/backup'
    TAKEN AT 20130113150420
    ON '/db2/ECQ/sapdata1'
    , '/db2/ECQ/sapdata2'
    , '/db2/ECQ/sapdata3'
    , '/db2/ECQ/sapdata4'
    -- DBPATH ON '/db2/ECQ'
    INTO ECQ
    --NEWLOGPATH '/db2/ECP/log_dir/NODE0000'
    WITH 1 BUFFERS
    BUFFER 1024
    REPLACE HISTORY FILE
    REPLACE EXISTING
    REDIRECT
    PARALLELISM 1
    WITHOUT ROLLING FORWARD
    WITHOUT PROMPTING
    ;

    Please suggest how to proceed further. I'm having "Restore Pending=Yes".
    How can I revert it back, so that I can execute the command as suggested by you.

    Regards,
    Krishan

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    you can execute the suggested command..
    you could drop the db and execute the suggested command
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Jan 2013
    Posts
    3
    Hi,

    Please try following:

    db2 restore db ECP abort

    If that goes ok, then run your restore script again, just omit REDIRECT command:

    RESTORE DATABASE ECP
    FROM '/db2/backup'
    TAKEN AT 20130113150420
    ON '/db2/ECQ/sapdata1'
    , '/db2/ECQ/sapdata2'
    , '/db2/ECQ/sapdata3'
    , '/db2/ECQ/sapdata4'
    -- DBPATH ON '/db2/ECQ'
    INTO ECQ
    --NEWLOGPATH '/db2/ECP/log_dir/NODE0000'
    WITH 1 BUFFERS
    BUFFER 1024
    REPLACE HISTORY FILE
    REPLACE EXISTING
    --REDIRECT
    PARALLELISM 1
    WITHOUT ROLLING FORWARD
    WITHOUT PROMPTING
    ;

    regards,
    Ivan

  6. #6
    Join Date
    Jan 2013
    Posts
    5
    Hi Ivan,

    I tried the given command but its giving following error message:

    3CECQAS:db2ecq 5> db2 restore db ECP abort
    DB21080E No previous RESTORE DATABASE command with REDIRECT option was issued for this database alias, or the information about that command is lost.

    Regards,
    Krishan

  7. #7
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    so it means you can execute a restore again..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  8. #8
    Join Date
    Jan 2013
    Posts
    5
    Hi,

    Thanks Ivan.

    I re-executed the restore script (without redirect) and successfully completed the restore:

    3CECQAS:db2ecq 14> db2 -tvf /db2/backup/ECPrestore21.clp
    WITHOUT PROMPTINGORWARD
    SQL2540W Restore is successful, however a warning "2529" was encountered
    during Database Restore while processing in No Interrupt mode.



    Please let me know the steps hereafter. Should I execute and the restore will be completed (or there something else to be done):
    db2 restore db ECP continue


    Also please suggest if any post-restoration activity to be performed.


    Regards,
    Krishan

  9. #9
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    try to connect to db and see if all is ok.. (maybe rollforward needed... see message)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  10. #10
    Join Date
    Jan 2013
    Posts
    3
    Hi Kris,

    SQL2529W is standard warning message that tells you that target db will be overwritten with backup version during restore, that is ok. There is no post restore tasks in your case because you restored offline backup. Now you have to connect to target db and check your db2diag.log

    Also, read documentation more, everything is there for you.

    regards,
    Ivan

  11. #11
    Join Date
    Jan 2013
    Posts
    5
    Hi,

    Although my restore is successful. But I am facing problem while starting up my SAP application.

    When I start DB2 explictly it works fine:
    3CECQAS:db2ecq 24> db2start
    02/01/2013 14:15:15 0 0 SQL1063N DB2START processing was successful.
    SQL1063N DB2START processing was successful.
    3CECQAS:db2ecq 25> db2 connect to ECQ

    Database Connection Information

    Database server = DB2/AIX64 9.7.3
    SQL authorization ID = DB2ECQ
    Local database alias = ECQ



    However when I tried to start SAP application, it gives following error:
    3CECQAS:ecqadm 5> startsap
    Checking db6 Database
    Database is not available via R3trans
    -------------------------------------------
    02/01/2013 14:18:08 0 0 SQL1063N DB2START processing was successful.
    SQL1063N DB2START processing was successful.
    Database activated
    R3trans connect failed
    DB startup failed

    While surfing I get to know that after a redirected restore the new DB2 instance owner should have DBADM, SYSADM autority and should be able to drop the view. Means we need to do following before starting restore:
    DB2_WORKLOAD=SAP includes the setting DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON

    If this is not done than we need a SECADM user to grant DBADM, SYSADM, SECADM to your new instance owner. I executed following commands:

    3CECQAS:db2ecq 32> db2 " SELECT DISTINCT GRANTEETYPE, GRANTEE, DBADMAUTH from SYSCAT.DBAUTH"

    GRANTEETYPE GRANTEE DBADMAUTH
    ----------- ------------------------
    U DB2ECP N
    U SAPECP N
    U DB2ECP Y
    U ECPADM Y


    3CECQAS:db2ecq 33> db2 " SELECT DISTINCT GRANTEETYPE, GRANTEE, SECURITYADMAUTH from SYSCAT.DBAUTH"

    GRANTEETYPE GRANTEE SECURITYADMAUTH
    ------------------------------------------------
    U DB2ECP N
    U ECPADM N
    U SAPECP N
    U DB2ECP Y


    Please suggest how can overcome this error.
    Please note that I have restore db from ECP (source dbSID) to ECQ (target dbSID).

    PFA db2diag log file.

    Regards,
    Krishan
    Attached Files Attached Files

  12. #12
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    The last entry in the db2diag.log you attached is from 2013-02-01 14.07.13.536496+330 and "R3trans connect failed" is from ~14:18. SAP knows what "R3trans connect failed" means, we need the exact sql error code returned by db2. Did you try redoing restore after setting DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON to see if it resolves R3trans connect error?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •