How to delete an SAP lock Entries (SM12)

SAP lock is set by the executing workprocess when a user/job wants a change access to data.

Whenever a lock to be set the respective workprocess checks in the locktable whether a respective lock conflicts the existing entries in the locktable. If so, a lock is refused. If there is no conflict, then a lock is set.

There are different types of locks :

Write locks (E) : This is also known as exclusive lock mode as the lock data can be edited by only one user. Any other requests from workprocesses to set another write lock or read lock are rejected. A cumulate lock can be applied on the lock data by the same lock owner again.

Read locks (S) : This is also known as shared lock mode as several users can have read access to the locked data at the same time. Additional read lock requests are entertained even if they are from different users. However a write lock is rejected.

Enhanced write locks (X) : This is also known as exclusive non-cumulative lock mode. An enhanced write lock can be requested only once even if it is by the same transaction.

Difference between write locks(E) and Enhanced write lock(X) is write locks can be set and released by the same transaction several times but X type locks can also be set once even by the same transaction.

Optimistic locks (O) : These locks are set up when the users displays the data in change mode. Several optimistic locks can be setup on the same data. Optimistic locks are read locks(S) at first and converted to write lock (E) when the users wants to save the data. If an optimistic locks on a data is changed to write lock(E), all other optimistic locks on that data will be deleted.

Locks that are set by an application program are released by the program itself or they are released by the update program once the database has been changed.

Transaction code SM12 can be used to monitor SAP locks.

Here you have option of selecting locks based on following parameters
  • tablename
  • lock argument
  • client
  • username
  • In case, as part of monitoring, if you encounter some old sap locks and after thorough analysis, you would like to delete these, it can be done in the following ways :
    • Select the locks and delete the lock from SM12
    • Identify the user who has set the respective lock and end the user session using SM04 transaction code

How to change the number of workprocesses in sap

A work processes is used to execute a particular type of job in an sap system.

There are different types of workprocesses as mentioned below :

DIA   (Dialog workprocess) : 
      Used for execution of dialog steps triggered by active users. For every dispatcher atleast 2 dialog workprocesses to be configured

UPD  (Update workprocess) : 
        Used for execution of update tasks. Atleast one update workprocess to be configured per SAP system. Also, more than one UPD can be configured for a dispatcher

BTC  (Background workprocess): 
         Used for executing background jobs. Atleast 2 background workprocesses to be configured for an SAP system

SPO   (Spool workprocess) : 
        Used for passing sequential data to printers. Atleast one spool workprocess to be configured for an sap system.

UP2   (Update2 workprocess) : 
       This is similar to UPD workprocess. There is small difference in functionality based on criticality of the update.

ENQ  (Enqueue workprocess) : 
           This is required to administer locktable in the shared memory. Locktable contains database locks for ABAP stack of an sap system. Only one enqueue process to be configured for an SAP system.


To increase/decrease the number of workprocesses, value to be changed accordingly for the following parameters as per workprocess in RZ10 Transaction.

rdisp/wp_no_dia  (for dialog workprocess)
rdisp/wp_no_btc  ( for background workprocess)
rdisp/wp_no_spo  (for spool workprocess)
rdisp/wp_no_enq  (for enqueue workprocess)
rdisp/wp_no_vb    (for update workprocess)
rdisp/wp_no_vb2  (for update2 workprocess)

In RZ10 transaction, select the profile of the instance, for which workprocess number to be changed and edit the profile through extended maintenance and save the changes done and activate the profile.

Please note that as this parameter is not dynamic one, restart of the application server is required for the changes to become effective.

How to determine the size of the client in SAP

1) Goto Transaction SE38 and run report RSSPACECHECK as shown below




In the next step, please provide the client for which the size to be determined and please make sure below settings are kept and run the report.





The output of this report lists the size of the client

2) You can determine size of the client running  Local client copy (SCCL transaction) in test mode.




Provide the reqeusted  details of source client and target client and please donot forget to tick Test Run option before executing





Click continue in the above screen to proceed further.





Click on Resource Check push button in the above screen. The output of this will provide the size of the client.

How to Reset Buffers in Sap

You should run the following in SAP command field.

Note: Resetting of the buffers could change the performance of the entire system

/$DYNP - To reset the screen buffer of the application server

/$SYNC - This command resets the buffers of the application server

/$CUA   - This resets the CUA buffer of the application server

/$TAB   - This resets the TABLE buffers of the application server

/$NAM  - To reset the nametab buffer of the application server

How to lock, unlock client in SAP

Go to --> se37 Function module Run this module to Lock and Unlock Client

1. SCCR_LOCK_CLIENT (for the client)

2. SCCR_UNLOCK_CLIENT (to unlock the client)

                                         This function is used to lock/unlock the client from the user's login. When you lock a client,all users had attempted to enter the client will indicate the message "this client is blockedfrom entering". Client logon will be available is available only to users SAP * and DDIC.

To unlock:

1. start tr. SE37

2. type the module name SCCR_UNLOCK_CLIENT

3. press F8 to activate

4. Enter the client number and press (F8).


To block the procedure is similar, only with the module SCCR_LOCK_CLIENT

List of some common tables for which table logging should be enabled

Table

Description

T000

List of clients

T001

Company Codes

TSTC

Definition of tcodes

TOBJ

Definition of Authorization objects

TACTZ

Valid activities

TSTCP

Parameters for Transactions

TPGP

Authorization Groups for Programs

TBRG

Authorization Groups for Tables

TDDAT

Table to Authorization group mapping

TNRO

Definition of number range objects

TSTCA

Values for Transaction code authorizations

Setting ORACLE DB into noarchivelog mode

Steps when the database state is down:
1. Login to sqlplus
  -sqlplus /nolog
  -connect / as sysdba
2. The db must be mounted EXCLUSIVE and not open for operation
  -startup mount;
3. Check the log mode status of the database
  -select log_mode from v$database;
4. Setting it to noarchivelog mode
  -alter database noarchivelog;
5. Setting db open for user operation
  -alter database open;
6. Reverting back to archivelog mode
  -alter database archivelog;

how to check character set in Oracle

How to check character set in Oracle

One of the requirements for samePage is that the character set should be UTF-8.

You can either check with your DBA or run the following SQL to determine whether your database character set is UTF-8. 


SELECT value$ FROM sys.props$ WHERE name = 'NLS_CHARACTERSET' ;

It should return the value AL32UTF8.
Another option is to run the following SQL :

SELECT * FROM NLS_DATABASE_PARAMETERS


The value against NLS_CHARACTERSET should be UTF8.