Tuesday, December 15, 2009

Swap Space Bottleneck During SAP Operation

 
Symptom

Diverse error messages that refer to memory bottlenecks, or, more precisely, a swap space bottleneck. For example, System Panic; cmemreserve: reservation overrun; ENOMEM, Not enough core; ENOSPC, No space left on device; SIGDANGER (under AIX only). In the SAP System, the SAP system log message "no memory of class perm" is output.

This problem can occur with SAP processes and external processes as well. The relevant process cannot allocate anymore heap memory. This can lead to the database operation being ended or SAP work processes being stopped.

Error messages in the SAP System appear in the developer trace files

dev_disp, dev_w<n> in the system log and in dumps. The following messages may appear: TSV_TNEW_;._NO_ROLL_MEMORY; NO_MEM; NO_MEMORY; RESIZE_EM_ALLOC_ERROR, Storage class PERM.

This problem mostly occurs if background jobs are active with large amounts of data.

Possible Causes

  • There is no more swap space available
  • The highest value for one of the SAP profile parameters that limit the swap space usage has been exceeded. In this case, the following parameters are relevant:
  • abap/heap_area_dia, abap/heap_area_nondia and abap/heap_area_total.
  • The operating system limits for the process size (segment size) have been exceeded. For example, no more that 256 MB can be assigned under AIX and no more than 384 under SINIX.
  • Corrective action

    Increase the swap space or decrease the

    SAP Extended Memory. If the swap space already corresponds to the SAP recommendations, 1.5 to 2 GB may still be required. There should always be several hundred MB of free swap space available. You can reduce the maximum swap space need of the SAP System by reducing the value of parameter abap_heap_area_total.

    You can also distribute the load onto several application servers and increase the roll area. Check if the maximum process size (operating system parameters) is sufficient.

     

    The rsmemory Report

     
     You can use the rsmemory report to define your memory allocation strategy for work processes. You can specify the memory class assigned to a work process, the extent of the class assigned, and the order in which it is allocated. A distinction is made here between dialog work processes and non-dialog work processes (batch, update, spool).

    Changes made here only apply to the server on which you are currently logged on and only remain in effect until the SAP instance is stopped again.

     The following memory classes exist: SAP roll area, SAP Extended Memory, and private memory. These memory classes are assigned the following values, which are also displayed in the initial screen of the rsmemory report.

    Value

    Memory class

    0

    Roll area

    1

    Extended Memory (EM)

    2

    Private memory (heap)

    The initial screen of the report comprises three parts:

    • Quota Dialog:
    • The allocation strategy for dialog work processes is defined here. You can specify the steps in which each class is allocated memory, and how much memory is allocated.

    No entry in the memory class field corresponds to class 0 (heap memory).

    The entry here does not have to match the defined memory parameters. If you enter a value for the heap memory in the 4th step that is different from the abap/heaparea_dia parameter, the value entered here takes precedence.

    In this case, 1 MB of roll area is first allocated by a dialog work process, and then 300 MB of extended memory. Following this, 6.5 MB of roll area are allocated again before 200 MB of heap memory (the process then switches to PRIV mode) are allocated.

    • Quota Batch/VB/Spool:
    • As is the case with the quota dialog, the allocation strategy for non-dialog work processes is defined here.
  • Other parameters: You can change the following memory parameters here for test purposes (these changes only apply until the next server restart):
    abap/heap_area_dia
  • abap/heap_area_nondia
  • abap/heap_area_total
  • em/stat_log_timeout
  • em/stat_log_size_MB
  • em/global_area_MB

     Displaying the Memory Areas:

    You can display a list of all the users on the application server, with their respective memory requirements, by choosing Goto ® EM/HEAP areas. The used heap memory and extended of the user are displayed first, followed by the EM usage according to internal sessions.

    This is followed by a history of users who have used more than the MB limit specified by em/stat_log_size_MB.

    The available HEAP and EM memory is displayed at the end of the list.

    EG Overview

    The buttons EG Overview and EG Dump are used to analyze the Extended Global Memory. This is a part of the extended memory that is available for SAP-internal purposes. The parameter

    em/global_area_MB sets the size of Extended Global Memory.

    Activities

    In the initial screen of transaction
    se38, enter the report rsmemory and choose Execute or F8.
     

    Checking Roll /Paging Area and Extended Memory with Tcode ST02

     

    In the entry screen of transaction ST02, there is an overview of SAP Memory under the Buffer overview.

    SAP memory

    Current use

    Max. use

    In memory

    On disk

    [%]

    [kb]

    [kb]

    [kb]

    [kb]

    Roll area

    5.47

    448

    1,280

    8,192

    0

    Paging area

    0.01

    16

    72

    9,600

    252,544

    Extended Memory

    4.03

    6,144

    22,528

    152,576

    0

    Heap Memory

    0

    0

    0

    0

    0

    This is a snapshot of the current (percentage and absolute values in kilobytes) and the maximum memory usage of the various

    SAP memory types. The table also indicates whether, and to what extent, the requirement is satisfied from the main memory and from the disk.

    You can determine from the row

    Extended Memory that the SAP Extended Memory is sufficiently large. The value [Max. use] is, in this example, noticeably smaller than the created memory area [In memory]. If both values are identical, you must increase the extended memory (profile parameter: em/initial_size_MB).

     

    Virtual Address Space of a Work Process




    With 32-bit systems, 4 GB of memory can theoretically be addressed; depending on the operating system, there are approximately 2 GB of virtual address space available to a process.
    This consists of a text and a data segment, a dynamically extendible heap and a dynamically extendible stack. The heap increases in size from the bottom and the stack increases from the top; this enables the entire virtual address space to be used.

    With an SAP work process, there are special areas reserved on the heap whose size can be set using a profile parameter. These are:

    Roll area
    SAP paging area
    Private memory

    The largest reserved area is located between the heap and stack: of the SAP Extended Memory.

    SAP Memory Types : Private Memory

     
     Other processes cannot use private (heap) memory. After releasing the assigned memory, the operating system still considers the (virtual) memory as being occupied by the allocating process. These characteristics of heap memory require that:
    1. The work process can be run in PRIV mode (private) when the local memory is assigned. This means that the work process is reserved for processing the current user context until the context releases the work process again when the request has ended.
    2. The work process, if it has used a lot of private memory, is restarted when the user context is terminated and the local memory is returned. The restart makes the local memory available again for other processes. A restart occurs if a work process uses more local memory than is defined in the parameter abap/heaplimit. The mechanism is displayed again there.
     
     If a dialog work process has used up the roll area assigned to it and the extended memory, private memory is assigned to the work process. The work process goes into PRIV mode (private).

    In the parameter settings, ensure that not too many dialog work processes are simultaneously in the PRIV mode, since this lowers system performance.

    The other Work Process types (background, update, enqueue and spool work processes) are assigned heap memory after the roll area is used up. Allocating Extended Memory is not useful since no context change occurs for these processes.

    Automatic Termination of PRIV Mode Processes

    If too many dialog work processes run in the PRIV mode in an SAP application server, performance problems arise. The normal processing of user inquiries is slowed down by the PRIV mode work processes.

    The SAP System offers a mechanism that lets you terminate non-active dialog processes in the PRIV mode. This mechanism helps reduce performance problems.

    The mechanism works as follows:

    In the PRIV mode, a maximum number (n) of dialog work processes can run without any time restrictions.

    To determine this number n, set the value of the profile parameter

    rdisp/wppriv_max_no
    . If a value is not entered, the SAP System determines this number using the following formula:

    the number (n) is set to the greater of the 2 following values:

    • Number of dialog work processes minus 5
    • 1

    If more than (n) dialog work processes are active and the time span set in parameter

    rdisp/max_priv_time (default 600 seconds) has elapsed, the transaction for that PRIV process, which has spent the longest possible time in PRIV mode, is reset.

     

    SAP Memory Types :: Extended Memory

     
    SAP extended memory is the core of the SAP memory management system. Each SAP work process has a part reserved in its virtual address space for extended memory. You can set the size of extended memory using the profile parameter em/initial_size_MB: Extended Memory Pool Size. Under Windows NT, further memory is assigned dynamically as needed, and you can also set this amount.
     

    You can map the extended memory from the common resource onto any work process, and after onto another process (see graphic) on the same address in the virtual address space. This is important if you work with pointers in the ABAP program.

    Depending on the operating system, how you implement the extended memory is different.
     
    The SAP system builds a layer on to the operating system functions for the page management of this memory. This extended memory is implemented as an unnamed mapped file. This means the address space uses the paging file or uses the swap space of the operating system as background memory.
     

    SAP Memory Types :: Roll Area

     

    The roll area is a memory area with a set (configurable) size that belongs to a work process. It is located in the heap of the virtual address space of the work process.

    iSeries:

    the roll area is a fixed-size (configurable) area of memory situated in the shared memory in the virtual address space of the work processes.

    When the context of a work process changes, the data is copied from the roll area to a common resource called the roll file. To prevent repeated copying, another roll buffer is located in between that is part of the shared memory.

    iSeries:

    if the context changes, quick mapping operations are performed that make the current shared memory segment in the work process available.
    The roll area consists of 2 segments. The first segment, which can be set with the parameter ztta/roll_first, is assigned to the work process first as memory. If this is used up, the work process has more memory assigned to it. The amount of memory is determined by the difference between the parameters ztta/roll_area  and ztta/roll_first.
     

    SAP Memory Types

     
    The memory management system assigns memory to a work process. Here are some of the various memory types:
     
    SAP Roll Area
    SAP Extended Memory
    Private Memory
     

    The roll area is used for the initial memory assigned to a user context, and (if available) for additional memory if the expanded memory is full.

    The majority of the user context is stored in the extended memory. Page management of this memory as a stack is not taken from the operating system; rather it is performed directly from the SAP System. This extended memory is implemented as an unnamed mapped file (on AIX and optionally on HP-UX as shared memory). This means the address space uses the paging file or uses the swap space of the operating system as background memory. For more information, please see the platform-specific documentation.

    With the context change, the user context is not copied as with the roll area. Instead it is assigned to alternating work processes by mapping operations. The roll area can be decreased, which results in a faster context change because less data is copied and mapping an extended area is not work-intensive.

    All internal tables and ABAP variables are located completely in the area of a user context that can be directly addressed. Copying and in/output operations when accessing internal tables and lists is no longer needed. The result is low CPU usage and shorter access times.

    The advantages of the memory management system require increased swap space and main memory. The need for swap space increases because full-sized internal tables and lists are in the address space and take up swap space. The main memory requirements may increase to prevent excessive operating system paging due to the increased swap space requirements.
     

    Tuesday, November 3, 2009

    Structural Authorizations in SAP BW

     
    The following steps show the way Structural Authorization is enforced in SAP BW.

     The following steps to be carried out in the mySAP ERP HCM system.

     1) Call program RHBAUS02 for uploading Table T77UU and enter users.

    2) Call program RHBAUUS00 for generating an index for structural authorization profile

    3)  Activate Data source 0HR_PA_2

     The following steps to be carried out in the SAP BW system

     1) Replicate Data source 0HR_PA_2

    2) Activate ODS InfoProvider 0HR_PA_2

    3) Create an InfoPackage to perform an extraction for 0HR_PA_2

    4) Load ODS data from mySAP ERP HCM

    5) Mark InfoObjects as relevant for authorization (In order to use structural authorizations in SAP BW, all characteristic values like position, employee etc. which are relevant to reporting should be marked as authorization relevant InfoObjects.)

    6)  Create reporting authorization objects

    7)  Link authorization objects to InfoCubes

    8)  Call program RSSB_Generate_Authorizations.    

     

    Hierarchical Authorizations in SAP BW

     
    The following steps describe the steps to control authorizations for hierarchies

     1) Transfer and activate InfoObject 0TCTAUTHH tcode => RSD1

    2) Mark InfoObject 0TCTAUTHH as relevant for authorization tcode => RSD1

    3) Mark Leaf InfoObject as relavant for authorization tcode => RSD1

    4)  Create authorization objects with 0TCTAUTHH and Leaf InfoObject => RSSM

    5) Define hierarchical authorizations tcode => RSSM

    6) Manual intrgration of authorization object in role tcode => PFCG

    7)  Maintain authorization values tcode => PFCG

    8)  Assign role to user tcode => PFCG or via Central User Administration

     For extracting structural authorizations from HR (mySAP ERP HCM)  and to map it in SAP BW to maintian consistency between the   two systems the tables of interest are:

    1)  T77PR for Structural Authorization profiles

    2)  T77UA for user assignments

    3) T77UU for users (in this table you can select the users for extraction. You can either select all or specific users)

     

    Activating Authorizations in SAP BW

     
    The following steps explains how to activate the authorizations in BW.

     1)  Mark InfoObject as relevant for authorization tcode => RSD1

     2)  Create report authorization object tcode => RSSM

    3)  Select InfoCubes tcode => RSSM

    4)  Manually integrate authorization object in role tcode => PFCG

    5) Change / Maintain authorization values => PFCG

    6)  Assign role to user tcode => PFCG or via Central User Administration

    Important SAP BW Transaction Codes

     

    Transaction Code

    Description

    RSA1

    Transaction RSA1 is the main transaction for administrative functions in SAP BW (Administrator Workbench)

    RSD1

    This transaction code can be used to mark objects as relevant for authorization (InfoObject Maintainence)

    RSSM

    This transaction code can be used to create and modify authorization objects in SAP BW

    RSZV

    This transaction code is used to create or modify the variables for authorization checks. (Variable Maintenance)

    RRMX

    Business Explorer is the reporting tool in SAP BW and is used for analyzing data.

    GLOBAL_TEMPLATES

    Templates for modelling and evaluating data

     

    SAP BW Authorizatin Objects - IV

     
     
    Authorizations of the SAP system
     
    Authorization object
    Object class
    Description
    BC-SRV-KPR-BDS: Authorizations on document set (S_BDS_DS)
    BC_Z
    Controls access to documents that belong to a document set of the Business Document Service (BDS).
    Authorization object for the translation environment (S_TRANSLAT)
    BC_C
    Controls access to the translation functions of the SAP System. Determines whether, in which languages and which text types are to be translated.
     
     
     
    Authorization objects of object class RS for BW-BPS

    Authorization object

    Description

    Planning level (R_AREA)

    Controls access to the planning area and all lower-level objects. You must set up read access to planning areas for people who will work with the BW-BPS component. Otherwise, they will not be able to access any of the subordinate planning elements.

    Planning level (R_PLEVEL)

    Controls access to the planning area and all lower-level objects.

    Planning package (R_PACKAGE)

    Controls access to planning packages (including ad hoc packages).

    Planning methods (R_METHOD)

    Controls access to planning functions and the corresponding parameter groups.

    Parameter group (R_PARAM)

    Controls access to the individual parameter groups of a particular planning function.

    Global planning sequence (R_BUNDLE)

    Controls access to global planning sequences (you control authorizations for planning sequences that you create for a planning level with the authorization objects R_METHOD, R_PLEVEL, or R_AREA).

    No separate authorization for execution is defined for this authorization object. Whether a global planning sequence can be executed or not, depends on the authorization objects for the planning functions contained in it.

    Planning profile (R_PROFILE)

    Controls access to the planning profile. A planning profile restricts the objects that can be viewed. If you wish to view the planning objects, you must have at least display authorization for the appropriate planning profile.

    Planning folder (R_PM_NAME)

    Controls access to planning folders. In order to be able to work with planning folders, you also require the necessary authorizations for the planning objects combined in the folder.

    Using the Web Interface Builder

     Controls access to Web interfaces that you create and edit with the Web Interface Builder, and from which you can generate Web-enabled BSP applications.

    Authorization for planning session and subplan (R_STS_PT)

    Controls access to the Status and Tracking System. The object enables a check to be carried out whether a user is allowed access to a certain subplan or a version of it with the Status and Tracking System.

    Executing Customizing for the BW-BPS Status and Tracking System (R_STS_CUST)

    Controls access to Customizing for the Status and Tracking System. The object enables or forbids a user to execute Customizing.

    Authorization for special access Status and Tracking System (R_STS_SUP)

    This authorization object provides the assigned users with the status of a superuser in relation to the Status and Tracking System. The object enables changing access to all plan data, independent of whether and where a user of the cost center hierarchy it is based on is assigned. The authorization object is intended for members of a staff controller group, who are not part of the line organization of the company, but who nevertheless must be able to intervene in the planning process.

    SAP BW Authorizatin Objects - III

     
    Authorization Objects for the Administration of Analysis Authorizations

    Authorization Object/Technical Name

    Description

    Infrastructure of analysis authorizations/S_RSEC

    Authorization for assigning and administrating analysis authorizations

    BI analysis authorizations in role/S_RS_AUTH

    Authorization object for including analysis authorizations in roles

     
    Authorization Objects for Data Mining (Object Class RSAN):

    Technical Name

    Description

    RSDMEMBW

    Authorization for uploading data mining results into the BI system

    RSDMEMODEL

    Authorization for working with analytical models

     

    Authorization Objects for SAP DemoContent:

    Technical Name

    Description

    S_RS_RSFC

    Authorizations for SAP DemoContent

     

    SAP BW Authorizatin Objects - II

     
     
    Authorization Objects for Business Planning (Object Class RS):

    Authorization Object/Technical Name

    Description

    Planning: Aggregation level/S_RS_ALVL

    Authorizations for working with aggregation levels

    Planning function/S_RS_PLSE

    Authorizations for working with planning functions

    Planning sequence/S_RS_PLSQ

    Authorizations for working with planning sequences

    Planning service type/S_RS_PLST

    Authorizations for working with planning function types

    Lock settings/S_RS_PLENQ

    Authorizations for maintaining or displaying lock settings

     
    Authorization Objects for Working in the Business Explorer (Object Class RS):

    Authorization Object/Technical Name

    Description

    Business Explorer – components/S_RS_COMP

    Authorizations for using different components for the query definition

    Business Explorer – components/S_RS_COMP1

    Authorization for queries from specific owners

    Business Explorer – components/S_RS_FOLD

    Display authorization for folders

    Business Explorer – individual tools/S_RS_TOOLS

    Authorizations for individual Business Explorer tools

    Business Explorer – Enterprise Reports/

    S_RS_ERPT

    Authorizations for BEx enterprise reports

    Business Explorer – Enterprise Report reusable elements/

    S_RS_EREL

    Authorizations for reusable elements of a BEx enterprise report

    Business Explorer – data access services/S_RS_DAS

    Authorizations for working with data access services

     

    Business Explorer - BEx Web templates (NW 7.0+)/S_RS_BTMP

    Authorizations for working with BEx Web templates

    Business Explorer – BEx reusable Web items (NW 7.0+)/S_RS_BITM

    Authorizations for working with BEx Web items

    BEx Information Broadcasting authorization for scheduling/S_RS_BCS

    Authorization for registering broadcast settings for execution

    Business Explorer – BEx texts (maintenance)/S_RS_BEXTX

    Authorizations for maintaining BEx texts

     
     

    SAP BW Authorizatin Objects - I

     
    Authorization Objects for Working in the Data Warehousing Workbench (Object Class RS):

    Authorization Object/Technical Name

    Description

    Data Warehousing Workbench – objects/

    S_RS_ADMWB

    Authorizations for working with individual objects of the Data Warehousing Workbench. In detail, these are: source system, InfoObject, monitor, application component, InfoArea, Data Warehousing Workbench, settings, metadata, InfoPackage, InfoPackage group, Reporting Agent settings, Reporting Agent package, documents (for metadata, master data, hierarchies, transaction data), document store administration, (Customer) Content system administration, broadcast settings.

    Data Warehousing Workbench – InfoObject/S_RS_IOBJ

    Authorizations for working with individual InfoObjects and their subobjects.

    Until Release 3.0A, only general authorization protection was possible using authorization object S_RS_ADMWB. General authorization protection for InfoObjects still works as in the past. Special protection using S_RS_IOBJ is only used if there is no authorization for S_RS_ADMWB-IOBJ.

    Data Warehousing Workbench – DataSource (Release > BW 3.x)/S_RS_DS

    Authorizations for working with the DataSource (Release > BW 3.x) or its subobjects

    Data Warehousing Workbench – DTP/S_RS_DTP

    Authorizations for working with the data transfer process and its subobjects.

    The authorizations assigned for the DTP object have a higher priority than the authorizations for the underlying TLOGO objects. Users that have a DTP authorization for a source or target combination do not need read authorization for the source object or write authorization for the target object to execute the DTP.

    Data Warehousing Workbench – InfoSource (Release > BW 3.x)/S_RS_ISNEW

    Authorizations for working with InfoSources (Release > BW 3.x)

    Data Warehousing Workbench – InfoSource (flexible updating)/S_RS_ISOUR

    Authorizations for working with InfoSources with flexible updating and their subobjects

    Data Warehousing Workbench – InfoSource (direct updating)/S_RS_ISRCM

    Authorizations for working with InfoSources with direct updating and their subobjects

    Data Warehousing Workbench – transformation rules/S_RS_TR

    Authorizations for working with transformation rules and their subobjects

    Data Warehousing Workbench – InfoCube/S_RS_ICUBE

    Authorizations for working with InfoCubes and their subobjects

    Data Warehousing Workbench – MultiProvider/S_RS_MPRO

    Authorizations for working with MultiProviders and their subobjects

    Data Warehousing Workbench – DataStore object/S_RS_ODSO

    Authorizations for working with DataStore objects and their subobjects.

    Data Warehousing Workbench – InfoSet/S_RS_ISET

    Authorizations for working with InfoSets

    Data Warehousing Workbench – hierarchy/S_RS_HIER

    Authorizations for working with hierarchies

    Data Warehousing Workbench – maintain master data/

    S_RS_IOMAD

    Authorizations for processing master data in the Data Warehousing Workbench

    Data Warehousing Workbench – process chains/S_RS_PC

    Authorizations for working with process chains

    Data Warehousing Workbench – open hub destination/S_RS_OHDST

    Authorizations for working with open hub destinations

    Data Warehousing Workbench – currency translation type / S_RS_CTT

    Authorizations for working with currency translation types

    Data Warehousing Workbench – quantity conversion type / S_RS_UOM

    Authorizations for working with quantity conversion types

    Data Warehousing Workbench – key date derivation type/S_RS_THJT

    Authorizations for working with key date derivation types

    Authorization object for the RS trace tool/S_RS_RST

    Authorization object for the RS trace tool

    Authorization for the analysis process/RSANPR

    Authorizations for working with analysis processes