Sunday, 18 September 2016

SAP user types


There are 5 user types available in SAP
1.      Dialog
2.      Communication
3.      System
4.      Service
5.      Reference















Dialog:  This is the most commonly used type. This user type is primarily for individuals to gain interactive system access.  A user of this type can perform dialog processing in interactive mode, background processing, batch input processing and CPI-C services provided there are no explicit restrictions via assignment of specific authorizations.
SAP licensing can prohibit multiple concurrent use of the same user id in production SAP systems.

Communication:  This user type is used for dialog-free communication between systems such as RFC (Remote Function call) communication. This user is not allowed to logon to the R/3 system or start dialog processing
Example: TMSADM

System: This is the user type which can be used for dialog-free communication within a system (such as for RFC users for ALE, TMS, workflow and CUA) and for background processing.
A specific use of the system user type is validity period of a password won’t apply for this type. So, this can be used to run background jobs and in between RFCs so that jobs or RFC communications won’t fail due to expiry of the password.
Please note that logon in dialog is not possible.

IMPORTANT NOTE:
In general, RFC users can be of any user type, but for security reasons it is recommended to use only system users for RFC communications.
This is to avoid accessing dialog processes.

Service: This user type is a dialog user which is available to a large, anonymous group of users. For example, to access via ITS (Internet Transaction Server)
There won’t be any check on initial password or expired passwords for this user type. Also, multiple logons are explicitly permitted for this user type.
However this user type should be assigned with great caution and with limited authorizations for security reasons.

Reference:  This user type is in general, non-person related user.  This user type cannot be used for logon. Instead this user type will serve as a reference for assigning additional identical authorizations to other users.
For example: In case you have to assign some identical authorizations to all internet users, you can create a reference user with those authorizations and use this reference user to assign identical authorizations to all other users.

Important RFC tables and reports like RFCDES

Table RFCDES

It is the standard SAP table which stores the RFC destinations.
It describes logical destinations for remote function calls (RFCs).
We can't maintain the table RFCDES directly.

Simple advantage example of using table RFCDES

If password is changed for the user, the same has to be updated in the respective RFC connection under 'Logon and Security' tab in SM59.
As there are several RFCs and it might be difficult to find out in which RFC, the user being is used.
We can easily get the RFC name in SE16, instead of searching for it manually in SM59.
a)  SE16 --> RFCDES
b)  Enter the user name in 'RFC user' field.
The output contains the RFC name along the below parameters:
H = Target Host
S = Instance number
M = Client number
U = User name
V = Password

Saturday, 17 September 2016

How to check the active database parameters in SAP

Go to transaction DB02 -->Additional Functions --> Database parameters

 There are 3 sections available 

  1. Active parameters: To view the active database parameters

  1. Parameters history --> Show parameters history --> To check the database parameters that are changed in the recent past 
·         Provide the date under the field 'Enter date' to view the database parameter changes from the selected date 
  1. SPFILE: To view the SPFILE parameters

Wednesday, 14 September 2016

Activate and deactivate archivelog mode in Oracle

REQUIREMENT: 

During the client copy activity, a lot of archive log files will be created due to lots of changes are being done to the target system.
  1. Hence it is required to run the Archive log backup frequently. If not, there is a fair chance that Archive directory becomes 100%.
  2. We can get rid of the issue by extending the disk space and by scheduling the Archive log backup periodically (for example, every 30 minutes).
  3. But many prefer it to disable the archiving (which means- run the database in NOARCHIVELOG mode) before the client copy, due to the disk space limitations.
  4. Turning off the archiving avoids archive stuck situations as no logs are created, also the client copy will be faster.
Below are the steps to be followed to disable the ARCHIVELOG mode.

[1] Check the current status of ARCHIVE LOG mode

Issue the below command from Oracle SQL prompt

SQL > select  log_mode from v$database;

LOG_MODE
------------------
ARCHIVE LOG

The result from the above command is: Database is in 'ARCHIVE LOG' mode.
Our aim is to disable the archive log mode.

[2] shutdown the oracle database with the below command

SQL > shutdown immediate;

[3] Database should be in 'MOUNT' status (Command is as below)

SQL> startup mount

[4] Now we are good to issue the below command to disable the ARCHIVE LOG mode

SQL > alter database noarchivelog;

[5] Final command is to open the database

SQL > alter database open;

NOTES:
  • ARCHIVE LOG mode status is changed now and the status can be checked with the command from the step [1]. 
  • Please make sure that re-enable the archiving after the client copy is finished. Follow the same steps except replacing the command in step [4] with alter database archivelog; 

Tuesday, 13 September 2016

Activate Trace in SAP system using ST12

There are several transaction codes available to activate the trace in SAP system for example ST01, ST05 and ST12.

But from the Basis administrative perspective ST12 is the most powerful transaction code which can be used to trace the user activity to capture the performance statistics.

There are 4 sections available for the input which is necessary to start the trace.

1.    Trace for
2.    ABAP trace
3.    Performance traces
4.    Start Trace

[1] TRACE FOR

There are 4 modes available.

  1. User/Tasks: This is to capture the activities performed by an user

Note: At a time trace is possible only for 1 user

  1. Workprocess: Trace for the workprocess allows us to select a specific server for which trace is required. If not selected, all the servers will be captured for the trace.

  1. Current mode: To trace our own activity. This option is used trace the flow of a Transaction or a Program

  1. Schedule: To trace the activities which will be performed at a scheduled time. This is used to trace the batch job based on the selection criteria (Job name, User name, ABAP Program and variant of this program)

Note: In general this option is used if no one from the Basis team is available to switch on the trace during that specific future period.


Note: Of the above 4 modes, most of the time we use the User/Tasks mode.

There are 5 fields available under this mode User/Tasks.

  1. Comment: Any description, for example...'long running query'

  1. Server: Server name on which user is performing the activity, it is recommended to select "ALL servers" which means the trace will be collected for all the servers

  1. Username: SAP user ID for which trace is required

  1. Tasktype: Type of work process. it is recommended to select "*" so that all the tasks will be captured

  1. No. trace activations: Recommended to keep the default value

[2] ABAP TRACE

  • There is a setting available under ABAP trace "Size&Duration", where we can specify 'size of the output file' and the 'duration' for which output is required. Trace will be stopped if it exceeds the file size.
  • It is advised to keep it as "Max." so that the complete trace will be captured until the trace is stopped. However better to have several smaller traces for long activities. 

[3] PERFORMANCE TRACE

There are 3 kind of operations available here:

  1. SQL: If the program access the database table, it tracks the corresponding SQL operation
  2. RFC: Performance of the calls made by the program will be captured
  3. Enqueue: Application locks information like who, where and when are captured

[4] START TRACE

  1. Select either the ABAP Trace or Performance trace or both. It is advised to select both.
  2. Switch on the trace by selecting the option "Start trace".
  3. Inform user to perform the activity.
  4. Once the user is confirmed that the activity is completed, select the "End traces & collect".
  5. This will pop-up a new screen of "Collect traces", select the required rows and then  'Enter'.
  6. The trace generation may take some time, after which the trace is ready for the analysis.