Hi!

I’ve been an SAP Basis Administrador and Database Administrator for almost eight years, and this guideline helps me to do the fastest Homogeneous System Copy’s / System Refresh that I have known so far. Since I work in a somewhat demanding environment with tight schedules, sometimes the fastest solution is the best solution for my clients.

This is a guide that I’m working with my own personal experiences. All of the information can be found in the SAP Community Network. The respective links are in the guide as well as the respective appreciation for the people that have wasted time writing the posts. I just gathered the information.

Thank you for your time and effort.


Best regards

Rui Fontinha



MS SQL Server

Manual R/3 System Copy

     1- Important SAP Notes:

Note 1294762 – SCHEMA4SAP.VBS

Note 683447 – SAP Tools for MS SQL Server

Note 151603 – Copying an SQL Server database

     2 – Important: This method can be followed only for already installed systems (or) for System Refresh (Only works for Homogeneous System Copies).

     3 – Steps:

     Source System: 

    1. Stop SAP (R/3) System.
    2. Open the SQL Server Management Studio.
    3. Please note down the properties of your current DB.
    4. Take the DB offline.
    5. Detach the Database.
    6. Copy the Data (MDF, NDF) files and log (LDF) files to the Target system.

 

     Target System:

    1. Stop SAP (R/3) System.
    2. Open the SQL Server Management Studio.
    3. Please note down the properties of your current DB.
    4. Take the DB offline.
    5. Detach the Database.
    6. Rename source system  files <SID> with target <SID> in the Data (MDF,NDF) files and log (LDF) files as follow:

<SID>DATA1.mdf

<SID>DATA2.ndf

<SID>LOG1.ldf


    1. Attach Database for SQL Server in the target system using SQL Server Management Studio.
    2. Convert the Database to the new target system <SID> and schema using the SCHEMA4SAP.VBS from note 1294762. You can also run the STM Tool provided by SAP for the schema conversion from note 683447.
    3. Please do the Homogeneous System Copy Post Procedures.

     Additional Comments:

     Re: Schema4SAP vs. SWPM->System Copy->Database instance?

     Link: https://scn.sap.com/thread/3386983

     Beate Grötschnig

     Schema4sap.vbs does not touch anything else but the database. If offers two options:

     Schema repair and schema move.

     A schema repair script will fix all logins on SQL Server level and the mapping to the corresponding users in the SID DB. If any users or logins are missing,      the script will create them for you. If any authorizations or privileges are not set correctly the script will set them for you.

     The schema move script will move everything in your database into a different schema, e.g. if you copy the DB from P11 to Q11 you can use the schema      move to move all objects in the DB to schema Q11.

     SWPM in contrast does not touch DB level only. If you use SWPM for a system copy it will:

     – Install the SAP software on the target machine, install common system files, do all the schema move and schema repair tasks for you, and so on.

     Schema4SAP.vbs within the course of a system copy is useful if the target system is already fully installed and the only task you want to carry out is      refresh the target system with a new copy of the source DB. Then you can simply restore the source DB and use schema4sap.vbs to move and repair the      schema.

     If you want to copy a system to a host with no SAP being installed yet, you’ll have to carry out a full system copy with SWPM by following the system      copy guide.

     Regards, Beate.


EOF

To report this post you need to login first.

4 Comments

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

  1. Matt Fraser

    I recently brought it up to the team that manages SWPM that the old “SAP Tools for SQL Server” had a refresh option (using sapinst), which surprised them — they thought this could only be done with newer versions of NetWeaver. I pointed out that SQL Server Basis admins had been doing this for many years, and it was a disappointment to see the functionality be removed for all NW versions less than 7.1. Anyway, as a result of that conversation, they are investigating adding it back in (SWPM for 7.1+ already has a “refresh” option, but this is lacking in 70SWPM).

    Anyway, that aside, the one thing I would add here is that in most cases — for me, at least — it is a production system being copied, and taking it down to detach the database is simply not an option. However, it’s easy enough to copy a database by restoring from a backup, and this turns out to additionally have the advantage of only copying the backup file(s) over the network. That’s typically much faster, as the backup file is usually much smaller than the original database, especially with backup compression enabled.

    The other advantage of using backup/restore instead of detach/attach is the ability to copy a point-in-time snapshot, where the point in time may not be known precisely until after it has passed. We use this regularly for running parallel tests of payroll, where we want to capture a snapshot of production in the moment just prior to payroll exit.

    Cheers,

    Matt

    (0) 
    1. Rui Fontinha Post author

      Hi!

      You are 100% right! I forgot that you could do a System Refresh using a Backup Restore option 🙂 same rules apply tough if you want to change system SID.

      1. Convert the Database to the new target system <SID> and schema using the SCHEMA4SAP.VBS from note 1294762. You can also run the STM Tool provided by SAP for the schema conversion from note683447.
      2. Please do the Homogeneous System Copy Post Procedures.


      I’ve been using this procedure for Development and Quality Systems. Unfortunatly I have to follow another kind of procedures for Production Systems. Anyway, yeah! You can Restore a Production Backup  to a “Empty” Machine (Only with SQL Server Engine working).

      Thanks a lot for wasting your time and adding valuable information to this procedure 🙂

      Best regards,

      Rui.

      (0) 

Leave a Reply