Step by Step Procedure to copy a Client to the Remote SAP Server

Step by Step Procedure to copy a Client to the Remote SAP Server.

•Logon to destination SAP server
•Use Transaction Code SCC4 
•Go to change mode 
•Create a new client, assign client number & description as per request 
•Logoff from current client. 
•Login to newly created client in destination SAP server using the following credentials :

i. Client Number : Newly created one
ii. User Id : SAP*
iii. Password : PASS



•Use Transaction Code SM59 to create a RFC Connection for client copy if does not exist already. 
•RFC Connection should have Target Server as Destination and the test results should say “Connection test OK” 
•Use SCC9 Transaction code to go to client copy screen. 
•Give profile as per the request. 
•Select RFC destination created for the purpose for the source client to client copy 
•Use Transaction code SCC3 for monitoring the progress of client copy
___________________________________________________________________

Golden rules for CLIENT Copies

1. Master data can not be copied without copying transactional data and transactional data can not be copied without copying master data.

2. Application data (transactional and master) should not be copied without copying configuration data.

3. Client copy requires a valid client as the destination client. Make sure that the client exists in T000 table and you can logon to that client.

4. The transport system and the transport management system of 4.0 are the only proper tool to be use to keep multiple systems in sync by transporting development and customizing changes to another instance.

5. When you copy a client from one system to another, client-independent tables should only be copied if they are not yet modified in the target system.

6. We recommend the users to read all the OSS notes regarding client copy that applies to their SAP release. It is always better to schedule the client copy job in the background for the night run when normal work is not taking place.

7. Always check the database space before performing a client copy.

8. To avoid data inconsistencies all the users working in the source and target clients should logoff from the system.

9. RSCLICHK program should be run in the target system remotely before doing a client export. This program will give information about the missing definitions from the data dictionary in the target. After executing this program and getting successful results you can ensure that the client copy will have no problems. In case some tables are different; you can use SE11 to compare and adjust the table structure in both the system before the client copy. A remote test client copy also can be executed to know the differences between source client and target client.

10. If you are not in release 2.2 then do not use R3trans to copy a client.

Client Copy Process

Steps For SAP Client Copy / System Refresh
Before doing a client copy, you need to prepare the following :-
1. Find the source client space with the client size custom program which can be implemented using the rel. note: 
    Find the space of the client – ‘0118823’. This will give you the size of the source client. 
2. If your are on Unix OS, adjust all the file systems according to PRD file system to fit the PRD client in DEV 
    client based on space requirements also. 
3. You can do the client copy by remote or export/import client. 
    Remote method is not preferred if you are doing a large client copy. 
    Do a client export/import. 
4. To speed up the export/import, use R3trans export/import for the clustered tables. 
    Please find the rel. notes related to performance improvements for cluster tables in OSS.
5. Do import and post processing. 
    Note: Export may take 10 to 20 hr. for 50gb of data 
    import may take 4 days and post import will take 8 to 15 hr. for 50gb of data. And it all depends on
    your system performance. 
Please refer OSS rel. notes for the few RZ10 parameters which needs to be set for cluster tables to speed up the process. 
Note :-
If it is a fresh installation, do this —
1.  SCC4 –> Create client no. and fill other details.
2.  Logon to the newly created client with SAP* and PASS as password.
3.  SCCL –> choose any profile (preferably SAP_ALL), source client 000 and target client .
4.  Preferably do a test run initially to check if it can go well.
5.  As a care check space in databases.
What are step and procedure to create a client & to take a client copy from source to target.
If you are copying from same system then flow the below steps:
   
1. Create the client in Tcode scc4.
2. Before that create a logical System in BD54.
3. Login in the newly created client with 
    user Name : sap*  and password  : pass
4. Use the Tcode sccl to copy the client.if you are not familiar with the client copy.  Try a test run and then schedule it in background.
5. You can select the needed profile.
6. To view the log files use the tcode scc3.
   
If you are using different system then create a rfc connection in sm59.test the connection and then continue from the 1st step
You can also import and export a client.  Use scc7 for importing from the client and scc8 fro exporting from the source client
What is system refresh when and why it is done?
The system refersh is nothing but the deletion of the client and replacing the data from other client.    For example : you have clients 100, 200 and 300.  Suppose when you want to refresh the client 100 you remove the client 100 and replace it with 200 0r 300 as per your reqiurement. Mostly the refresh of clients will be happen at the time of development stage.
System Refresh is a simplified term to Client Copy. Client Copy means copying the production client on to the quality to test the real data. As recommend by SAP this need to carried out every 3 months.
The process to carry out the same is as follows:
1. Create a client on quality system using txn scc4
2. Create a RFC between Production system and Quality System (need to create on quality system)
3. Login to the newly created client using sap* and pass as a password
4. Txn sccl to start the client copy. You can test the client copy by selecting the test run option. (test run will estimate the time taken for the activity).
Hope this helps you.

CLIENT ADMINISTRATION :-


The list of very important transaction codes for client administration



Resource Requirements :-
• Copying clients requires large amount of system resources
• To avoid any bottlenecks we should ensure that there is enough resources available by considering the  following
1) DB Storage Space
2) Perform a test run before copying a client.

Q) Why do we need to perform a test run?
A) Test run determines which tables are to be changed.

Q) What is the amount of storage space a client will occupy?
A) A client without application data needs approximately 150-200 MB of storage space in a DB

Q) Why do we need to do client copy?
A) To create new clients.

Note: New clients are based on SAP reference client 000 when the R/3 system was first implemented. The new clients are Training, Demo, Test and Production Clients.

Note: It is strongly recommended when doing client copy to use the profile SAP_CUST.

Q) Do we need to transport clients between systems (or) what is the procedure for copying clients between systems?
A) We no longer require to transport clients instead we make a remote client copy.

Features
When copying clients you can select the data that you want to transfer from source to target client.

Various Types of data are as follows

a) User Master Data: We select this option only if we want to copy all the users of an existing client with same authorizations into target client.

b) Client Specific Customizing: We select this option if you want to setup a new client in an existing system.

c) Client Specific Customizing and Master/Transaction data: We select this option if we want to setup a test client i.e. identical to the production client in the same system.

d) Client Specific and Cross Client Customizing: We select this option if we want to setup a quality Assurance system based in the production client of another system.

e) Client Specific and Cross Client Customizing and Master/Transaction Data: This option is selected to setup a test client based on production client of another system.

Note: When a client copy process is completed the client copy tool automatically generates all ABAP dictionary objects that we created as a result of a generation process.

Restrictions:

Background Processing:  We can copy clients either online or in background.

Q) SAP recommends scheduling client copies as background jobs. Why?
A) 
• During client copy we must ensure that no users logs on to system (Source Client)
• Users already working in target client cannot be locked automatically before the client copy starts and we must ensure that they leave the system.
• In source client we can lock the users.

Note: In normal situations for some technical reasons we should not lock users in source client. Eg: Production client.
• If the source client is production client, this may lead to inconsistency if users are not logged off. To avoid inconsistencies, the related tables are copied together with other tables.
• During client copy large volumes of data is transferred and hence it may take several hours for which we need dialog processes.

Note: Client copy tool generally uses minimum of 2-dialog work process even if you start in background.
• Before performing a client copy set the profile parameter MAX_WPRUN_TIME and it is recommended to set for 30 minutes.

Q) Why should we not transport the client data?
A) this is explained with the help of a scenario. In target system, we have set up clients whose data must not be affected. The cross client data must not be imported into the system from outside, since the cross client data overwrites existing data so that customizing data of other clients in the target system no longer effects.
• For client transports RFC connection should be established between the systems.


Copy Profiles
For copying clients R/3 offers a set of profiles

Authorizations

To be able to copy and transport clients we need appropriate authorizations
• There are two Types of authorizations
1) General Authorizations for client copy
2) Special Authorizations 



Note: This authorization is related with client transports. This authorization object should have the values TYPE=CLCP and ACTVT=01

Q) what default user has all the authorizations?
A) SAP*. This is the reason for locking this user in different environments.

Steps for Client Creation

1) Goto SCC4
2) Select [Change] button
3) Select [New Entry] 
Fill the following entries
1) Client No and Description
2) Select the client Role



Protection Level
• 1 is for copying data
• Aim of protection level attribute to present the client from being overwritten intentionally or unintentionally by copying additional client dependent data from another client.
• In DEV protection level is always no restriction
• In PROD No overwriting but external availability is there.

CATT
• CATT Stands for Computer Aided Test Tool
• They generate test data that may be helpful for demonstration purpose.
• A client with protection level 1 and 2 cannot function as target client.
• CATT scripts are only used in test systems as well as QAS systems.
• This option provides access for testing of data using various testing tools.

Restrictions
Locked due to a client copy: This option is used while performing client copy, i.e. locking the entire client.

Data in R/3 is of 2 types :-

Client Dependent data: 
Example: Customizing, Application and User data

Client Independent data: 
Example: ABAP Program, R/3 Repository Objects and Enterprise img
• In table related with client information T000, “mandt” is a field in the table T000 that stores name/number of the client.
• Client present in non-IDES: 000, 001 and 066
• Client present in IDES: 000, 001, 066 and 800 (Totally customized Client) 

Note:  Option – “No Transport Allowed” deactivates CTS (Change Transport System) in client.

Local Client Copy :- 
Copying clients within the same system
1) Execute the transaction Code SCCL at the SAP command line
2) Select a copy profile that matches your requirement. Click on [Choose] button
3) Save the profile value by choosing the button [Save Profile Value]. We use this option if we want to use the selected profile as default settings.
4) Enter the source client
5) Start the copy process. Starting of copy process can be done in 2 ways. Either schedule it as a background job or start immediately. Note: In a live environment we schedule it as a background job only.
• If you the expected output of the copy process is to copy only user data and profiles then we can run it online i.e. [Start Immediately]
• In order to perform a client copy the most critical step in logging into target client and perform the above process.

Copying Clients between Systems
When a Client is copied from one system to another, then data is transferred directly via RFC Interface. 
Steps:
1) Login to target client and go to SCC9
2) Select the copy profile
3) Enter the RFC destination
4) Start the copy process

Note: Transaction Code to create RFC destination is SM59

Transporting Clients between systems
Note: You no longer required transporting clients before you can copy clients between systems. Instead you can make a remote copy. Never the less SAP continues to provide support for transport function.
• During client transport all languages of source system are transported.
• They overwrite the text in the target system. Therefore all text are lost in the target system, whose language exists only in target system but not in source system

Steps:
1) Log onto source system SCC8
2) Select a copy profile
3) Select a target system client.

Note: Logon to source system in the source client with a user that has transport authorization. 
• Data export is performed automatically asynchronously.
• Output of export includes the names of transport requests that are to be imported as
  KO Cross client Data
  KT Client specific Data
  KK Texts and Forms
• Once we are done with export, go to SE01 or SC09 and check for transport request crated.
• Client import post processing is always necessary and must be performed in the target client after import of transport request.
• Goto SCC7 to check the import Queue and verify the request number and export system and click on background job tab or start immediately. Thus the client transport is done.

Note: Client Transport = Client Export + Client import

Log onto target client go to SCC1, give the source client and transport request number and schedule it in the background. This is how local client transport is done.

Post processing activities after client import

Use the following menu for post processing activities.
Tools -> Administration -> Client Admin -> Client Transport -> Post Processing Import

Note: We can use this option to transport customizing changes to the target client, that have been made in the source client after the client copy.

Displaying Client Logs
• Goto SCC3 to check for the logs
• To display the detail log for a run, position your cursor on appropriate run and then select the [Choose] button. 
• The system displays the list with the info Copy Type, Profile, Status, User, Tables, where copy problems occurred and statistical info.
• To view further details choose [Details] button.

Restarting Client Copy
• If the process terminates for some technical reasons like database shutdown, you can always restart the process from the point of termination.
• If you start a client copy or a client transport, and the previous process terminated prematurely, the system automatically proposes restart mode with the same parameter settings used for the copy that caused the termination.
• If the restarted process fails, the log displays a special note indicating possible reasons for the error.

Error Handling
Client copies usually involve large volumes of data which places strain on CPU and storage resources of a machine. Depending on data involved and system configuration the most likely errors are given below with corrections.

Client deletion:-

• Deletion of client using an R/3 script in not advised by SAP
  Client deletion pre-work:
1) Ensure that there is no backup currently running for the system.
a) Log on to the system at OS level
b) Go to cd /oracle/sid/sapbackup type tail back*, this will display the last l lines of backup log, the last line will display the latest backup. If the written code listed is the backup is still running and you will need to wait till it ends.

2) Ensure that any scheduled backup for the target system is held while archiving is turned off. By default archiving should be on.

3)Turning archive off: 
a) First if there are any used currently logged on to the system. AL08, issue a system message that the system will be used in a few moments
I. Go to SM02 
II. Select the create option and enter the message into dialog box displayed 
III. Set the expiration date and select save button
    
b) To turnoff archiving first shutdown SAP
I. Sesu- adm (Status of the system)
II. Type stopsap R3
III.When you receive a message instance stopped, check the system is down or not by typing
 ps –ef |grep dw. There should be no entries visible for SID you have just stopped.
IV. Exit from SID adm
V. Type sesu_oracle
VI. Enter SAPDBA-U/
VII. Choose option f- archive mode
VIII. Select option A (toggle database log mode)
IX. Type y to the message instance will be bounced and shutdown immediately” 
X. After a few movements reply or type y once again to startup the instance 
XI. The archive mode menu should now show that database log mode is off
XII. Exit SAPDBA
XIII. Exit from ora in order to restart SAP ensure that you are in SID adm mode.
XIV. Enter start SAP R#, when message instance started is received check the instance is running or not by typing ps –ef | grep dw and looking for SID that we have just restarted
         
c) Remove the system message if it is still valid

4) This step will be followed only UNIX OS only. A consequence of shutting down SAP is interrupting of SMTP mail process within UNIX you must manually restart the process
I. In unix type the command sesu_adm
II. Go to cd /sapmnt//exe,
III. Check if the process are still running by issuing a command          ps –ef |grep ml, mail server, if there are any process running that particular process ID needs to be stopped
IV. Enter ‘kill -9

5) Since client-deleting process involves five processes, and important step before starting any process is to check that these are enough batch process available in order to carry out my work.
a) Enter SM50 and check these are at least 5 batch process available                                           (Note: see that equal no of dialog process are also available) 
b) If they are not enough batch process available the operation modes will need to be switched. 
c) Enter Trans-Code RZ04, double click on current operation mode and increases the batch processor assigned to that operation mode
d) Manually switch the operation modes using RZ03
e) To check if the operation mode successfully changed go to SM50 and count no of batch work process 

6) This step is to prepare the user for the deletion process     
a) First login to target client for the deletion process 
b) Go to SCC5
c) Specify whether you want to delete the client and also select T000 and execute the process at background

NOTE:
 selecting option T000 will not only delete the client locally but also remove the entire physically from T000 table