An SAP system copy is one thing a SAP Basis administrator will undoubtedly be asked to do. It is common for companies to want their SAP test system to look like their production system and thus, will require a copy of SAP system. It may even be on a regular basis (i.e. quarterly). It is our intention to walk you through the steps of performing an SAP system copy by detailing (1) pre-copy steps, (2) copy steps, and (3) post-copy steps.
This procedure expects that the SAP system and Oracle are already installed and the system copy is just a database switch.
A. Pre-Copy Steps
- Note what date / time to which you will restore.
- Issue a freeze on transports to TEST. Emergencies will then go directly to PRODUCTION (if a different TEST system is not available).
- Note all transports that have not gone into PRODUCTION, but are in TEST.
- Note all transports that have gone to PRODUCTION after the date / time of the restore point.
- Shutdown SAP and Oracle on the TEST system.
- Remove all Oracle data files on TEST.
B. SAP System Copy Steps
|Copy files||Using the restore date and time, copy PRODUCTION data files, log files, and controlfile from tape to TEST.|
|Modify Control File||Modify the control file to match the directory paths for TEST.|
|Rename database||In SQLPLUS, perform the following command:
ALTER SYSTEM SET DB_NAME=<TEST SID> SCOPE=SPFILE;
|Recover database||Use the Sqlplus command:
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL TIME ‘YY-MM-DD:HH24:MM:SS’;
The date / time will depend on the time you want to restore to.
After this is complete, startup Oracle.
|Check R/3 Connection||R3trans –d
If R3trans –d does not give a 0 return code it will be impossible to start SAP correctly.
|Start SAP||Start SAP for the post-copy steps.|
C. Post-Copy Steps
|SLICENSE (Install the license for TEST)||Click Install -> Enter system number and key (You can get this from SAP Service Marketplace.)|
|RZ10 (Delete old profiles and Import existing profiles)||Choose the profiles of the PRODUCTION server Profile -> Delete -> All versions -> of a profile
Do this for all PRODUCTION profiles.
Then, import the correct profiles.
Utilities -> Import profiles -> Of active servers
|STMS (Create the appropriate system layout)||Delete the current transport routes and then create a new transport route by choosing the appropriate structure for your systems (Three systems in a group, Single system, etc.).|
|BDLS (Change Logical System Name)||Enter the old logical system name.
Enter the new logical system name.
Uncheck ‘TEST Run’ and ‘Check existence of new names in tables’.
|SE16 (Delete from tables)||Delete all entries from the following tables: ALCONSEG, ALSYSTEMS, DBSNP, MONI, OSMON, PHAI, SDBAD, SDBAH, SDBAP, SDBAR, DDLOG, TLOCK.
Enter the table name -> Enter
Choose all entries and delete.
|SE38 (to delete old and cancelled batch jobs)||Run program RSBTCDEL.
Choose * for job name and user name.
Choose ‘X’ for released, finished, cancelled, and delete with forced mode.
|SPAD (Convert all printers to TEST)||Utilities -> For output devices à Assign server
A list will display.
Enter the TEST spool server and choose Display List.
Convert all to the TEST server.
|SM59 (Adjusting RFCs)||Check and adjust the appropriate RFC destinations form PRODUCTION to TEST.|
|SM58 (Clean the transactional RFC)||Open the date range.
Enter * for the user name -> Execute
Delete all Errors
|SECSTORE (Change the secstore)||Go to tab ‘System Data Changed’.
Enter the system number and Migration key (from SolMan).
|RZ04 (Change OpModes)||Remove old OpModes and create the new ones.
Double click on the OpMode.
Delete the current distribution of work processes.
Goto Settings -> Based on current status -> Existing instances -> Set
|SMLG (Logon Groups)||Check the logon groups and delete the PRODUCTION logon groups and create the TEST logon groups.|
|SM13 (Delete Updates)||Delete old update requests.|
|SM12 (Delete Locks)||Delete old lock requests.|
|SM21 (Review System Log)||Check system log for any errors.|
|SPAD (Cleanup Spool)||SPAD -> Administration -> Cleanup Spool
Click all spool requests -> Continue
|SPAD (Spool Consistency)||SPAD -> Administration -> Check Consistency -> Delete all errors|
|SWU3 (Restart Workflow)||SWU3 -> Red beach ball icon
Not all will activate, but that’s okay.
|SM51 (Server Check)||Make sure all servers show up and are available.|
|SCC4 (Client Settings)||Make sure the client settings are correct.|
|SE06 (Change Settings)||Make sure Change Settings are correct.|
|STMS (Catchup Transports)||First, move the transports that went to TEST and not PRODUCTION. Next, move the transports that went into PRODUCTION after the freeze date / time.|
|SGEN (Regeneration of programs)||Choose ‘Regenerate Existing Loads’
Execute in background (This will run for a long time. It is okay to continue to work in the TEST system, however it will be slow as the regeneration takes a lot of resources).
This step is necessary for regeneration of SAP program(s).