IT
Use this simple procedure for your system refresh and you can get and test the latest scenarios, materials, views, and sales area data on a quality assurance server (QAS) instead of the production server. Aside from regulatory compliance, there are many benefits to carrying out regular SAP system refreshes. The main benefit of replicating live data into a QAS is that it provides an isolated environment away from the main business operations where developers and test teams can test in conditions as close to those in production as possible.
Key Concept
In a typical SAP system, the production data set is periodically copied onto the quality assurance system to allow full testing of customization and development changes made to the live SAP system. This is because developers and functional users can’t check and test business scenarios on a live (production) system.
As an SAP functional expert or developer, you need to check and test scenarios that you can’t test on a live server in order to fulfill business requirements. You need a system in which you can perform full testing of customization changes. This is a step-by-step guide to making a system copy of SAP production in the SAP quality assurance server (QAS). The QAS provides an isolated environment away from the main business operations. The production server is the source system and the QAS is the target system.
Note
All activities have been performed on a Windows Server 2008 and Oracle database. I have used this procedure with SAP ERP Central Component (ECC). If you use SAP Customer Relationship Management (CRM), Product Lifecycle Management (PLM), or Supply Chain Management (SCM) along with an Oracle database then you can use this procedure. However, HANA is a different database so you cannot perform these activities with it.
Target System
Start by logging into the target system, which is the QAS. You need to stop the target system because you can’t paste the files from the production server if the SAP I/O is running. You can stop the SAP system via the SAP Management Console, as shown in
Figures 1 and
2. To stop the target system, go to the SAP Management Console via menu path Start > All Programs > SAP Management Console. Right-click the SAP System button in the SAP Management Console
and then click Stop, as shown in
Figure 1.
Figure 1
Stop the system
The system stops after few minutes. The status of the process is changed to Stopped as shown in
Figure 2.
Figure 2
System stopped
As I mentioned above, you cannot move data files if the database I/O is running. Therefore, you need to shut down the Oracle database and services. You can stop the database via the shutdown immediate command or you can do it via menu path My Computer > Run > SQLPLUS / as sysdba SQL> shutdown immediate (
Figure 3).
Figure 3
Shut down the Oracle database
Now you need to stop the Oracle services with the help of service.msc. It is a Windows program from which you can start and stop the services. You can access it via menu path My Computer > Run > services.msc. The window shown in
Figure 4 opens. Select all the Oracle services and stop them by right-clicking.
Figure 4
Oracle services stopped
Source System
Now, you put the database of PRD on backup mode with the Begin backup command. This is used to move all data files in the database into online backup mode.
Figure 5 shows the following command: SQL> alter database begin backup;. You also need to create a backup of the control file of the source system. The following command backs up the control file in a binary format. You can create the control file on the source system with the help of the command SQL> alter database backup controlfile to trace AS ‘E:QASCTL.TXT’; (
Figure 5).
Figure 5
Alter the database for moving files
Access the drive of the target system in which the SAP data files exist. You can access it via menu path My Computer > Run \172.20.0.xyz of the target system. Move the sapdata files and newly created controlfile (QASCTL) from the source system (PRD) to the target system (QAS ) by copying and pasting the function as shown in
Figure 6.
Figure 6
Move files from the source to the target system
When the highlighted files are moved, put the database in normal mode of the source system with the help of the end backup command, shown in
Figure 7. This command specifies that the system take any data files in the database currently in online backup mode out of that mode. You need to force the log switch, which you can do with the alter switch command in
Figure 7.
Figure 7
Alter the database for normal mode
Target System
Open the Services screen via menu path My Computer > Run > Services.msc. Start Oracle services by right-clicking all the highlighted services (
Figure 8). The files are successfully copied on the source system as shown in
Figure 6. Now you need to start the Oracle service by right-clicking the service.
Figure 8
Start the Oracle service
Open the control file on the target system that you created in
Figure 5. Open the Replace window via the shortcut key CTR+H. Rename the SID from PRD into QAS in the controlfile as shown in
Figure 9.
Figure 9
Replace the SID
Delete the current controlfiles from following folders:
- G:oracleQASoriglogAcntrl
- G:oracleQASoriglogBcntrl
- G:oracleQASsapdata1cntrl
Create new control files with the help of the highlighted commands in
Figure 10.
Figure 10
Create control files
Run the following command to recover the database as shown in
Figure 11: SQL > recover database using backup controlfile until cancel;.
Figure 11
Find the request number on the source system
You need to archive with the highlighted sequence number for successful recovery. You can copy this archive from the PRDarch folder of the source system and paste it in the QASarch folder of the target system as shown in
Figure 12. Database recovery requires a sequence number. Note this sequence number, copy the archive that corresponds to this number from the source system, and paste it on the target system. Apply this via the recover command, which is shown in
Figure 11. Copy the archived log files from the source system to the target system—from (9129) to that archived log file (9133) that was created on the source system (
Figure 12).
Figure 12
Copy the archive from the source to the target system
When the archives are successfully applied, execute the recover command with the auto option as shown in
Figure 13. When you execute the recover command you see the auto option under Specify log:.
Figure 13
Apply the archive
When all the archives are successfully applied on the target system you can then open the database using the resetlogs command. This command resets all your logs and opens the database. Next, recreate the new TEMP tablespace (TMP file) (
Figure 14). The new control does not have the entry for the TMP file so you now need to create the TMP file. You can do this using the alter command shown in
Figure 14. As a temporary database, the TMP file is mainly used for the intermediate storage of temporary data.
Figure 14
Add the file in the temporary (TEMP) tablespace
Drop the User of the Source System
Now you need to drop the OPS$ mechanism users from the target system because it belongs to the source system. You can drop it via the drop command shown in
Figure 15.
Figure 15
Delete OPS users
Recreate the OPS$ user by using the ORADBUSR.SQL script (
Figure 16). You can download this script from
SAP Note 50088 – Creating Ops$ users on Windows NT/Oracle.
Figure 16
Recreate OPS users
You need to change the PASSWORD of the schema user SAPSR3. Do this with the BRCONNECT tool shown in
Figure 17.
Figure 17
Change the password
Check the user status of SAPSR3. If it is locked then unlock it. You can check the status of the user and account by checking the SQL interface shown in
Figure 18. You can go to
Figure 18 by following the menu path My Computer > Run > SQLPLUS / as sysdba.
Figure 18
Check the user and account status
Open the SAP Management Console on the target system as shown in
Figure 19.
Figure 19
Open the SAP Management Console
To ensure the system is running successfully you need to start the SAP system via the SAP Management Console. Right-click the SAP Systems button, then click the Start button, as shown in
Figure 20.
Figure 20
Start the SAP system
Muhammad Abdul Jamil
Muhammad Abdul Jamil is an SAP Basis Administrator at the Orient Group of Companies. He has more than four years of SAP Basis experience. He has a degree in computer science and has worked in industries such as Beverages, Home Appliances, Food, and Chemicals. Previously, he worked at Siemens Pakistan Consulting and he completed four SAP projects (E2E) as a SAP technical (Basis) consultant at Siemens Pakistan Consulting.
You may contact the author at
majamil1@hotmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the
editor.