Removing semaphores shared memory keys with ipcrm


IPC remove error: 


OsKey:    10101 0x00002775 Shared Memory Key: 1  remove failed **** - errno = 1 (Not owner)
OsKey:    10102 0x00002776 Shared Memory Key: 2  remove failed **** - errno = 1 (Not owner)
OsKey:    10103 0x00002777 Shared Memory Key: 3  remove failed **** - errno = 1 (Not owner)
OsKey:    10104 0x00002778 Shared Memory Key: 4  remove failed **** - errno = 1 (Not owner)
OsKey:    10106 0x0000277a Shared Memory Key: 6  remove failed **** - errno = 1 (Not owner)
OsKey:    10107 0x0000277b Shared Memory Key: 7  remove failed **** - errno = 1 (Not owner)
OsKey:    10108 0x0000277c Shared Memory Key: 8  remove failed **** - errno = 1 (Not owner)
OsKey:    10109 0x0000277d Shared Memory Key: 9  remove failed **** - errno = 1 (Not owner)
OsKey:    10110 0x0000277e Shared Memory Key: 10 remove failed **** - errno = 1 (Not owner)
OsKey:    10114 0x00002782 Shared Memory Key: 14 remove failed **** - errno = 1 (Not owner)
OsKey:    10118 0x00002786 Shared Memory Key: 18 remove failed **** - errno = 1 (Not owner)
OsKey:    10119 0x00002787 Shared Memory Key: 19 remove failed **** - errno = 1 (Not owner)
OsKey:    10130 0x00002792 Shared Memory Key: 30 remove failed **** - errno = 1 (Not owner)
OsKey:    10131 0x00002793 Shared Memory Key: 31 remove failed **** - errno = 1 (Not owner)
OsKey:    10133 0x00002795 Shared Memory Key: 33 remove failed **** - errno = 1 (Not owner)


[Thr 01] profile    /usr/sap/SID/SYS/profile/SID_SCS01_host

[Thr 01] hostname  
[Thr 01] Listen successful on port/service sapdp01
[Thr 01] EnqInitCleanupServer: Shm of enqueue table (rc = 3) does not exist, nothing to clean up[Thr 01] initialize_global: Enqueue server started WITHOUT replication functionality[Thr 01] Enqueue: EnqMemStartupAction Utc=1328995554[Thr 01] Enqueue Info: enque/use_pfclock2 = FALSE[Thr 01] *** ERROR => e=13 semop(16481,(0,-1,4096),1) (13: Permission denied) [semux_mt.c   570][Thr 01] ***LOG GEA=> SemRq( 26, 1, INFINITE_WAIT) rtc=1 [enxxmini.h   605][Thr 01] ***LOG GEI=>  [enxxmgen.h   2445][Thr 01] *** ERROR => Initialization failed. [enxxmgen.h   2445][Thr 01] *** ERROR => initialize_global: failed to initialize the enqueue table: rc=8 [enservglob.c 811][Thr 01] *** ERROR => main: Server initialisation failed!  Errortext:"error at server initialisation detected at enservglob.cpp:812 Errorinfo: "initialize_global: failed to initialize the enqueue table: rc=8"" [enservmain.c 248]


Removing semaphores shared memory keys with ipcrm

Sometimes we are not able to remove the shared memory keys with cleanipc 52 remove command, we can find the culprit this way :

ipcs | grep crdadm | awk '{printf("ipcrm -s %s\n", $2);}'

or if we already have the error like that

root@ logpipe[16010]: (start_app crd0v 52 crdadm 1): OsKey: 25238 0x00006296 Semaphore Key: 38 remove failed **** - errno = 1 (Not owner)

you may find the cultprit by

## ipcs | grep 0x00006296

it will give the ownere as well

now log in as the owner and give the command

## ipcrm -s 687 (687 is the semaphore ID)

SAP ABAP system memory parameters

ztta/roll_area : Roll area size



Description: The value specifies the size of the roll area in bytes. The roll area is one of several memory areas, which satisfies the user requests of user programs. For technical reasons, however, the first 250 KB or so of a user context are always stored in the roll area, further data



- up to the roll area limit ztta/roll_first,



- in the extended memory, up to the limit ztta/roll_extension or If extended memory is exhausted, then



- again in the roll area, until the roll area is full, then



- in the local process area, up to the limit abap/heap_area_dia



or abap/heap_area_total or until the address space or the swap space is exhausted.



Followed by termination with errors like STORAGE_PARAMETERS_WRONG_SET an error code, that points to memory ottleneck



Aim:



Minimum data transfer with context change; however, the increase helps to avoid problems (address space, swap space, operating system paging)



Unit: Bytes



Dependencies:



rdisp/ROLL_SHM: Should be adjusted because of ztta/roll_area



rdisp/ROLL_MAXFS: Must be adjusted because of ztta/roll_area can be checked by ST02




ztta/hold_data_area: Buffer for User Set/Get Values



Size of the shared memory buffer for user Set/Get data



(System -> User defaults -> Get/Set).



Use: Tuning.



ztta/roll_extension: Short description: Quota for extended memory



Description:



This value specifies the storage quantity in bytes that a dialog user context can allocate (extended memory). The value refers to the storage quantity that an external mode (=SAP window) allocates. When the specified value is exceeded, memory from the roll area is allocated until this is full. Local memory is then allocated.



( Data in the roll area is copied at context change When local memory within the work process is allocated, the work process is assigned to this user context and is no longer available for other user contexts (PRIV mode).) If you set the value too high, a user could cause a bottleneck in the extended memory by increasing his user context. Other smaller user contexts would bring work processes to PRIV mode before their allowed quota is reached.



Objective: Minimize no. of work processes in PRIV mode. Allocate extended memory fairly.



ztta/roll_first : Quota for early allocation in the roll area




Parameter description :



The value specifies the amount of memory in bytes that is allocated from the roll area, before memory is allocated from the extended memory. This means that small user contexts remain complete in the roll area. Any wastage and therefore total consumption of the extended memory can be minimized, because extended memory is assigned to users in granules of a specific length (usually 1 MB).



Only effective in dialog work processes. (Windows NT) Effective in all work processes, due to identical allocation sequence (Windows NT).



Aim:



Optimum usage of the extended memory



ztta/short_area : Size of short-term memory



Parameter description :



Size of memory available in the short term, i.e. until the next "rollout"



The value must be at least 7 times the size of ztta/cua_area



Work area: System




abap/heap_area_dia: Heap memory quota for dialog work processes



Description:



Defines the local process memory quota (heap, malloc) for a user context in a dialog work process. The aim is to avoid a swap space bottleneck if a user context becomes too large.

Changing SDM Server Modes

To change the SDM Server mode please read more

You need to stop the SDM Server first as follow:

Stopping/Starting SDM Server

WINDOWS

  1. Navigate to the usr/sap///SDM/program directory of your J2EE Engine installation.
  2. To stop the SDM Server, execute the command:

    StopServer

  3. To start the SDM Server, execute the command:

    StartServer

  4. or simply start the SAP Management Console by choosing Start ® Programs ® SAP Management Console.
  5. From the tree, choose SAP Systems® ® ® Process Table.
  6. Select the SDM process

    To start it, choose Enable Process in the context menu.

    To stop it, choose Disable Process in the context menu.

UNIX

  1. Navigate to the usr/sap///SDM/program directory of your J2EE Engine installation.
  2. To stop the SDM Server, execute the command:

    StopServer.sh

    To start the SDM Server, execute the command:

    StartServer.sh

Change SDM Server Mode

  1. Navigate to the usr/sap///SDM/program directory of your J2EE Engine.
  2. Open a command prompt in this directory.
  • To remove the link between the SDM and the Java Control Framework execute the following command in the command line:

    sdm jstartup "mode=standalone" for Windows

  • sdm.sh jstartup mode=standalone for UNIX

  • To integrate SDM in the Java Control Framework, use the following command:

  • sdm jstartup "mode=integrated" for Windows

  • sdm.sh jstartup mode=integrated for UNIX

Lock a Client to Prevent Logons

You can lock a system at the OS level by running: tp locksys pf=tpprofile

Example: To lock your DEV system enter this command:
tp locksys DEV pf=tp_domain_dev.pfl

Users will get this message if they attempt to log on: "Upgrade still running. Logon not possible".

Notice that the message is not exactly accurate. TP locksys is mainly used during release upgrades so the message is kind of generic.

To unlock the system,
run: tp unlocksys pf=tpprofile


Only SAP* and DDIC can log on to any of the clients in the system that has been locked.


Check if your SAP servers are alive from the Command Prompt

This is a very useful tip that can help you check if an SAP R/3 server is up and running. This way, you don't have to log on to the system just to find out.
Additionally, you can create another script that uses the FOR command to check ALL your servers so you don't have to check one by one. Have the script do the job for you.

The key to this script is the command SAPINFO.exe, which comes on the SAPFrontEnd CD (SAPGUI). It's part of the SDK. If you don't have the file, e-mail me and I'll send it to you.

The syntax of SAPINFO is:
sapinfo ashost=host sysnr=nn

When used in a batch file (.bat or .cmd) you can check the errorlevel returned by the program. If it is 1 then the system is not up and running.

My script below first checks if the system is on the network by 'pinging' it and expecting a reply.

If you want to check all your systems, then create another script (example: checkallrfcs.bat) and use this command:

FOR /F %%i in (SAPsystems.txt) do call checkrfc %%i 00

The command above reads the file SAPsystems.txt, which should have a list of all the servers (one server name per line) and then it invokes the script 'checkrfc' passing the server name as a parameter. The 00 indicates the instance number.

I believe you will find it extremely useful and it will save you tons of time.
Now, you can just run the script, sit back and watch it report the status of the systems.



Script code:
@echo off
rem ======================================================================
rem Script: CheckRFC.BAT
rem It uses SAPINFO from the RFC-SDK (SAPGUI) to check an RFC destination.
rem It needs two parameters: 1. Hostname 2. Instance Number
rem A ping is sent to the host. If successful an RFC check is carried out.
rem By: Giovanni Davila
rem ======================================================================

if "%2"=="" goto NoParameter
echo Pinging %1 ...
ping %1 -n 2 | find /i "reply" >nul && goto CheckRFC
echo System does not exist on the network! & goto Bye

:CheckRFC
sapinfo ashost=%1 sysnr=%2 & if errorlevel 1 goto System_Down
echo ----------------------------
echo System is up. RFC checks OK!
echo ----------------------------
goto Bye

:System_Down
echo ---------------
echo System is down!
echo ---------------
goto Bye

:NoParameter
echo ----------------------------------------------
echo You did not specify at least one parameter!
echo Syntax: checkrfc "hostname" "instance number"
echo Example: checkrfc mydev 00
echo ----------------------------------------------

sorry, your browser/program is not supported by Web Dynpro!

Solution: SAP note 1347768

1. Change configuration of supported clients.

a) Open Visual Administrator. On the relevant server instance, navigate to "Services -> Configuration Adapter". In the detail view, a tree becomes visible. Navigate to "webdynpro -> sap.com -> tc~wd~dispwda -> "Propertysheet clients". Open this propertysheet in edit mode by pressing the "Edit" button on the toolbar.

b) Change following property in the propertysheet wizard.

property "msie6.recognition".

Default value is: "MSIE 6."

change custom value to: "MSIE" and click 'Apply custom' button.



c) Having done this, close the wizard and press again the "Edit" button to save the changes. Afterwards, a restart of the engine is required in order to make these changes effective. The WebDynpro runtime should now be able to allow the usage of Microsoft IE8 browser.

2. Change the compatibility view settings in IE8 browser.

a) In the browser, Go to menu Tools -> Compatibility View Settings.

b) Select the checkbox "Display all websites in Compatibility View" and click on the 'Close' button.

c) Close all browser sessions and then open a new browser window. The WebDynpro runtime should now be able to allow the usage of Microsoft IE8 browser.

Errors in SPAM Steps


If an error is recognized in a step, the SPAM transaction stops the processing
until the error is corrected. You can get information about the reason the
SPAM transaction was stopped and in which step by choosing Status.

Error Types

Here are the following types of error messages:

Security checks for transaction SPAM

A typical example is the step OBJECTS_LOCKED?. If objects are still locked
requests that should be overwritten by the patch queue, the SPAM transaction
stops processing.

Error messages from the programs tp and R3trans

You can always find the cause of the error in the relevant transport log. A
typical example is the step TEST_IMPORT. A check is made whether there are
unconfirmed repairs to objects that should be overwritten by the patch queue.
The relevant objects are listed in the test import log.

Incorrect setup of the transport system.

Often the errors here are not having the relevant authorizations to files of
the transport system, or using old program versions of tp or R3trans . Check
the correct function of the transport tools by choosing Utilities ® Check
transport tools.

A typical example is the step DISASSEMBLE. If
adm does not have write authorization for the directory /usr/sap/trans/data
(UNIX), SPAM stops at the step DISASSEMBLE with CANNOT_DISASSEMBLE_R_DATA_FILE
.

The SPAM transaction requires that the Workbench Organizer (WBO) and the
transport system are set up. You can find more information on this topic under
BC Change and Transport Organizer.

You can find more information on known problems in the Notes 97630 and 97620.

Known Problems

PROLOGUE

In this step, you are asked via a dialog box to confirm the patch
application. If you are not authorized to execute the SPAM transaction or the
current patch queue has not yet been confirmed, the SPAM transaction is
stopped with a corresponding message.


CHECK_REQUIREMENTS

In this step, various requirements for the patch application are checked.
The following messages explain why this step may be terminated:

- TP_CANNOT_CONNECT_TO_SYSTEM : tp cannot log onto the system’s database.


DISASSEMBLE

In this step, files from the corresponding EPS parcels are unpacked and
stored in the directory /usr/sap/trans/data (UNIX). The command files (cofiles)
from the accompanying files are generated and are stored in the directory /usr/sap/trans/cofiles
(UNIX). The following messages explain why this step may be terminated:

- CANNOT_SKIP_ATTRIBUTE_RECORD : The attributes could not be read in the EPS
parcel. The file cannot be opened for reading, because it may have been
deleted in the meantime.

- CANNOT_DETERMINE_EPS_PARCEL : The EPS parcel is not in the EPS Inbox,
because it may have been deleted. You must download the relevant patch again
(for example, Hot Package).

- CANNOT_DETERMINE_DATA_FILES : The name of a data file could not be
determined, because a profile parameter was not correctly configured. Check
the settings using the report RSPARAM.

- CANNOT_DISASSEMBLE_R_DATA_FILE : An R3trans data file could not be unpacked.
A possible error source is that the relevant EPS parcel was not found. The
data file could not be opened for writing. An error occurred when transmitting
a 20K block from the EPS Inbox to the directory /usr/sap/trans/data (UNIX).

- CANNOT_DISASSEMBLE_D_DATA_FILE : An ADO data file could not be unpacked. The
reasons are the same as with the message CANNOT_DISASSEMBLE_R_DATA_FILE .

- CANNOT_CREATE_COFILE : The cofile could not be created from the relevant
data file. One possible error source is that
adm does not have write authorization for the directory /usr/sap/trans/cofiles
(UNIX).

You can find more information on this topic in Note 70752.


ADD_TO_BUFFER

In this step, the patch queue is put into the transport buffer of your
system. The following messages explain why this step may be terminated:

- TP_INTERFACE_FAILURE : The tp interface could not be called. There is an RFC
error.

- CANNOT_ADD_PATCH_TO_BUFFER : A patch could not be included in the transport
buffer. You can find more information in the SLOG system log file in the
directory /usr/sap/trans/log (UNIX).

- CANNOT_MODIFY_BUFFER : An unsuccessful attempt was made to modify the
transport buffer.


TEST_IMPORT

In this step, the system checks if there are still objects in tasks which
have not yet been released and are overwritten when the patch is applied. You
can find the source of error in the log of the test import. For further
information, see the Note 42379.


IMPORT_OBJECT_LIST

In this step, the object lists for the patches in the queue are imported
in the system. The following messages explain why this step may be terminated:

- TP_INTERFACE_FAILURE : The tp interface could not be called.

- TP_FAILURE : The program tp could not be executed. You can find more
information in the SLOG and/or the ALOG log file.

- COMMAND_FILE_IMPORT_FAILURE : The object list for one or several patches
could not be imported. You can find the source of error in the log of the
command file import.


OBJECTS_LOCKED_?

In this step, the system checks if there are still objects in requests
that have not yet been released and are overwritten when the patch is applied.
The following messages explain why this step may be terminated:

- CANNOT_GET_OBJECT_LIST : The object list for a patch could not be found,
because the patch does not exist.

- CANNOT_CHECK_LOCKS : An error occurred when checking the locks of an object
in the patch queue.

- OBJECTS_LOCKED_IN_REQUESTS : Objects were found that are still in requests
that have not yet been released. Before continuing with applying the patch,
release these requests.


SCHEDULE_RDDIMPDP

In this step, the transport daemon (program RDDIMPDP) is scheduled. The
following messages explain why this step may be terminated:

- CANNOT_SCHEDULE_RDDIMPDP : The job RDDIMPDP could not be scheduled. Call
Transaction SM37 (job selection), enter the following parameters and then
choose Continue:

Job name

RDDIMPDP

User name




Trigger event

SAP_TRIGGER_RDDIMPDP

Select the job that was terminated and display the job log.

- Problems with the SAP locking mechanism: Call Transaction SM12 and ensure
that there are no programs listed with the name RDDIMPDP. For further
information, see the Note 11677.

GENERATE_BACKUP

In this step, a backup copy of the objects is generated that are overwritten
when the patch is applied. The following messages explain why this step may be
terminated:

- CANNOT_FIND_BACKUP : Using the first patch in the patch queue, it is
determined whether a backup already exists. If the step is terminated, the
patch does not exist. Therefore the backup cannot be determined.

- CANNOT_CREATE_EMPTY_BACKUP : An unsuccessful attempt was made to generate a
backup.

- CANNOT_COPY_PATCH_TO_BACKUP : For each list in the patch queue, the object
list is copied to the backup. This action terminates for a particular patch.

- CANNOT_SORT_N_COMPRESS_BACKUP : The complete object list in the backup is
sorted and compressed before the export. An error occurred here.

- CANNOT_EXPORT_BACKUP : The backup could not be exported successfully. The
reason for the step being terminated is in the message that tp returns to the
SAP Patch Manager.

- CANNOT_ANALYSE_EXPORT_RC : The tp return code could not be analyzed
successfully.

- CANNOT_ADD_BACKUP_TO_BUFFER : After the backup has been generated, it is
saved to the SAP transport buffer to protect it from being unintentionally
deleted. The reason for the step being terminated is in the message that tp
returns to the SAP Patch Manager.


ADDON_CONFLICTS_?

In this step, the system checks if there are conflicts between objects in
the patch queue and installed add-ons. If there are any conflicts, SPAM
terminates and asks you to import the relevant Conflict Resolution Transports
(CRTs). The following messages explain why this step may be terminated:

- CANNOT_GET_OBJECT_LIST : The object list for a patch could not be
determined, because the patch does not exist.

- CANNOT_GET_LAST_UPGRADE_INFO : The information about the last Repository
switch upgrade could not be determined.

- UNRESOLVED_ADDON_CONFLICTS : Conflicts with add-ons could not be resolved,
because the relevant CRTs are missing from the patch queue.


SPDD_SPAU_CHECK

In this step, the system checks if a modification adjustment is necessary
(Transactions SPDD/SPAU).


DDIC_IMPORT

In this step, the ABAP Dictionary is imported. The following messages
explain why this step may be terminated:

- TP_INTERFACE_FAILURE : The tp interface could not be called.

- TP_FAILURE : The program tp could not be executed. You can find more
information in the SLOG and/or the ALOG log file.

- CANNOT_IMPORT_DDIC : The ABAP Dictionary could not be imported. You can find
the source of error in the Dictionary import log.


AUTO_MOD_SPDD

In this step, the system checks if modifications to the ABAP Dictionary
objects can be adjusted automatically.

RUN_SPDD_?

In this step, you are asked to adjust your modifications to the ABAP
Dictionary objects by calling Transaction SPDD.

IMPORT_PROPER

In this step, the Repository including all table entries is imported The
following messages explain why this step may be terminated:

- TP_INTERFACE_FAILURE : The tp interface could not be called.

- TP_FAILURE : The program tp could not be executed. You can find more
information in the SLOG and/or the ALOG log file.

- TP_STEP_FAILURE : A tp step could not be performed successfully. You can
find the source of error in the relevant log, for example, in the import or
generation log. If the generation is terminated ( tp step G), you can correct
the error either immediately or after the patch has been applied. In the
second case, you must perform the following steps:

1. To ignore the generation errors, choose Extras ® Ignore gen. errors.

2. Continue applying the patch.

Generation errors can also be caused by buffer synchronization problems. For
further information, see the Note 40584.

If a tp step is listed in a termination message, it concerns a step that is
independent of the transport request. The step’s log cannot be displayed
using the pushbutton Log. In this case, analyze the following files:

tp step 6: P


.


tp step N: N

.


tp step S: DS

.


All the logs are located in /usr/sap/trans/log . You can display them using
the report RSPUTPRT or Transaction AL11.

AUTO_MOD_SPAU

In this step, the system checks if modifications can be adjusted
automatically.

RUN_SPAU_?

In this step, you are asked to adjust your modifications to the Repository
objects by calling Transaction SPAU.

EPILOGUE

In this step, the patch application is ended. The system checks if the patch
queue has been completely processed. In this case, there should be no more
transport buffer entries for the queue. The following messages explain why
this step may be terminated:

- TP_INTERFACE_FAILURE : The tp interface could not be called.

- TP_FAILURE : The program tp could not be executed. You can find more
information in the SLOG and/or the ALOG log file.

- QUEUE_STILL_IN_BUFFER : The patch queue is not fully processed, because
incomplete patches of the queue are still in the transport buffer.

- CANNOT_RESET_FCS_FLAG : If an FCS Final Delta Patch (FFDP) is in the patch
queue, the system is marked as Final State after the patch is applied. In
this case, this operation could not be successfully performed.

IDOC Status Code

IDOC Status CodeStatus Description

00 Not used, only R/2
01 IDoc generated
02 Error passing data to port
03 Data passed to port OK
04 Error within control information of EDI subsystem
05 Error during translation 06 Translation OK
07 Error during syntax check
08 Syntax check OK
09 Error during interchange handling
10 Interchange handling OK
11 Error during dispatch
12 Dispatch OK
13 Retransmission OK
14 Interchange Acknowledgement positive
15 Interchange Acknowledgement negative
16 Functional Acknowledgement positive
17 Functional Acknowledgement negative
18 Triggering EDI subsystem OK
19 Data transfer for test OK
20 Error triggering EDI subsystem
21 Error passing data for test
22 Dispatch OK, acknowledgement still due
23 Error during retransmission
24 Control information of EDI subsystem OK
25 Processing despite syntax error (outbound)
26 Error during syntax check of IDoc (outbound)
27 Error in dispatch level (ALE service)
28 Not used 29 Error in ALE service
30 IDoc ready for dispatch (ALE service)
31 Error - no further processing
32 IDoc was edited
33 Original of an IDoc which was edited
34 Error in control record of IDoc
35 IDoc reloaded from archive
36 Electronic signature not performed (timeout)
37 IDoc added incorrectly
38 IDoc archived
39 IDoc is in the target system (ALE service)
40 Application document not created in target system
41 Application document created in target system
42 IDoc was created by test transaction
50 IDoc added
51 Application document not posted
52 Application document not fully posted
53 Application document posted
54 Error during formal application check
55 Formal application check OK
56 IDoc with errors added
57 Test IDoc: Error during application check
58 IDoc copy from R/2 connection
59 Not used
60 Error during syntax check of IDoc (inbound)
61 Processing despite syntax error (inbound)
62 IDoc passed to application
63 Error passing IDoc to application
64 IDoc ready to be transferred to application
65 Error in ALE service
66 IDoc is waiting for predecessor IDoc (serialization)
67 Not used
68 Error - no further processing
69 IDoc was edited
70 Original of an IDoc which was edited
71 IDoc reloaded from archive
72 Not used, only R/2
73 IDoc archived
74 IDoc was created by test transaction