Saturday 16 November 2013

SAP-Network Issue and solution

In any support or implementation project, there will be situation where SAP BASIS consultant had to face network issues in SAP servers and had to prove to other infra-team as the trouble caused is due to network.

In order to trouble shoot network related issues in SAP servers, there is a standard way of trouble shooting as explained by SAP.


Here are the below SAP notes for the common network issues and their solutions.


SAP Note 1519484-How to analyze network disconnections shown in system log (BC transaction SM21)

SAP Note 21971 - Connection between SAP GUI and application server terminated

SAP Note 155147 - WinNT: Connection reset by peer

SAP Note 413330 - Network timeouts

SAP Note 516027 - Gateway error due to terminated TCP connection


If in case you need to perform advanced trouble shooting to narrow down the issue to the root cause, please follow the below steps.

SAP Note 500235 - Network Diagnosis with NIPING

With respect to the SAP Note 500235, there are 6 tests need to be performed with NIPING command, the are

1) Measuring network metrics (throughput and RTT)
2) Long LAN stability test
3) Long WAN test (stability)
4) Long WAN test (idle timeouts)
5) Short throughput/stability test
6) MTU test – with data Buffer sizes (500,1000,1400,1500,4000,10000&40000)

Based on the tests as per SAP note you can identify the root cause of the network issues in SAP.

If not able to identify even after this diagnosis then collect all the test results and post a message to SAP under BC-NET component. SAP will help you out in trouble shooting.





Thursday 24 October 2013

SAP-Post DB refresh activities with Oracle database

There will be many doubts for the beginners of SAP BASIS, on how  to perform DB refresh activities with SAP.

Scenario:- Need to perform DB refresh with latest offline/Online backup taken from Production system to Quality system.

Here are the detailed steps to perform the same.

Pre-requsities/Primary steps to be performed in Quality server before starting DB refresh.

1) Take the backup of existing User Master records in Quality system using client copy export method.

Goto SCC8 T-code and perform client export with SAP_USER profile, target system and execute.



The client export will create 3 Transport requests.


2) Take the backup of existing RFC connections in Quality server (Optional)

Export the following tables

RFCATTRIB
RFCCAT
RFCCHECK
RFCDES
RFCDES_VIEW
RFCDOC
RFCLIST
RFCTRUST
RFCTYPE

Note:- Please refer the below link for learning how to export and import tables
http://sapbasisinfos.blogspot.in/2013/10/sap-export-and-import-tables-in-sap.html


3) Take the snapshot of stms_import history of transports to refer the transports performed to Quality server only.

4) Take Note of existing SAP License in Quality server.

5) Export background jobs running in Quality server (Optional)

BTCCl
BTCDELAY
BTCEVTJOB
BTCH1000
BTCH1010
TBTCO
TBTCP

Note:- Please refer the below link for learning how to export and import tables
http://sapbasisinfos.blogspot.in/2013/10/sap-export-and-import-tables-in-sap.html

6) Take note of Logical system naming conventions of existing clients in Quality server from BD54


Start Restoration in Quality server:-

Perform Restoration in Quality Server using BRTOOLS or using any third party backup utility.

Start Post restoration activities:-

Once restoration is completed proceed with post restoration activities

1) Create control trace from Production system and modify the SID and data files path accordingly and save the file as control.sql


 


Open control.trc file and modify the files as following

In the first line change the words from REUSE-->SET, SID--> Target DBSID, NORESETLOGS--> RESETLOGS, NOARCHIVELOG--> ARCHIVELOG

STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "<SID>" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE

Change all datafile locations with target SID, and remove all unwanted lines, there should not be any space in between any of the lines.

Then save the file as control.sql and paste it in the quality server.


2) Now remove the control files got restored from backup in the control file location in quality server.

3) Next login to sqlplus and new create control file for Quality server.

Sql> Startup nomount

Sql> @control.sql



Sql> recover database using backup controlfile until cancel
(use this option to recover DB with archive logs, if its an online backup)

Sql> alter database open resetlogs



Sql> shutdown immediate

Sql> Startup



4) Next drop the OPS$ users and create new users according to SAP Note 400241

Sql> select owner from dba_tables where table_name='SAPUSER';



Sql> select owner from dba_synonyms where synonoym_name='SAPUSER';

Sql> drop table "OPS$<SID>ADM"."SAPUSER";



Sql> drop synonym "OPS$SAPSERVICE<SID>."SAPUSER";



Sql> sqlplus /nolog @oradbusr.sql NT <SID> SAPSR3 <Domain>/<Hostname> <SID>



Reset the schema user password, so that the passwords will get updated in the OPS$ tables which we have created.







Once OPS$ users created & schema password reset, check the db connection with SAP from OS level, using the below command from command prompt or terminal.

cmd> R3trans -d

The command should return 0000 as return code, if not trouble shoot the same using SAP Note 400241.


5) Create temporary tablespace

create temporary tablespace using BRTools as below.






6) SAP license install



Note:- For digital signatured license please use "saplicense -pinstall" option, if that does not work, make the SAP up and apply license using SAP* user with T-code "SLICENSE".

6) You can start SAP at this stage and start performing post restoration activities from SAP level.

Note:- If there is a condition that no background job has to run during SAP startup, just make background workprocess parameter "rdisp/wp_no_btc" to zero and start SAP.

a) Suspend all existing background jobs by running report "BTCTRNS1" in SE38 T-code






b) Reconfigure TMS configuration in Quality server with production TMS as reference.

Goto SE06 T-code and select "Database copy or Database Migration", click "Perform post-Installation Actions"



Provide the SID of Production system and continue.





Old TMS configuration is  deleted and now reconfigure TMS by login to 000 client and goto STMS T-code & create the transport system with the existing domain controller.


After configuration the TMS configuration will show inconsistency in transport route, just goto transport route page



And adjust the transport route of quality server with domain controller.



The system will automatically configure the transport route by adjusting with domain controller.



 c) Import RFC destinations which you have exported earlier from quality server.

Note:- Please refer the below link for learning how to export and import tables
http://sapbasisinfos.blogspot.in/2013/10/sap-export-and-import-tables-in-sap.html

d) Import background jobs which you have exported earlier from quality server. (Optional)

Note:- Please refer the below link for learning how to export and import tables
http://sapbasisinfos.blogspot.in/2013/10/sap-export-and-import-tables-in-sap.html

e) Schedule standard background jobs from SM36 T-code




f) Perform client copy import with user master records, which you have exported earlier.

To perform goto STMS_IMPORT T-code and add the transport requests to tp buffer and start import to the respective client.

Once import is complete perform post import activities from SCC7 T-code.

g) Perform logical system name conversion for quality server using T-code BDLS

Provide the Production system logical name in "Old Logical System Name" and Quality server logical name in "New Logical System Name" and execute.



h) Reconfigure email from T-code SCOT

 

Double click on SMTP and provide your mail server IP address in "Mail Host" and port number.



i) Change the spool server for all the printers using T-code SPAD



Provide the quality server spool server name and press enter.



 j) Reconfigure operation modes from T-code RZ04

That's all need to perform for the completion of post activities, now you can release users and start using quality server.




 

SAP-Export and Import tables in SAP from OS level

There may be situations where you need to export and import SAP tables from OS level, this can be achieved using R3trans utility in SAP.

Setp 1:- Collect all the list of tables to be exported

Step 2:- Check enough disk space available in the directory where you are going to perform export.

Step 3:- Create two control files for R3trans which will be used for export & import.

For example create control file named as export.ctl and the control file should contain entries like below

export
client=<client no>
file=export_data.dat
select * from <table_name_1>
select * from <table_name_2>
:
:
select * from <table_name_n>

The below are the calling options for R3trans, you can use the below options based on your requirement

 You can specify the following options for calling R3trans:
●  -c <f1> [<f2>] Conversion
Copies file <f1> to file <f2> by converting the character set to the local character set. If <f2> is omitted, R3trans copies to trans.dat (see Automatic Character Set Conversion with R3trans).
●  -d DB connect
Check if connect to database is possible and if the ABAP Dictionary is available.
●  -i <file> direct import from data file without specifying a control file (see Import)
●  -l <file> Output of a table of contents to the log file
●  -n Brief information about new features of R3trans not yet documented
●  -t Test mode All modifications in the database are rolled back.
●  -u <int> Unconditional mode This option invalidates the rules of the correction and transport system. Each mode can be concatenated (for example -u 12).
●  -v Verbose mode
Writes dots to <stdout> and writes additional details to the log file.
●  -w <file>
The transport log is written to this file. The default file is trans.log in the current directory.
●  -x Check whether connection to database can be made

Example:- R3trans export.ctl -w export_log.log

Step 4:- Once export is completed export_data.dat file will get generated.

Step 5:- Use the same .dat file to perform the import, create the import control file (import.ctl) as below

import
client=<client no>
file=export_data.dat

Step 6:- Call R3trans command with the import control file to start import, the table entries will get imported automatically.

Example:- R3trans import.ctl -w import_log.log

Note:- You can even use R3trans to delete a client from OS level, which will remove all the contents of the table with respect to a single client. For that you need to create a control file as below

delete
client=<client no>
select * from 

after creating control file you can issue the command as

 Example:- R3trans delete.ctl -w delete_log.log

 

Thursday 5 September 2013

SAP-Successive background Jobs

There might be situations where you might need to execute periodic background jobs subsequently.

In the normal way of background job schedule with "After Job" as trigger will work for single instance of sequential background job execution, but the same will not work with periodic schedule.

The same can be achieved by a standard methodology explained in SAP Note 919458.

SAP Note 919458 - Program 'BTC_EVENT_RAISE'

Setps:--

1) Goto SM64 T-code (Bg event administration)

  
SM64 Screen

      Create a new Event with a name of your own choice


Do not select system option
  2) Goto SE38 T-code and execute report BTC_EVENT_RAISE
           
                   
              Fill in the Event name Z_BJ_TRIGGER which we have created and provide the background job as               parameter.    

 

              Save the values as variant for BTC_EVENT_RAISE program


3) Goto SM37 or SM36,  create / change a background job (Ex:- RSPFPAR) with repeat schedule

           


   Add a new step to the job with the ABAP program BTC_EVENT_RAISE and keep the variant we had      saved.
             
     
         Job step should be displayed as below

       
The event trigger step should be defined as the next step of the primary step
4) The subsequent job should be scheduled with "After Event" as the job start condition.
   
Ex:- Schedule RSUSR002 job


   Set the "After Event" as start condition and provide the event trigger name we had created                             (Z_BJ_TRIGGER), and select the periodic checkbox



5) Now you can see the background jobs ran subsequently and repeat schedule will work.


You can perform the same actions set to schedule more than one subsequent jobs.      
















































































































Pages