DB Refresh using HANA Studio DB Restore  with SID Modification –  NON SAPinst

HANA Studios DB restore option and hdbuserstore there after makes the whole process of a  System copy a lot simpler . The only limitation would be that the target schema would still remain as source.

The idea of this blog is to explain the process of performing  a simple homogeneous system copy of a HANA based system using the recovery of the source backup on the target HANA DB using HANA Studio.

In this case ,we will be  considering a situation of copying a Prod backup and refreshing it in a already running quality system

These are the salient steps involved in achieving this

Step 1 ) Take a complete DB backup of the source Database

Step 2) Move the database backup to the Target system

Step 3) Using HANA Studio recover the source db in the target HANA box

Step 4) Supply the license text so that the HANA Studio can automatically apply the license after install

Step 5) Modification of Schema access at the target DB

Step 6) Modify the default key  using the hdbuserstore on the application servers  and DB instance.

Step 7 ) Start sap

Step 8 ) Post activities.

Activities in the Source System :

Step 1 – Backup of the source DB .

Use the HANA studio backup studio to take a complete DB backup either at the disk level or using Backint.



image Courtesy : SAP HANA Backup/Recovery Overview by Andrea Kristen in SCN

Usually this should be sufficient to perform a DB Refresh but if you are looking for a  point in time recovery you may want the backups from the log area as well to include them post the recovery.

Step 2 ) : Move the database backup to the Target system

Once the backup is completed you will have to move the backup to a location in the target system , you should have 4 separate files with the your backup prefix . In this case the prefix is “COMPLETE_DATA_BACKUP_20122015”





Activities in the Target system

Step 3 ) Using HANA Studio recover the source db in the target HANA box

→ Shutdown SAP Application alone

→ Open HANA Studio and right click on the SID ( target) where you want to perform the recovery.

You will have to specify the destination location and the Backup Prefix for the HANA studio to recognize the backups .

If you just have a Complete data backup and not planning to recover log segments you can select the option “ Initialize Log area”… This is something like reset logs in oracle.

Step 4) Supply the license text so that the HANA Studio can automatically apply the license after install

  Post recovery your existing HANA License will be invalid , so here is a opportunity to mention the license text so that that can be installed automatically. If not this can be performed manually later.

Step 5 ) Proceed with the recovery . Please note that the Target and source version must have the same configuration. Is there are specific configuration thats required in the target system that can be done manually as part of the Post steps.

Post recovery you should be able to see the Overview tab in HANA Studio with the Memory and Host Details.

However you may expect to see all the schemas under Catalog but it will error out as below. Same would occur when you try to expand Content.

The reason being the new SID will probably be looking for a schema name as SAPSID and it cannot find it , so there are few changes that need to be done in the target system

Step 6) Modify the default key hdbuserstore on the application servers and the DB instance.

  • Go to /usr/sap/<SID>/hdbclient   and execute the below

hdbuserstore set default <dbhost>:<dbport> <dbuser> <dbpassword>

Let say for example our target host is : host01 and Source SID is  PRD and System No : 00  and lets assume that the source schema is SAPPRD and its password is sapprd#!

hdbuserstore set default host01:30015 SAPPRD sapprd#!


The above example is for the Unix system for Windows its a bit different (Refer SAP Note 1709838)


Execute a hdbuserstore list you should find the new Key set as below

KEY DEFAULT

   ENV:host01:30015

User: SAPPRD

This confirms that the key is set .

This has to be done on the appservers , else R3trans -d would fail.

Go back to HANA Studio and you should be able to see the contents under Catalog and Contents. You should also find the source Schema under Catalog.

At this point there is one more thing that needs to be done before we start the apps on the target system.

go to the DEFAULT profiles and modify the /dbs/hdb/schema to SAPPRD ( or whatever your source schema is ) .

At this point you are good to start SAP.

Follow the standard Post Refresh activities from there..

Few points to remember

– > You may want to disable the btc processes before starting SAP

→ Perform standard post steps like SE06/STMS/BDLS etc and activities specific to your case.

To report this post you need to login first.

25 Comments

You must be Logged on to comment or reply to a post.

  1. Sharad Pandey

    Thanks , but tell me one thing that i want to keep the schema of my Quality system same say” SAPQAS” and not SAPPRD.

    Can you let me know if we have to go for SYSTEM RENAME for HANA.

    (0) 
    1. Gerard Christopher Post author

      Sharad,

      if you want to retain the scehma as SAPQAS , one option would be to use SWPM and perform a R3load export/import.

      Rename is to rename the Host and may not effect a schema change.

      I have read about schema mapping  but at a high level i think SWPM export/import would make more sense. Never tried schema mapping though.

      (0) 
    2. Avinash Ganne

      Sharad,

      You can change the SID of the target system. But you cannot change the name of the database schema(Bakup/Restore) method. I have done multiple system copies with Backup and Restore for the HANA.

      As Gerard said above(Export/Import) ..it might be possible for schema rename from the HANA directory with rename option with the Binary Export/Import. Haven’t tried yet to see if that works 🙂  

      Regards,

      Avinash

      (0) 
  2. Sharad Pandey

    Hi Gerard – We are trying to perform S/4HANA on SAP HANA SPS10 DB refresh and we performed hdbuserstore and other done religiously , but still there is an issue while running R3trans -d .We followed OSS Note –     2154997 but it also did not work. Do we need to do the run of rssecsfx for SAP HANA 10 onwards. Could you comment to help us on solution of the problem.

    (0) 
  3. Prem Sukh Bishnoi

    Hi,

    Lets say production system database  backup is configured via  backint (not file system) and now is there any way that i can restore that backup taken via backint to preprod or quality system directly ?

    Regards,Prem

    (0) 
    1. Avinash Ganne

      Hi Prem,

      What backint tool are you using? For example in our case we are using Backint (EMC DD Boost). While performing the restore we make changes to the configuration files of backint of quality system to point to production backint configuration and then choose the backup(production) you want to use to restore to a specific date or time. Once the restore is complete then point back the backint configuration files to quality settings.

      Hope this helps

      Regards

      Avinash

      (0) 
      1. Prem Sukh Bishnoi

        Ok thanks for reply. What would be impact on production data  and log backup using the same API to recover the data to qaulity. Lets assume that recovery time is 6hrs-8hrs.

        Regards,

        Prem

        (0) 
  4. Avinash Ganne

    Prem,

    There is no impact as you are not stopping the backint to perform backups for the Production.

    You  are making changes to the quality system backint configuration files to point to production in order to fetch the backups from the backup catalog of the production backint.

    Make sure you point back the config settings to Quality once the restore is complete. Otherwise it will mess up production backups

    Regards,

    Avinash

    (0) 
    1. Maruthi chandrasekhar

      Hi All,

      I believe Schema owner is not possible after Hana backup/restore using Hana Studio. To avoid confusion We have used generic schema name as “SAPBIW” while migrating our BW on oracle to Hana database.

      Regards

      Maruthi

      (0) 
  5. Derek Barrett

    Very nice, seems like it works.

    My only concern though is that when running R3trans -d, the NTAB still refers to the production system. Does anyone have a step to resolve this one? The SWPM seems to change this pointer.

    Thanks !

    (0) 
  6. RamaKrishna Velidandi

    Blog is very informative.. Thanks. Need expert advice in below scenario.

    Our current environment is as ECC – SLT – HANA (version 10) which is sidecar approach

    whenever we refresh ECC (no-production) system, selected tables will replicated to HANA, which will take almost 6-7 days workload.

    Inorder to optimize, Would like to cut down time avoiding replication from the scratch.

    >Idea is to backup/restore of ECC-SLT-HANA to non-prod environment, later how to proceed further to bring to operational state.

    Can you suggest how it can be achieved, please share if you have useful links/docs info.

    Thanks
    Ram

    (0) 
  7. Rodrgio Aoki

    Hello,

    Very helpful for a fast refresh of QA running ECC/ ABAP.

    Does anybody have a recipe for WAS Java? We made a database refresh where the backup contains both ABAP and Java schemas. The main procedure (using SWPM) recovered the entire database and executed the post restore steps for ABAP.

    And now… what to do to executing the post installation steps for WAS Java?

    Regards,
    Rodrigo

    (0) 
  8. Ahmed Mohammed

    Hi Gerard,

     

    is this Applicable for Multitenant Database Container, where i would like to Copy production Tenant database to a Quality Tenant Database..

    Any Suggestions will be appreciated.

     

    Regards

    Ahmed Mohammed

     

    (0) 

Leave a Reply