Thursday, November 18, 2010

SPOOL_INTERNAL_ERROR

This morning is awful.
Users have another dump about SPOOL LIST on production system.
System is getting dump when users trying to get print out.
The problem is caused by Full Spool List.

For solution : You have to run program RSPO1041 and delete old spools from the system.

Dump on ST22 : SPOOL_INTERNAL_ERROR
RSPO1041  

TSV_TNEW_PAGE_ALLOC_FAILED

This is the dump which users are facing in production system this morning. ABAP guys developed a custom program for them and when they tries to execute program system is getting dump.I have searched for reason on web and found below.

You are running short of memory during running of the program.

There may be two reasons ;

1. You have internal tables which are massived (too big ). Reduce the size by gathering data from the database in packets.
2. If you are using the zstatement 'select' and use a range table in the select statement that is too big. The database cannot handle unlimited amounts of data in internal tables used with the ' where xyz in s_range_table'.

Wednesday, November 17, 2010

SAP Performance Optimization

At the end of Performance Optimization article you will handle below sessions  ;

BC315 - Workload Analysis
BC490 - Optimization of ABAP Programs


PART 1 - Overview to structure

Performance Management :

At the end of this part you will able to answer below questions;

1) Which preventative measures must be taken to guarantee the optimal performance ıf mySAP Solution ?
2) What performance tuning measures should be taken into consideration?
3) Who is involved to the tuning process?

  • there is a plan for the continuous monitoring of availability and performance of the business process.
Service Level Management : is of central instance for long term monitoring and optimization.

      Arranging Service Level Management : First you should come to Service Level Agreement in which you record which objectives are to be attained by the individual service partners.

      SLM should be cover following agreements: Definition of business hours , Database backup and restoration , Performance , Content of reports

Performance: To reach a useful SLM , proceed as follows ;
1) Choose around 10 to 20 critical transactions
2) Measure the average response time of the transaction in production operation over a given period of time
3) Agree that weekly details on the response times for the selected transactions will be given in SLReporting.
4) Link the selected transactions to the CCMS
5) Agree that in the event threshold value is exceeded.

Problem Solving : In the Service Level Agreement you should set out priorities for errors and reaction times for problem solving. In communication between SAP and customers , four priorities are user (SAP NOTE: 67739) : Very High , High , Medium , Low.
You should also describe which error situations are to be monitored by the monitoring team these include: Interrupted updates , interrupted by processes , interrupted interface processes ( transactional RFC , queued RFC , IDOC , ALE)

Service Level Reporting :
Number of users logged on and number of tcode steps.
Average response time for dialog and update tasks.
Average response time during the hour with greatest system load.
CPU and main memory load during the hour with the greatest system load.
Size of DB and it's rate of growth.


Linking systems with RFC : Data can be exchanged between components using RFC. Data is converted into IDOCs and sent via RFC. With RFC components of different versions can communicate with each other.

User Connection : 3 ways ; a-SAP GUI (Windows , Java) , b-Web Browser in HTML format , c-Mobile Clients.

Client / Server Architecture : Presentation server ; once user has ended a data entry. Presentation Server sends data to the application level. Application level also forms the integrated Internet connection of the SAP Web Application Server. (SAP Web AS , from SAP BASIS 6.10)
Application logic is encapsulated in transactions, screens, reports or function modules.

     Three possibilities for connecting Internet users to the SAP application level;

     1) Use SAP Internet Transaction Server (ITS) and a Web Server provided by a third party. Typical SAP ITS applications are self-service applications in the area of human resources. (ESS applications such as time recording and travel accounting), B2B Procurement applications (Enterprise Buyer Professional), Internet Sales (Product catalog, online store in SAP R/3).

     2) Business Server Pages (BSP) ; HTML Pages can be dynamically generated using ABAP or Javascript as the scripting language. Technical advantage of this programming is that no other software components need to be installed.

     3) To use a JSP Server or a Java application server.

The Monitoring and Optimization Plan for a mySAP Solution :

1) Requirement of a Monitoring and Optimization mySAP Solution

    Monitoring and Optimization Plan :


Responsibilities / Viewpoints
*Systems *Interfaces *Business Processes

2) Tools & Methods for the Monitoring and Optimization Plan

a) CCMS :  Checks all components are available and work well. If not an alarm is triggered.
TCODE : RZ20
Define one SAP System as a central monitoring system and all reports of errors from all SAP components will be sent to this system. (databases , instances , operating systems and all other components such as SAP IT. Also for non-SAP components ; catalog software , Clarify & Commerce one.

b) Central Workload Monitor: Gives you an overview of the workload distribution in your mySAP Solution throughout all Software Components with a technical analysis. For ex: problems on database, in SAP Basis System or Internet transaction server can be identified and analyzed. In an application analysis , transactions , programs and users that generate hight system load can be identified and analyzed.

c) Expert Monitors for Performance Analysis : TCODE : STUN

Monitors for technical analysis :

OS Monitor : TCODE : ST06 Monitors the load on CPU & Physical Main Memory
Database Monitor : TCODE : ST04 Check load on DB buffers , db locks andpther wait situations. Also monitors SQL treatments.
SAP Memory Configuration Monitor : TCODE : ST02 Monitor the load on the SAP buffer and other memory areas SAP Work processes.
Work Process Overview : TCODE : SM50 Monitor load on SAP Workflow.
Work Monitor : TCODE : ST03 Overview of load distribution in the SAP System. In a technical analysis problems on DB, SAP Memory Management and SAP buffers.

Monitors for application analysis :

Work Monitor : TCODE : ST03 , ST03N , ST03G
Single Record Statistics : TCODE : STAD , STATTRACE  Overview of load distribution, in  a application analysis , transactions , programs and users that place a heavy load on the system can be identified and analyzed.
Application Monitors : TCODE : ST07 , ST14 To monitor the use of resources according to SAP Modules.
SQL & ABAP Trace : TCODE : ST05 , SE30 Trace functions for a detailed analysis of ABAP and SQL programs.


SAP Solution Manager :

SAP Solman is the portal for accessing these services and fives you centralized access to tools and services procedures for performance monitoring and optimization. Difference from Solution Monitoring , Solman focus on business processes.

Based on data, SAP SolMan draws up a service level report each week. Includes following functions;
Automated setup
Presentation of selected performance indicators , error messages , optimization advice for all components of a mySAP Solution. Based on the results of SAP Early Watch Alert Services.
Presentation of performance indicators , error messages and optimization recomendations, grouped according to system and according to business area.
Graphic presentation of the time spans of selected performance indicators, For Ex: Hardware Load.
Automatic generation of instruction and reference to other SAP services.

Continous Monitoring :
CCMS contains a monitor with which you can monitor all aspects of your mySAP Solution together with SAP SolMan this forms a complete solution for the continuous monitoring.

Working with Alert Monitor :
TCODE : RZ20 The system displays the CCMS monitor collections.

Plan for Continuous Performance Optimization :
1) Technical Tuning Actions : OS , DB , SAP Application Server & Networks.
2) Application Tuning Actions : Works at program level. Aim is to minimize the use of main memory and CPU resources, network transfers and hard disk accesses.

Tuning Measures :





A performance analysis has come up with the following results;
1) SM50 shows that several programs repeatedly spend a long time reading from table RESB
2) An analysis of the database shows that all tables with transaction data reside on one harddisk. All transaction data together amounts to 8GB of which table RESB accounts for 2GB.
3) The Operating System monitor shows that the harddisk on which , among other things , the RESB table resides is fully loaded (80-100 % load , response times of over 100 ms per access).

from system administration point of view following technical solution strategies need to be discussed
1) the data buffer on the db server could be made bigger , it will be able to hold a large part of RESB table on the main memory of the db server.
2) the RESB table could be placed on a separate hard disk. The db hard disk layout could also be changed so that the RESB table could be distributed over several hard disks.
3) the use of the ATP Server would make it possible to buffer partial RESB table results on the application server main memory and thus reduce database accesses to this table.
4) As a last resort , the installation of faster hard disks could be considered.


SUMMARY :

There are 2 important prerequisites for good system performance ;

1) cooperation of all those involved in setting up  a mySAP Solution and in the execution and administration of customizing or developments.
2) long term planning of performance monitoring and optimization for this you can use Service Level Management methods and the central monitoring architecture of CCMS in the SAP Solution Manager.

PART 2 : Memory Management  to be uploaded soon.

Reference : SAP Performance Optimization Guide by Thomas Schneider, SAP Press.

Tuesday, November 16, 2010

Client Copy

In source client run SCC4.
Create new client from New Entries session (F5)

Then go to new client
UserID : SAP*
Pass : Pass

Run tcode SCCL.
Source Client : 000
Profile : If you are going to transport data select SAP_ALL if empty select SAP_CUST.

Click on Schedule as Background job.
You can check the log of the job from tcode SCC3.

Activation of keeping logs of database tables in SAP

To do that there are 2 operations:

1-From SE11 enter the database table name and enter in change mode.From there click on technical settings button. In this screen check if Log Data Changes is selected or not.

2-Run tcode RZ10 enter below parameter. For parameter value client number or ALL can be entered.
rec/client = 110 or ALL

What can you do for ORA-0018 ?

ORA-0018 : Maximum number of session exceeded

If you are facing with above error. Go to ini<SID>.ora file and increase below parameter values.
db_files
processes
sessions

SQL>alter system set processes=250 scope=spfile;
SQL>alter system set sessions=280 scope=spfile;

to activate these parameters database should be restarted.

Related Sap Note : 398927

How to change user of a created job?

First you have to go to tcode SM37 and the released state of job which is wanted to be changed will be displayed by entering a further date.

From the screen select the related job , and from menu select Job > Change. From the screen appeared select Edit > Steps. Finally from newly opened screen by clicking on edit button or from menu selecting Step > Change you can do the change on this job.

Errors on tp commands

If  the import operation will not be successfully end and there is error related to RDDIMPDP. You should enter to tcode SE38 with DDIC user and RDDNEWPP program should be ran.

If the request seems importing but not working , it needs to be deleted and re-import.
To do that operation follow below introductions:

first list the jobs related with tp in operating system side and kill those processes.
ps -eaf
kill -9 <PID>

after that , delete the request in STMS manually.
(If tp error exists refresh STMS and delete again, and then kill all processes on Operating System again)

Go to SE16 and look if there is anything in tables TRBAT and TRJOB.
If there is, delete them all.

Run SE16N enter tables TPSTAT and TMSTLOCKR. Activate Sap Edit (&Sap_Edit)
Then enter the request number which you want to delete into the Request Task field or TRKORR field.

Client Copy Operation

Client Copy can be done with 2 different methods.

1-In source system run SCC8, from there EXPORT operation can be done. After that , you should enter to the target system and run tcode STMS or switch TP commands 2 or 3 requests which are generated by EXPORT operation can be imported to the system.

2-In target system run SCC9. In transaction target system and client can be imported via RFC which is defined before. It is better to be done this operation in background.

tp commands :

tp addtobuffer TSTK900001 PRD
pf=d:\usr\sap\trans\bin\TPPARAM

tp import TSTK900001 PRD CLIENT=100
u1.268 pf=d:\usr\sap\trans\bin\TPPARAM

With EXPORT operation 3 file & 3 cofile are generated. TSTKO00001, TSTK00001,TSTKX00001.
These files should be imported with tp after copy them in target system to data and cofile folders.

After Import operation post processing should be done with SCC7. 
Programs; RSCLIEXP and RSCLIIMP should be executed.

Set Environment Command On Unix

If you read the article about SAP PI Installation , I wrote that you need to define JAVA_HOME environment before starting installation. Now I'm going to write how you can define it on UNIX systems.

setenv JAVA_HOME /usr/java14_64
export JAVA_HOME=/usr/java14_64

To have screen display of installation

setenv DISPLAY "address:0.0"
export DISPLAY="address:0.0"

*address : system IP*

Before above operation Xmanager should be open in passive mode.

SAP Homogeneous Copy on UNIX Systems

For specific periods system copy is a must on SAP System to provide synchronization of the systems. Now we are going to look on how to do homogeneous copy of SAP on UNIX Systems.


(You have to enter your system ID to the uzd , uzp and system id fields in article. uzd is my development uzp is my production system.)

-First of all, you have the backup file of the production system. This backup file should be copied to development system. The backup file (.FDD) is located under : /oracle/"systemID"/sapbackup/  in production system.  Under sapbackup folder and in init<SID>.sap file it should be copied where backup is belong to. Also the same backup file should be copied under backup file under init<SID>.sap (/backup).

-Shut down the development system. Delete the control file on development system. This files are located in:

/oracle/systemID/origlogA/cntrl/cntrlsystemID.dbf
/oracle/systemID/origlogB/cntrl/cntrlsystemID.dbf
/oracle/systemID/sapdata/cntrl/cntrlsystemID.dbf

-Restore process will be started with the command : brrestore -b bdxbzdck.ffd -m full. This command should be ran by orauzd user (uzd is my system ID).  In this level system will give 3 warnings about Backup system is UZP & now system in progress is UZD . Type C and pass this warnings.
-Create control.sql file by the command : SQL>alter database backup controlfile to trace resetlogs;
After that , go under /oracle/SOURCEsystemID/saptrace/usertrace change the latest ora,trace... file as control.sql. Copy this file under /oracle/TARGETsystemID/sapreorg .

-Open this control.sql file with VI editor. Delete all the rows except the rows starting with CREATE & end with ; . Save the file. 
Delete REUSE in first row in CREATE CONTROLFILE REUSE and change it as SET. Moreover , change all UZP as UZD. This operation can be done with below command: 

:1, $S /UZP/UZD/g 
after all these operations save control.sql file.

-Enter development system with command , su -orauzd . first stop Listener and then re-start it.

>lsnrctr stop
>lsnrctt start


Enter SQL 
 >sqlplus / as sysdba

SQL>startup nomount;   -- by this command database is started in nomount mode.
exit SQL with command exit , now we need to enter SQL again  from the folder where control.sql is located in.

>sqlplus / as sysdba

then below commands is going to be ran :
to see database users : 
SQL>select * from dba_users
to delete OPS$ user :
OPS$<SID>ADM
SQL>drop user OPS$<SID>ADM cascade;
SQL>@control.sql  (SAP NOTE : 400241)
SQL>alter database open resetlogs;
SQL>create user OPS$UZDADM identified by password  (enter password)
SQL>create table sapuser (userid varchar2(256), passwd varchar2(256));
for ORACLE 9 to the sapuser "OPS$AZTADM".SAPUSER
SQL>select * from sapuser;
SQL>exit
SQL>insert into "OPS$AZTAD".SAPUSER VALUES('SAPSR3','SAPAZP','system');
       sqlplus / assysdba

- Enter the database by below command or by the Oracle Enterprise Manager. 
Add the datafile in the system to the PSAPTEMP tablespace.
SQL>alter tablespace PSAPTEMP add tempfile
'/oracle/systemID/sapdata2/temp_1/temp.data1' REUSE;
or
SQL>alter tablespace PSAPTEMP add tempfile
'/oracle/systemID/sapdata2/temp_1/temp.data1'
size 2000M REUSE autoextend an next 20M maxsize 5000M;

after this operations enter the system with user sap* and install the license.
Moreover edit the parameters in initUZD.ora file.

THE OPERATIONS ON SAP SYSTEM AFTER HOMOGENEOUS COPY

Enter tcode SE14 ; for below tables do operations ; Activate , Adjust and then Delete data.
DBSTATHORA, DBSTAIHORA ,DBSTATIORA , DBSTATTORA

Delete user OPS$UZPADM or lock.

SQL>alter database rename global_name to UZD;

from tcode SE06 do the post progressing operations for STMS after homogeneous copy.

Enter SICK tcode do controls for installation.It should be No error reported.

From tcode SE14 you should activate the tables as shown below : 
ALCONSEG, ALSYSTEMS, DBSNP, MONI , OSMON,PAHI, SDBAD,SDBAH, SDBAP,SDBAR

From SE38 run program RSBTCDEL. for all users and jobs select finished , canceled and delete with force mode and execute it.

From tcode SP12 do the consistencey check and delete old files.

Control SPAP, SM59. From SM58 clean the transactional RFCs.

From Tcode SE14 activate the DDLOG table (Delete Data)

Enter tcode SECSTORE and delete all RFCs with red.

Control the users from SU01.

Enter SE14 activate the tables ; TPFET & TPFHT (with delete data option).

From tcode RZ10 select and install profile parameters with import active server and make the configurations.

From RZ04 define instance and profile.

In RZ20 delete problems in CCMS alert files.

From SE14 activate TLOCK table.

Do SM28 Consistency check.

System log control from SM21.

Database consistency check from DB02.

Control the statistical logs in ST03.

SAP Notes related to OPS$ : Creating OPS$ on UNIX : 361641



After System Copy operation old system informations and system should be deleted from ST03N

SAP Note : 1179929

Enter SE16N , in &sap_edit mode run tables SWNCMONI & SWNCMONIINDEX . Enter and run old system informations (sap-product_UZP_00) in Host/Instance field , delete all shown datas and save.



Other Related SAP Notes : 534765 , 134592

How to install SAP PI? (Netweaver 7.0 SR3)

Hello all ,

This is my first entry in JuniorSAP, I hope we are going to have & share useful information about SAP while trying to put new things on my blog. I'm a SAP Basis Administrator with 18 months experience. I want to develop this blog to save my own information and to share with other junior friends. Sometimes I want to search things about SAP on web , but generally the sources are hard to understand. I'm going to try to write on based level with an easy terminology.

Today , We are going to have a practical look on how to install a SAP PI system on Windows Server 2003 with MS SQL 2005.

First of all , be sure that there is no portal system has been installed on the server before. If had , format the driver which the portal was installed in. Second step is to have all necessary sources. You should have SAP and Jave sources before starting the installation.

Necessary files : 
  • EXPORT file of the SAPCD
  • JAVA_COMP
  • JAVA_STACK_15
  • KERNEL_SR3
  • MASTER_SR3
  • MS SQL 2005 CD
  • J2SDK Setup.exe (latest version will be good and it should be downloaded related with the properties of your system. I have downloaded Windows version for AMD64)
  • JCE Policy files
Now you are ready to begin installation ; first of all we are going to install J2SDK. The only thing you have to do is running the .exe file. When the installation is end, go to My computer , enter properties > advanced > enter variables. Click on New and define JAVA_HOME by showing the path of J2SDK file.


Now it is time to define swap size.Enter system properties again > Advanced > Settings (Performance) >Advanced > Change (Virtual Memory) > Set Custom Size : Initial Size : 25000 mb Maximum Size : 25000 mb.



We are now able to install database server. Before installing the MS SQL 2005 , you have to be sure about all system drivers are installed correctly , all devices are working properly  and the computer which you are going to install PI has an IP address .  :)

Go to your MS SQL 2005 CD or the exported file and run the script "SQL4SAP.vbs". This will take approximately 10 minutes. You will have a coffee. 
When the installation is over you should have to restart your system.


All right friends , we are now starting to install SAP system. My suggestion is first define a file and name it like NAMEDATA (you can enter whatever you want as name but defining all with uppercase letters will be good). Go to your SAP CD or exported file and enter in MASTER_SR3. Enter the file related to your system (mine was IM_WINDOWS_x86_64). Run sapinst.exe . SAP Installation is now beginning.
this is your first installation on this server ; installation will be automatically ask you to log off and log in to server again.When you done re-log in installation will be automatically continue.

Choose SAP Netweaver 7.0 Support Release 3 > Sap Systems > MS SQL Server > Central System > Central System.


We are going to install new SAP System so we need to choose Run a new option.

Installation will ask you to show MASTER file. Show the path.

Now you are going to select components. Select PI , AS JAVA and AS ABAP.

It is time to show JAVA_COMP file's path. After this operation installation will ask for JCE Policy. Show the path of your policy file.

Now define a system ID like "XID". 3 characters. Also define a password.

You are going to export installation files. Click on browse and show EXPORT file under SAP CD.

On next step system will ask you to show path of KERNEL. You need to select KU winx86_64 For Unicode.

After configuring local SLD , System will ask you the name of the server which you are installing SAP on. Enter the name of the computer (mine was sapnw).

Installation will show you the revise session now. You can edit you selection on this place. To make our future operations easier I recommend yo to revise DB files. Show the paths manually. Remember, at the beginning I recommend you to open a new file named as "NAMEDATA" mine file named as XIDDATA. Show this file , enter the names manually and ask system to put DB files under that file.

Finally, System will ask you to enter Solution Manager Key. If you enter the key successfully you are now able to start execute services session. In this part , it is normal to face with some errors.  You can check SAP Notes to find solutions about the error. I ' m going to tell about the errors which I faced during execute services later.