SAP-BASIS Admin and Troubleshooting SOP - baixardoc
-
Upload
khangminh22 -
Category
Documents
-
view
2 -
download
0
Transcript of SAP-BASIS Admin and Troubleshooting SOP - baixardoc
1 General administration task
1.1 Start and stop of an SAP R/3 instance
1.1.1
SAP AG 1999
Starting the R/3 System
Logon
<sid>adm
1. Start the Central Instance
saposcolCentralInstance
11
22
33 44 55
Operating system UNIX
Database
<host>> startsap( startsap_<host>_<instance no>)
UNIX shell .
2. Start additional R/3 instances
startdb script
If not started If not started
The operating system user logs on to the UNIX operating system as user <sid>adm.
To start R/3, run the shell script startsap_<host>_<instance_no> from the home directory of user
<sid>adm. The script startsap_<host>_<instance no> has the alias startsap.
startsap starts the saposcol process, which is the statistics collector for operating system resource data, if
it is not yet running.
startsap calls the script startdb, which starts the database if it is not already started.
startsap then starts the central instance.
The R/3 System administrator can start additional instances and application servers. To start the
instances independently of the database, use the script startsap.
startsap has the following options:
startsap r3: Checks if the database is running; if it is, only the instance is started
startsap db: Starts only the database
startsap all: Default entry; starts both the database and the R/3 instance
1.1.2
SAP AG 1999
Starting an R/3 Instance
Instance startupsequence
Services
sapstart
Default and instance profile
Start profile
Disp+workProcesses
Database
> startsap_<host>_<nr>
UNIX shell .
Connection
WP WP gwrd
MSCOSE
…
This graphic displays the R/3 start procedure in more detail.
Script startsap calls program SAPSTART.
Program SAPSTART reads the START PROFILE and starts the R/3 components and/or services listed
in /usr/sap/<SID>/SYS/profile/START_<instance>_<hostname>.
On a central instance, SAPSTART starts the message server, dispatcher, collector, and the sender.
On a dialog instance, only the sender and the dispatcher are started. The collector and sender are used
to implement the central R/3 System log.
The dispatcher forks and creates child processes:
The work processes (dialog, background, spool, update, . . .) are created according to the information
in the profiles /usr/sap/<SID>/SYS/profile/<SID>_<instance>_<hostname> and
/usr/sap/<SID>/SYS/profile/DEFAULT.PFL.
The gateway reader. This does not depend on the profiles, and it is always started.
All the work processes except the gateway reader connect to the database.
To provide a stable startup procedure, the parameter read sequence (also known as the parameter replace
sequence) is defined during startup as follows:
R/3 processes read the appropriate parameters from a C source in the R/3 kernel
The default profile /usr/sap/<SID>/SYS/profile/DEFAULT.PFL is read; profile values already defined
in the C source are replaced with the values in the default profile
The instance profile /usr/sap/<SID>/SYS/profile/<SID>_<instance>_<hostname> is read; profile
values already defined in the default profile or in the C source are replaced with the values defined in
the instance profile
This procedure ensures that system parameter values reflect the instance profile and the values in the
default profile and the C source.
1.2 R/3 Startup Logs and Traces
1.2.1
SAP AG 1999
R/3 Startup Logs and Traces
/sapmnt/<SID>/<Instance><No>/work/ ...
Standard error files of program SAPSTART
Startup log of program SAPSTART
Trace file of the dispatcher
Time
Trace file of the message server
stderr1 … m
sapstart.log
dev_disp
dev_w0 … n
dev_ms
sapstart<m>.trc Trace files of program SAPSTART
$HOME/<sid>adm/startsap_<host>_<instance no.>.log
Trace files of the work processes
$HOME/<sid>adm/startsap_<host>_<instance no.>
The R/3 startup scripts log their actions to log files in the home directory of the user <sid>adm.
R/3 work directories contains trace files and error files for messages relating to the startup of work
processes. There is a work directory for each R/3 instance. The work directory contains information that
may not be found in the R/3 System log.
The work directory files are initialized in chronological order.
To define the level of information written to the trace files, set the profile parameter rdisp/TRACE in the
instance profile. The values for this parameter are:
0: Write only errors (no traces)
1: Write error messages and warnings (default)
2: Write error messages and a short trace
3: Write error messages and the complete trace
These files can be viewed at OS level or in R/3:
At OS level, you can use UNIX command ‘page’, ‘more’, or ‘cat’.
In R/3, you can use transaction AL11.
In R/3, you can use transaction SM50 to see the developer trace for a particular work process: choose
Process → Trace → Display file (or click on Display file).
1.3 Processes after starting SAP Instance
The process IDs of the various R/3 processes clearly show the R/3 startup procedure.
sapstart creates the dispatcher, collector, and sender.
saposcol is started directly from the script startsap.
The UNIX init process has the process ID 1.
1.3.1 Troubleshooting during startup phase
In case of trouble, please check that all process from SAP and ORACLE are started.
SAP R/3 processes: dw.sap... work-process and R/3 dispatcherprocessco.sap... global syslog collector processse.sap... global syslog sender processms.sap... message server processgw.sap... Gateway...sapstart... R/3 Startup Process...saposcol SAP OS Collector-Process
ORACLE prozesse: ora_reco<SID> Recover-Prozess ora_dbwr<SID> Database Writerora_db0{1-N]<SID> Globaler Syslog Sender Prozessora_lgwr<SID> Log Writerora_arch<SID> Archiverora_ckpt<SID> Checkpointora_pmon<SID> Prozess Monitororasrv Interprozess Communication Serveroracle<SID> Shadow Prozess (mehrere)
You can also use SAP transactions to find the error:
Transaktion: Beschreibung:
SM21 Dient der Untersuchung und der Anzeige der System Logs
SM50 Prozess-Übersicht. Folgende Prozesse müssen da sein:
D Dialog-Prozess V Update Prozess E Enqueue Prozess B Batch Prozess S Spool Prozess
SM51 Server-Übersicht. Enthält jeweils einen Eintrag pro Instanz
SICK Installation Consistency Check
In case that a startup is not possible you have to analyse TRACE-Files located under:
/usr/sap/<SID>/DVEBMGS00/work
Check that /etc/services has read-permission for <SID>adm and ora<SID>
If startup is not possible due to a database error, try to start the database manualy as followed:
logon as ora<sid>sqldba lmode=ySQLDBA> connect internalSQLDBA> startup
If the database inconsistent you can try the following steps
SQLDBA> startup mountSQLDBA> recover database;SQLDBA> alter database open;
1.3.2 Start SAP R/3 minimal system
You can create an miniamal profile for diagnistic.
Login as <SID>adm. Backup the active instance profile, e.g instance P01
$ cd /usr/sap/P01/SYS/profile$ cp P01_DVEBMGS00 P01_DVEBMGS00.orig
2. Create the new instance profile. The new profile must minimum contain the following parameter:
Parameter: Wert:
SAPSYSTEMNAME = P01SAPSYSTEM = 00rdisp/TRACE = 2rdisp/wp_no_dia = 2
3. start SAP R/3 system and check the trace files under
/usr/sap/<SID>/DVEBMGS00/work/
ATTENTION: Please don’t forget to reset the trace-level rdisp/TRACE. Normaly this parameter is not set and so the default is 1.
With trace level 2 and higher you got a lot of MB’s and can running out of space.
Alternatative you can use the following trace levels:
Das setzen des Parameters rdisp/TRACE auf 2 erhöht den Trace-Level und sorgt dafür, das die Trace-Files unter /usr/sap/<SID>/DVEBMGS00/work/ signifikant mehr Informationen enthalten. Der Parameter rdisp/wp_no_dia sorgt dafür, das nur 2 Workprozesse hochgefahren werden und damit das System nicht so hoch belastet wird.
ACHTUNG: Das Heruntersetzen des TRACE-Levels sollte NIE vergessen werden. Voreingestellt ist der Parameter rdisp/TRACE in dem Instanz-Profil gar nicht eingetragen. Das System nimmt dann automatisch den TRACE-Level 1 an. Mit dem TRACE-Level 2 werden sehr schnell TRACE-Files von mehreren hundert MB geschrieben.
1.3.3 SAP Entwickler Traces
Für jede Instanz werden im Verzeichnis /usr/sap/<SID>/<INSTANZNAME>/work TRACE-Files geschrieben. Folgende Files sind vorhanden:
File: Beschreibung:
sapstart.log Enthält Informationen über den Start des R/3 Systemsdev_disp TRACE-File des Dispatcher-Prozessdev_w<NR.> TRACE-File des jeweiligen Work-Prozessdev_ms TRACE-File des Message Server-Prozessdev_st<USER> TRACE-File des saptemu
Der Trace-Level für die dev-Files kann mit dem Profile-Parameter
rdisp/TRACE = 1 ( Grundeinstellung)
im Instanz-Profile /usr/sap/<SID>/SYS/profile/<SID>_DVEBMGS00 eingestellt werden. Folgende Level können angegeben werden:
Wert: Bedeutung:
0 Kein TRACE 1 Nur Fehlermeldungen 2 Voller TRACE
Zur Auswertung der TRACE-Dateien bei einem Fehler, kann folgendes Vorgehen helfen:
1. TRACE-Datei, die zuletzt beschrieben wurde herausfinden mit:
# ll -t
2. Die größte TRACE-Datei herausfinden
3. Herausfinden, welche der TRACE-Dateien den String ERROR enthält mit:
# find . -name "dev*" -exec grep -l "ERROR" {} \;
1.4 Nützliche Transaktionscodes
TCode: Beschreibung:/nxxxx Terminates current transaction and starts transaction "xxxx"
/n Terminates current transaction /nend Terminates all separate sessions and logs off
/nex Terminates all separate sessions and logs off immediately
/oxxxx Opens a new sessions and starts transaction "xxxx" inn new session
/o Lists existing sessions and allows deletion or opening of a new session
/h Switches into debugging mode
/hs Switches into debugging mode and activates the debugging of system functions
/$SYNC Buffer Command: Resets all buffers in the system
/$CUA Buffer Command: Resets the CUA buffer of the application server
/$TAB Buffer Command: Resets the table buffer of the application server
/$NAM Buffer Command: Resets the nametab buffer of the application server
/$DYNP Buffer Command: Resets the screen buffer if the application server
/bdel Deletes the current batch input transaction
/bend Terminates batch unput processing and sets the sessions to "Failed"
Einige zusätzliche Kommandos:
TCode: Beschreibung:%sc FIND if find is not an option in an SAP screen
%pc SAVE it to a file on your pc
%pri/%prin Will print the current screen
%bc1 Takes you back one screen (Green Arrow)
%bc2 Cancel (Red X)
%bck Yellow Arrow
Ein Screendump vom einem SAP Bildschirm kann mit der Tastenkombination:
AltGr/Druck
erzeugt werden. Innerhalb eines Microsoft Dokumentes wie Word oder Power Point kann es dann wie gewohnt mit der Kombination:
STRG-V
eingefügt werden.
1.4.1 R/3 Start-Profile
Beim Starten des SAP R/3 Systems werden eine Reihe von Profilen eingelesen. Nachfolgend eine Übersicht über die Verteilung der verschiedenen Profile im Filesystem:
usr
sap
<SID>
SYS
gui exe profile global
<Instanzname> <Instanzname>
log data work
SLOGJ
DEFAULT.PFL
<SID>_DVEBMGS00
START_DVEBMGS00
TEMU.PFL
Hier stehen Daten, auf diealle Instanzen zugreifen.
Informationen über alle, von Prozessen dieser Instanz er-zeugten syslog-Einträge
Roll u. Paging Dateneines Appl. Servers
Trace u. Error Informationen,Startup-Meldungen und Speicherabzüge der Instanz
Jede Instanz hat ein Verzeichnis, in dem Instanz-Spezifische Laufzeit-
Daten gespeichert werden
Systemweiter Profile
R/3 Instanz-Profil. Startet die Instanz,Definiert die Anzahl der WP´s, Phys. Mem usw.
Zentrales Syslog
R/3 Start-Profile. Startet die Workprozesse,Message Server, Application Server und Syslog Collector Daemon
Sapgui Profile
/
... ...
Die Priorisierung dieser Profile ist wie folgt:
1. Höchste Priorität haben Profile in der Kommandozeile. Beispielsweise in
saptemu pf=TEMU.PFL
2. Die nächste Priorität haben die Instanz-Profile mit ihren Parametern, Beispielsweise in
C11_DVEBMGS00_hpcc024
3. Das nächste Profile, das beim Starten immer gelesen wird, ist das zentrale Systemprofile
DEFAULT.PFL
4. Die niedrigste Priorität haben Parameter, die in den C-Sourcen fest vorbelegt wurden
SAP AG 1999
Directory Contains File name examples
dbs SAP and Oracle profiles, init<SID>.ora, init<SID>.dba, init<SID>.sap
bin Oracle executables
saptrace Background (Oracle alert file)usertrace
sapdata1 Datafiles /btabd1/btabd.data1, system.data1,
. ctrl<SID>.dbf, /btabi1/btabi.data1
.
sapdata<n>
sapbackup BRBACKUP, BRRESTORE logs
saparch BRARCHIVE logs, Oracle archive dir ctrl<SID>.dbf
sapcheck SAPDBA logs (-next, -check, -analyze)
sapreorg SAPDBA logs(default),default compression directory
origlogA Online redo log files log_g101m1.dbf, log_g103m1.dbf
origlogB Online redo log files log_g102m1.dbf, log_g104m1.dbf
mirrlogA Online redo log files log_g101m2.dbf, log_g103m2.dbf
mirrlogB Online redo log files log_g102m2.dbf, log_g104m2.dbf
. . .
Profile init<SID>.oralog_archive_format = %t_%s
Oracle - Oracle Directory Structure in R/3
Directory and file names are standardized in the R/3 environment. We recommend that you use the
following standards:
Tablespace files reside in the sapdata<n> directories
The online redo log files reside in the origlog and mirrlog directories
The offline redo log files are written to the saparch directory
There should be at least 3 copies of the Oracle control file on different disks
The profile init<SID>.ora configures the Oracle instance, and resides in directory dbs
(NT: database)
The profile init<SID>.sap configures the backup tools brbackup and brarchive, and resides in
directory dbs (NT: database)
The profile init<SID>.dba configures the SAPDBA tool, and resides in directory dbs
(NT: database)
The Oracle alert file is written to directory saptrace/background
Trace files of the Oracle shadow processes are written to the directory saptrace/usertrace
During reorganization, export datasets are written to directory sapreorg
The directories saparch, sapcheck, sapreorg, and sapbackup are used by the SAP database tools.