SAP Database


Database Tasks



Database statistics refresh jobs should be scheduled to run twice daily on all the SAP systems.  But occasionally a manual refresh needs to be done due to table reorganization, index rebuild, etc.

1.               Log on to the server using the <sid>adm user ID.
2.               Open the MS SQL Server Enterprise Manager.
3.               Expand the navigator tree until you see the Management entry.  Expand it.
4.               Right-click on Database Maintenance Plans and click New Maintenance Plan.
5.               Use the wizard to create the job you need.
6.               You may now close the Enterprise Manager session and log off the server.



1.               Log on to the appropriate SAP instance any client.
2.               Go to transaction DB13.
3.               On the DBA Planning Calender for Oracle Database <SID>: Maintain screen, double-click on a blank line on any day in the future.
4.               On the Schedule Action for <Day>. DD.MM.YYYY popup,  use the radio button to turn “on” the task you want to do.  For each action, you need to fill in the Start Time in military time format, the Period (Weeks) which is how many weeks between running of this job – blank for one time only, 1 for weekly, 2 for bi-weekly, etc. and Calender if you want to use any calendar except the SAP supplied standard Factory calendar.

These are the details for each action:

Whole database offline + redo log or
Whole database offline backup or
Whole database online + redo log or
Whole database online backup
      Generic tape names for database backup
      Database backup profile – usually init<SID>.sap
      Options for ReDo log backup
Redo log backup         
      Generic tape names for database backup
      Options for ReDo log backup
Partial database offline backup or
Partial database online backup  
      Tablespace names to be included in the back up
      Generic tape names for database backup
      Database backup profile – usually init<SID>.sap
Check and update optimizer status
      Tablespace names to be included in the statistics run
Adapt next extents              
      Tablespace names for next extents adaption
Check database     
      N/A      
Verify database                 
      Tablespace names to be verified
      Database backup profile – usually init<SID>.sap
Cleanup logs
      N/A                 

5.               You may now leave the DB13 transaction.






1.  Log on to the appropriate SAP instance and client using BATCH_USER.
2.  Go to transaction SM36.
3.  On the Define Background Job screen, fill in the Job name field with the new job name.  Select a Job Class priority of A for High, B for Medium, and C for Low.  It is SAP’s recommendation that all client-owned jobs begin with a Z for identification purposes.  And most Basis people recommend the next two characters be the initials for the SAP module for which the SAP instance runs.  Like ZBC* for a Basis job, and ZHR* for a Human Resources job.  Click on the Specify start condition button or press F5.
4.  On the Start Time popup, click the Immediate button to start the job right away, or click the Date/Time button to specify a date/time in the future for which the job run.  Click “on” the Periodic job radio button and then click the Period values button if you want to schedule to job to run on a periodic basis.  Provide the periodic values and click Save back to the main Define Background Job screen.
5.  On the main Define Background Job screen, click the Step button.
6.  On the Create Step 1 popup, fill in the ABAP program Name and any Variant needed to run the program – you had to have created the variant using BATCH_USER before using it here.  Then click Save once more.
7.  Back on the Define Background Job screen, check that all the job information is correct and then click the Save button one last time.





1.  Log on to the appropriate SAP instance and client as either the user ID owning the job or an administrator ID.
2.  Go to transaction SM37.
3.  On the Simple Job Selection screen, fill in the Job name field or use any of the screens filtering options to produce a list from which you can see the job to be changed.  In order for a job to be changed, it has to have a status of Schedule or Released so turn those statuses “on” and turn the rest “off”.  Click on the Execute button.
4.  On the Job Overview screen, click “on” the line containing the job to be changed and then click Job → Change.
5.  On the Change Job screen, make your changes and then click Save.  If you have more than one occurance of the same job in your list, you must change each job scheduled to run earlier than that job you just changed.  Once the job you changed runs, all occurences of the jobs running after that date will be changed as well.





1.  Log on to the appropriate SAP instance and client as either the user ID owning the job or an administrator ID.
2.  Go to transaction SM37.
3.  On the Simple Job Selection screen, fill in the Job name field or use any of the screens filtering options to produce a list from which you can see the job to be deleted.  In order for all occurances of a job to be deleted, all statuses of the job should be checked “on”.  And enter an all-encompassing date like 01-01-1990 through 12-31-2010.  Click on the Execute button.
4.  On the Job Overview screen, click “on” all the perpetent line containing the job(s) to be deleted and then click on the Delete job from database button.
5.  On the Delete Scheduled Jobs? popup, confirm the deletion.




1.  Log on to the appropriate SAP instance and client as either the user ID owning the job or an administrator ID.
2.  Go to transaction SM37.
3.  On the Simple Job Selection screen, fill in the Job name field or use any of the screens filtering options to produce a list from which you can see the job you want to view.  In order for all occurances of a job to be viewed, all statuses of the job should be checked “on”.  Click on the Execute button.



Deleting an Active aka Runaway Job

Opinions on this topic vary so these are good guidelines to use.  These are
pretty much in the order they should be tried:
1.  Kill the session via SM37 or SM04.
2.  Try End session through SM50 or cancel program from SM66.
3.  If the Work Process in SM50 is in stopped state then killing it will not help much or quickly, you need to identify why it is stopped (running a program on another server, runing in parallel etc.) Try and end those.
4.  Kill Work Process in SM50 without core.
5.  Kill process or PID via program RSBDCOS0.
6.  If all else fails, restart the SAP instance server.

The most important things to remember when killing a WP are:

1. Change to restart = no as otherwise the session can jump back in sometimes as most of its memory is not actually living in the WP.
2. Allow it a long time to
stop, there is no need to do it twice or 50 times as I have seen some people do, the poor old thing is just trying to recover rollback and reinitialize itself.




1.  Log on to the appropriate SAP instance and client.
2.  Go to transaction SE38 and type in Program name RSBTCDEL and click on the Execute button.
3.  On the Delete batch jobs screen, fill in the filtering information you need.  It is suggested that Delete with forced mode be “on”.  Click on the Execute button. 
4.  A status message will appear in the bottom Status Bar as the list of job logs to be deleted is built.  Once all the specified job logs have been deleted, a final total of jobs logs cleaned will appear in the bottom Status Bar.