Beruflich Dokumente
Kultur Dokumente
BC505
Release 4.6C 22.01.2002
0
SAP AG 1999
BC505 Database Administration Oracle
BC505
R/3 Release 4.6B 50034335
BC505
R/3 Release 4.6B 50034335
Database Administration
Oracle
Database Administration
Oracle
0.2
SAP AG 1999
Copyright 00! "A# A$. All rights reser%ed.
&o part o' this p(blication may be reprod(ced or transmitted in
any 'orm or 'or any p(rpose )itho(t the e*press permission o'
"A# A$. +he in'ormation contained herein may be changed
)itho(t prior notice.
All rights reser%ed.
Copyright
Trademarks:
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
Microsoft
! "#$%&"S
! $'
! ()C(*
! "ord
! PowerPoint
are re,istered
trademarks of Microsoft Corporation.
#BM
! %B-
! &S.-
! %B-./000
! Para00e0 Sysp0e1
! M2S.(SA
! 3S./000
! A#)
! S.450
!
AS.600
! &S.450
! and &S.600
%ynamic Server
'M
are re,istered trademarks of
#nformi1 Software #ncorporated.
9$#)
! ).&pen
! &S7.:
! and Motif
! "or0d "ide
"eb Consortium! Massachusetts #nstitute of 'echno0o,y.
<A2A
2.1 +!en a ta#e t!at is already inte&rated into t!e .ac,4# cycle is re-initialiGed<
t!e la.el o( t!e ta#e la.el )ill .e reset incl4din& t!e in(ormation a.o4t t!e
n4m.er o( times t!e ta#e !as .een 4sed. !ere(ore< t!e ta#e may .e 4sed
more o(ten t!an t!e recommended n4m.er o( times.
2.2 A ta#e )ill remain loc,ed )it! a lo&ical loc, .4t not )it! a #!ysical loc,.
!e in(ormation a.o4t )!ic! ta#e s!o4ld .e 4sed is contained only in t!e
data.ase ta.les S-/A= and S-/A-. !ese data.ase ta.les are not reset
)!en yo4 re-initialiGe t!e ta#e )it! t!e o#tion -i $#rce.
=o)ever< t!e la.el o( t!e ta#e is reset. !ere(ore< t!ere is no date recorded
on t!e ta#e )!en it )as last recently 4sed and no t!e ta#e is not loc,ed )it!
a #!ysical loc,.
3
3.1 !e loc, e1#iration o( t!e ta#e is c!ec,ed.
"( t!e ta#e is not loc,ed< it is 4sed re&ardless o( its name.
!e name o( t!e ta#e )ill not .e c!an&ed.
!is o#tion can .e 4sed (or an 4nsc!ed4led .ac,4# or i( yo4 )ant to de(ine
t!e ta#e name 4sin& an e1ternal tool. +!en yo4 4se an e1ternal tool< (or
e1am#le< i( yo4 )ant t!e name to contain t!e correct day o( t!e )ee,< s)itc!
o(( t!e a4tomatic ta#e administration. -o not 4se t!e same ta#e name t)ice
=C> SAP AG BC505 --
in a .ac,4# cycle< and do not 4se t!e ta#e name SCRAC=.
3.2 !e loc, e1#iration o( t!e ta#e is c!ec,ed.
"( t!e ta#e is not loc,ed< it is 4sed.
!e name o( t!e ta#e is c!an&ed to t!e name o( t!e ta#e reF4ested (rom t!e
.ac,4# cycle .y /R/AC;0P or /RAC="6:.
!e ta#e name SCRAC= can .e 4sed )!en a ta#e needs to .e re#laced<
(or e1am#le )!en t!e ta#eB4seBco4nt is e1ceeded or )!en t!e ta#e is
de(ective. 7ote t!at yo4 m4st remove t!e old ta#e (rom yo4r ta#e #ool to
ens4re t!at ta#e names are 4niF4e in t!e #ool.
4 Copy the initG"8DH.sap.tape 'ile to initG"8DH.sap
brback#p 2i force 2 *SID+B/.
=C> SAP AG BC505 -4
6
SAP AG 1999
"ched(lingD #er'ormingD and -onitoring Bac0(ps
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
6.2
SAP AG 1999
"ched(lingD #er'ormingD and -onitoring Bac0(ps
Contents
Database bac0(ps
O''line redo log 'ile bac0(ps
ObCecti%es
At t!e end o( t!is 4nit< yo4 )ill .e a.le to?
"ched(le and per'orm a bac0(p (sing "A# tools
-onitor and %eri'y a bac0(p r(n
,%al(ateD implement and test the most s(itable bac0(p method
'or yo(r company
=C> SAP AG BC505 -
6.3
SAP AG 1999
BRBAC/7#
Data 'iles
BRBAC/7#
Data 'iles
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
BRARCI81,
O''line redo
log 'iles
BRARCI81,
O''line redo
log 'iles
....
....
....
....
init*SID+.sap
sapr3."DBAI
sapr3."DBAD
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
DBA #lanning Calendar
#lanning $oto 4isting Ielp "ystem
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
BRBAC/7# At ...
or
BRARCI81, ...
Command prompt A *
Io) "A# Bac0(p +ools 2or0 +ogether
A backup can be ca00edG
7rom CC27 in 3.4 R for periodic actions. 'o schedu0e periodic backups! use the %BA P0annin,
Ca0endar =transaction D)73>. #n 3.4! the reIuired tapes can be determined! and the 0o,s disp0ayed.
9sin, 7A:DBA R for one8time actions and e1ceptiona0 cases. Startin, from the command prompt!
you can use SAP%BA to administer the &rac0e database. "ith this pro,ram! backups are started
interactive0y.
9sin, B'BAC;(: or B'A'C-./) R for one8time actions and e1ceptiona0 cases. Lou can ca00
the SAP too0s for database backups =B3BACJ9P> and off0ine redo 0o, fi0e backups
=B3A3C;#2(> at the command prompt 0eve0. 'o schedu0e such backups! you can use operatin,
system commands =9$#)G cron! $'G at>.
"hen a backup is schedu0ed by CCMS! or started up by SAP%BA! these too0s ca00 B3BACJ9P
and.or B3A3C;#2( in order to back up the fi0es to tape or disk! and to 0o, backup actions in
database tab0es S%BA; and S%BA%. (ach too0 a0so backs up a summary 0o, and a detai0 0o, per
action. %efau0t va0ues are read from the parameter fi0e init<SID>$sap. ;owever! with these backup
a0ternatives! some of the defau0t va0ues can be overridden. 7or interna0 tape administration!
B3BACJ9P determines the reIuired tapes from tab0es S%BA; and S%BA%! whi0e B3A3C;#2(
does so on the basis of its summary 0o,.
=C> SAP AG BC505 4
6.4
SAP AG 1999
QQQ
Q
Q
Q
....
....
....
....
init*SID+.sap
compress compress F hard)are F hard)are
compress3 compress3cmd cmd F Tcompress F Tcompress A Ab ! b ! A Ac K H KU c K H KU
compress3 compress3dir dir F /oracle/G"8DH/ F /oracle/G"8DH/sapreorg sapreorg
tape3cop$3 tape3cop$3cmd cmd F F dd dd
disk3cop$3 disk3cop$3cmd cmd F F rman rman
exec3parallel exec3parallel F 0 F 0
tape3address tape3address F / F /de% de%/ /rmt rmt/0mn /0mn
tape3address3 tape3address3re% re% F / F /de% de%/ /rmt rmt/0m /0m
tape3address3arch tape3address3arch F / F /de% de%/ /rmt rmt/!mn /!mn
tape3address3 tape3address3re% re%3arch 3arch F / /de% de%/ /rmt rmt/!m /!m
back#p3 mode back#p3 mode F all F all
back#p3 t$pe back#p3 t$pe F online No''lineO F online No''lineO
ol#me3back#p ol#me3back#p F F 6G"8DHB0!D G"8DHB0D ...: 6G"8DHB0!D G"8DHB0D ...:
tape3 si)e tape3 si)e F 3$ F 3$
tape3#se3co#nt tape3#se3co#nt F !00 F !00
expir expir3period 3period F @ F @
back#p3 back#p3de de3t$pe 3t$pe F tape F tape
archie3f#nction archie3f#nction F copyEdeleteEsa%e
ol#me3archie ol#me3archie F 6G"8DHA0!D G"8DHA0D ...:
tape3si)e3arch tape3si)e3arch F 6000-
Bac0(p #ro'ile #arameters
'o choose the tape drives for the tape stations used for database or off0ine redo 0o, fi0e backups! set
parameters tape_address and tape_address_rew. 'he optiona0 parameters tape_address_arch and
tape_address_rew_arch are used to specify one =or two> tape drives for the tape station used for
off0ine redo 0o, fi0e backups. "hen the off0ine redo 0o, fi0e backup parameters have been set!
tape_address and tape_address_rew are on0y used for the database backup.
'he parameter tape_copy_cmd determines whether copy pro,ram cpio or dd is used to back up the
data fi0es to tape. 9sin, dd! the reIuired backup time can be reduced si,nificant0y. #f you use dd! you
must maintain the fo00owin, parameters =for $'! AobsMnkB or AibsMnk B do not app0y>G
dd_fla2s M Aobs M nk bs M nkB with n :/ =for %*'! for e1amp0e n M 4- or n M /6>
dd_in_fla2s M Aibs M nk bs M nkB with n :/ =for e1amp0e! dd_in_fla2s M Aibs M /6k bs M /6k B>
'he parameter compress_dir indicates which directory is bein, used with "erify or software
compression durin, a backup.
'he parameters compress_cmd and exec_parallel are discussed on the s0ide A;ardware
Compression.B
'he init<SID>$sap parameters shown in sma00er print are not discussed here. 'hese profi0e
parameters are on0y e1amp0esS they may differ on your system. 7or further parameter definitions! see
the 3.4 &n0ine %ocumentation.
=C> SAP AG BC505 6
6.5
SAP AG 1999
BRBAC/7#/BRARCI81,
cpio/dd
Data
...
dd= ,rror
cpio= ,rror or
cpio contin(ation
%ol(me
Data Data
cpio/dd cpio/dd
...
BRBAC/7#/BRARCI81,
cpio/dd
Data
...
Data
cpio/dd cpio/dd
...
BRBAC/7#=
"A#
'ollo)A(p
tape
Correct
#arameter tape3si)e
#hysical tape si?e
#arameter tape3si)e
Data
#hysical tape si?e
#ro'ile initG"8DH.sap #arameter tapeEsi?e
8ncorrect
'he data vo0ume to be backed up is determined by B3BACJ9P.B3A3C;#2(! and distributed
amon, SAP tapes! usin, parameter tape_si8e. #f a tape chan,e is reIuired! use an SAP follow1up
tape =for cpio! this is ca00ed a continuation "olume>. 'he fi0es are not sp0itS they are backed up to tape
in one piece. %urin, an off0ine redo 0o, fi0e backup! the ma1imum number of off0ine redo 0o, fi0es
that can fit on this tape =as defined by tape_si8e or tape_si8e_arch> is backed up. An SAP fo00ow8up
tape is not used.
#f the va0ue for tape_si8e is too 0ar,e! the copy pro,ram =cpio or dd> may start backin, up a fi0e to
tape! and may reach the physica0 end of the tape. 'he conseIuences depend on the copy pro,ram and
the type of backup.
'he copy pro,ram dd a0ways ,enerates an error messa,e when it reaches the end of the tape. 'he
error messa,e depends on the operatin, system. 7or "indows $'! it reads Physical end of tape has
been reached. 7or 9$#)! it reads I. 9rror.
%urin, a seria0 database or off0ine redo 0o, fi0e backup! cpio reIuests a cpio =not an SAP>
continuation vo0ume. 'he database backup terminates successfu00y. CautionG Since SAP too0s cannot
reIuest the cpio continuation vo0ume direct0y! prob0ems may arise durin, a restore from this database
backup.
%urin, a para00e0 database or off0ine redo 0o, fi0e backup! cpio terminates with an error messa,e! and
the backup terminates with an error.
'herefore! tape_si8e must be set to a va0ue somewhat sma00er than the physica0 tape capacity
=a00owin,! for e1amp0e! a :0F safety mar,in>.
=C> SAP AG BC505 5
6.6
SAP AG 1999
400 -B 400 -B 400 -B 400 -B
BRBAC/7#
400 %/
400 %/ 400 %/
400 %/
compress compress F no F no
tape3si)e tape3si)e F !@00- F !@00-
init*SID+.sap
400 -B
400 -B
+ape station )itho(t
hard)are compression
00
-B
00
-B
00
-B
00
-B
00 -B
400 -B
BRBAC/7#
00
-B
00
-B
00
-B
00
-B
400 %/
400 %/
400 %/
400 %/
400 %/
400 %/
400 %/ 400 %/
compress compress F hard)are F hard)are
compress3 compress3cmd cmd F Tcompress F Tcompress A Ab ! b ! A Ac K H KU c K H KU
exec3parallel exec3parallel F 0 F 0
tape3si)e tape3si)e F !600- F !600-
....
....
....
....
init*SID+.sap
+ape station )ith
hard)are compression
Once per cycle=
Determine
compression rate
400 %/ 400 %/
400 %/ 400 %/
Iard)are Compression
7or tape stations with hardware compression! parameter tape_si8e is set to a sma00er va0ue =as an
additiona0 safety mar,in! since the compression rate chan,es in the course of a backup cyc0e> than
for tape stations without hardware compression. 7or more information on settin, tape_si8e for
different tape stations! see SAP $ote HP0P.
'o be ab0e to distribute fi0es across the tapes! B3BACJ9P reIuires information on how we00 the
fi0es to be saved are bein, compressed by the tape station. ;owever! tape stations do not report a
compression rate. Lou must therefore determine the compression rate once per backup cyc0e.
%etermine this rate by usin, SAP%BA! or by usin, the operatin, system command brbac/up 1/.
'o determine the compression rate! for 9$#)! we recommend that you set parameter compress_cmd
as shown above in order to obtain more precise va0ues. 7or $'! the appropriate va0ue for
compress_cmd is ,iven in the 3.4 &n0ine %ocumentation.
#f parameter exec_parallel has been set to 0 durin, compression rate determination! one process per
0o,ica0 vo0ume is tri,,ered in order to determine the compression rate. #f parameter exec_parallel
has been set to a va0ue sma00er than the number of 0o,ica0 vo0umes! the number of processes reIuired
to determine the compression rate is 0imited to the number indicated by the parameter. 'his reduces
the CP9 0oad on the database server.
=C> SAP AG BC505 /
6.7
SAP AG 1999
DBA #lanning Calendar
#lanning $oto 4isting Ielp "ystem
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
BRBAC/7# At online Ad tape
Am all Ac A( system
Command prompt A *
"ched(ling and #er'orming a &ormal Database Bac0(p
tape3cop$3 tape3cop$3cmd cmd F F dd dd or or
tape3cop$3 tape3cop$3cmd cmd F F cpio cpio
....
....
....
....
init*SID+.sap
1
Calendar
Sc!ed4le an Action (or 4e 0'
1>?00?00 "tart time
#eriod 6)ee0s:=
J(ll database o''line S redo log bac0(p
J(ll database o''line bac0(p
J(ll database online S redo log bac0(p
J(ll database online bac0(p
Redo log bac0(p
#artial database o''line bac0(p
#artial database online bac0(p
Chec0 optimi?er statistics
Adapt ne*t e*tents
Chec0 database
h A Bac0(p database
"A#DBA A *
c A Bac0(p de%ice type tape
d A ObCects 'or bac0(p all
e A Bac0(p type online
g A 3(ery only no
" A "tart BRBAC/7#
"A#DBA A *
#f possib0e! schedu0e a00 periodic database backups in your backup strate,y usin, the %BA P0annin,
Ca0endar =transaction D)73>. 7or a00 further database backups! use SAP%BA! or ca00 B3BACJ9P
usin, the command prompt.
SAP recommends that you perform one on0ine database backup each workin, day. Schedu0e this
backup for periods with 0ow system activity.
'o schedu0e a full bac/up with redo bac/up from CCMS! the Aone8runB strate,y is used. 'his
strate,y is discussed at the end of this unit.
'o start a database backup with SAP%BA! se0ect h 1 )ac/up database. ;ere! you can temporari0y
override the parameters that have been preset for this backup by the parameter fi0e =defau0tG
init<SID>$sap>. 'he parameter fi0e is not chan,ed. 7or e1amp0e! to se0ect another type of backup
such as offline or offline_force! se0ect e 1 )ac/up type. Lou can then start the backup usin, s 1 Start
)R)A:;P.
7or purposes of interna0 tape administration! to determine which tapes are reIuired for the backup
parameters that are current0y set! se0ect 2 1 <uery only =se0ect the settin, with.without tape chec/>.
'he Iuery be,ins with S 1 Start )R)A:;P.
#f you ca00 B3BACJ9P from the command prompt! you can temporari0y override the parameters
that have been preset by the parameter fi0e =defau0tG init<SID>$sap>! by usin, the ca00 parameters.
'he parameter fi0e is not chan,ed. 'o disp0ay the 0ist of ca00 parameters! use the command prompt
brbackup -h H more! or check the 3.4 &n0ine %ocumentation.
=C> SAP AG BC505 P
6.
SAP AG 1999
#hases o' a 2hole Database Bac0(p
"a%e control 'ile to dis0
"a%e control 'ile to dis0
Bac0 (p sa%ed control 'ile
Bac0 (p sa%ed control 'ile
Jor all tablespaces to be bac0ed (p=
Begin tablespace bac0(p mode
Bac0 (p tablespace data 'iles
,nd tablespace bac0(p mode
Jor all tablespaces to be bac0ed (p=
Begin tablespace bac0(p mode
Bac0 (p tablespace data 'iles
,nd tablespace bac0(p mode
4og 'ile s)itch
4og 'ile s)itch
Bac0 (p control 'ile
Bac0 (p control 'ile
"tart database
"tart database
"h(t do)n database
"h(t do)n database
Bac0 (p data 'iles
Bac0 (p data 'iles
.Bac0 (p online redo log 'iles
.Bac0 (p online redo log 'iles
O''line
."tart database
."tart database
."h(t do)n database
."h(t do)n database
Retrie%e 'ile names o' data and online redo log 'iles 'rom database
and retrie%e names o' control 'iles 'rom init*SID+.ora
Retrie%e 'ile names o' data and online redo log 'iles 'rom database
and retrie%e names o' control 'iles 'rom init*SID+.ora
Bac0 (p tape headerD init*SID+.sapD init*SID+.dbaD and init*SID+.ora
Bac0 (p tape headerD init*SID+.sapD init*SID+.dbaD and init*SID+.ora
Bac0 (p reor!.lo!D str#ct.lo!D detail lo!D and s#mmar$ lo!
Bac0 (p reor!.lo!D str#ct.lo!D detail lo!D and s#mmar$ lo!
Online
Some! but not a00! steps of off0ine and on0ine backup procedures are identica0.
%urin, an off0ine backup! the steps marked above with an asterisk do not necessari0y have to be
performed. #n this way!
'he %B is on0y started if it is shut down at the start of the off0ine backup.
'he on0ine redo 0o, fi0es are on0y backed up durin, a comp0ete database backup.
'he %B is on0y shut down if it was shut down at the start of the off0ine backup.
%urin, an on0ine backup! the tab0espaces are set one by one to )e2in )ac/up ,ode or 9nd )ac/up
,ode. 'herefore! when a data fi0e is backed up! the associated tab0espace is in the backup mode. #f
a00 data fi0es have been backed up! and a00 tab0espaces have been reset to 9nd )ac/up ,ode! a lo2
file switch is performed. %urin, a subseIuent off0ine redo 0o, fi0e backup! a00 off0ine redo 0o, fi0es
reIuired for consistency of the on0ine backup can be backed up.
%urin, an on0ine backup! the contro0 fi0e cannot be backed up to tape durin, norma0 database
operation. 'herefore! at the start of the backup! a consistent copy of this contro0 fi0e is made to disk.
'his copy is backed up to tape after a00 data fi0es have been backed up.
At the start of a backup! a tape header is written. By readin, this tape header at the end of the
backup! B3BACJ9P checks whether the tape header was ab0e to be written correct0y to tape.
'his strate,y does not use 3MA$ =3ecovery Mana,er>.
=C> SAP AG BC505 H
6.!
SAP AG 1999
Data 'iles compress3dir
BRBAC/7# Ac A) (seEdb%
A
B
&
.
.
A
Q
Corr(ption
+ape readableQ
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
Oracle
@A/B
Bloc0
F
Q
Jile
length
4ogical 1eri'ication o' a Database Bac0(p
Once per )ee0.
-inim(m= once
per cycle
"hen the tape header is checked! the tape station a0so under,oes a minima0 function check.
A0thou,h prob0ems occurrin, durin, a backup are revea0ed by the tape header check! these prob0ems
are not detected unti0 the end of the next backup performed on this tape station! at the ear0iest.
Systematic tape station errors cannot be detected in this way. 'o confirm tape readabi0ity! check
backups re,u0ar0y usin, the option "erify or 1w.
Corrupt data b0ocks are on0y detected when &rac0e processes access these data b0ocks. A database
backup may therefore contain corrupt b0ocks. "e recommend that you check a comp0ete database
backup for corrupt data b0ocks once each week! or at 0east once each backup cyc0e. %urin, a
database backup! use the option 8"erify use_db" or 8w use_db" toG
(nsure tape readabi0ity
%etect corrupt data b0ocks
'he fi0es are read from tape! and copied to the directory defined by the init<SID>$sap parameter
compress_dir. B3BACJ9P checks whether the fi0e read from tape is the same 0en,th as the one that
was backed up =fi0e 0en,th is specified by the sin,0e backup 0o,s>. #n addition! every data fi0e is
checked for corrupt data b0ocks! usin, the &rac0e uti0ity %BE2(3#7L. #f the B3BACJ9P 0o,
reports corrupt data b0ocks! see SAP $ote 555/-.
Ca8tion: A backup performed usin, "erify takes at 0east twice as 0on, as a backup performed
without "erify. Lou can therefore defer a "erify with B33(S'&3(. Lou can run a deferred "erify on
the database server or another server.
=C> SAP AG BC505 5
6.10
SAP AG 1999
Data 'iles compress3dir
BRBAC/7# At o''line Ac A)
A
B
& A
.
.
...
Chec0
database
bac0(p
8' possible=
Once each cycle
F
Q
O''line
6binary:
#hysical 1eri'ication o' O''line Database Bac0(ps
%urin, a database backup with the option 1"erify use_db"! B3BACJ9P checks whether the backup
contains corrupt data b0ocks. ;owever! it does not check whether the fi0es read from tape are
identica0 to the correspondin, fi0es in the database. =%urin, an on0ine database backup! these fi0es
may a0so differ.>
%urin, an off0ine database backup usin, the option 1"erify or 1w! the restored fi0es are compared at
the binary 0eve0 to the correspondin, fi0es in the database. #f a database backup has been terminated
usin, "erify! and no error messa,e has appeared! a00 fi0es were readab0e! and were identica0 to the
correspondin, fi0es in the database. Such a database backup takes at 0east twice as 0on, as a backup
performed without "erify. #f the reIuired time window for the off0ine backup with "erify is avai0ab0e!
we recommend that you perform an off0ine database backup usin, "erify once each backup cyc0e.
A binary "erify cannot be deferred usin, B33(S'&3(.
=C> SAP AG BC505 :0
6.11
SAP AG 1999
sapr3."DBAI
sapr3."DBAD
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
DBA #lanning Calendar
#lanning $oto 4isting Ielp "ystem
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
cd /oracle/G"8DH/sapbac0(p
cat bac0G"8DH.log V more
cat bGtimestampH.and V more
Command prompt A *
4 A "ho)/Clean(p
"A#DBA A *
a A "ho) log 'iles / pro'iles
"A#DBA A *
e A BRBAC/7# log 'iles
"A#DBA A *
-onitoring a Database Bac0(p
Database Operations
-onitor 6DB4:
DBA Calendar
6DB!3:
B3BACJ9P writes 0o,s to SAP tab0es S%BA; and.or S%BA%! and to fi0es in directory sapbackup.
'herefore! by usin, SAB%BA or fi0e editors! you can check in 3.4 whether the backup has been
performed successfu00y.
#n 3.4! you can monitor database backups usin, the %BA P0annin, Ca0endar =transaction D)73>. 'o
se0ect the compressed data from tab0es S%BA; and S%BA%! choose the appropriate action. Lou can
branch to the detai0 0o,s at the operatin, system 0eve0.
7or an overview of a00 database backups that have been performed! use the D)A perations ,onitor
=ca00 transaction D)*(>. #n the D)A perations ,onitor! doub0e8c0ick the backup run! then choose
Display action lo2s.
9sin, SAP%BA! you can disp0ay 0o,s from database backups. Se0ect l 1 Show.0leanup! a 1 Show
lo2 files . profiles! e 1 )R)A0:;P lo2 files$
'he B3BACJ9P 0o,s are at the operatin, system 0eve0 in directory sapbackup. 7or every
B3BACJ9P action! the summary 0o, bac/<SID>$lo2 contains an entry with the date and name of
the correspondin, detai0 0o,. 'he detai0 0o,s b<time stamp>$<ext> contain a comp0ete description of
B3BACJ9P activity. 'he fi0e suffi1 <ext> depends on the B3BACJ9P function se0ected. 'he
summary 0o, and detai0 0o,s can be viewed usin, commercia0 editors or operatin, system
commands.
"ith the option brbackup -o distHtimeI5timeHdistJ! additiona0 information is entered
into the detai0 0o,. See a0so the database handbook in the 3.4 &n0ine %ocumentation.
Backups that have been terminated can be comp0eted. #n the unit AAdvanced Backups!B see the s0ide
APartia0 %atabase Backups.B
=C> SAP AG BC505 ::
6.12
SAP AG 1999
BRARCI81, option Acds 6copyD deleteD sa%e: "tat(s o' an o''line redo log 'ile
4
4
4
../saparch
G"8DHA0! G"8DHA0!
G"8DHA0 G"8DHA0
ARCI81,D
D,4,+,D
"A1,D
CO#8,D
../saparch
G"8DHA0! G"8DHA0!
G"8DHA0 G"8DHA0
43
4
44
46
45
G"8DHA03 G"8DHA03
4
44
43
4
BRARCI81, Acds
-on +(e 2ed
4
4
4
43
44
4
43
44
45
46
O''line Redo 4og Jiles= "tat(s and Option Acds
After a 0o, fi0e switch! the &rac0e process A3C; copies the on0ine redo 0o, fi0e that was the current
redo 0o, fi0e before the 0o, fi0e switch to directory saparch. An off0ine redo 0o, fi0e ,enerated in this
way can have various statuses for B3A3C;#2(. 'hese statuses are a0ways 0isted and updated in
summary 0o, arch<SID>$lo2 after a B3A3C;#2( run.
%urin, a backup to tape! an off0ine redo 0o, fi0e! when ,enerated! has the status AR06I=9. ='his
status is not disp0ayed unti0 the off0ine redo 0o, fi0e is backed up for the first time.> At first save! the
fi0e status is SA=9DS the second time! it is 0PI9DS and after de0etion! it is D9>9&9D.
%urin, a backup to disk! an off0ine redo 0o, fi0e! when ,enerated! has the status DIS:. =A,ain! this
status is not disp0ayed unti0 the off0ine redo 0o, fi0e is backed up for the first time.> A second copy is
not supported. 'he on0y statuses here are DIS:SA= =first save to disk> and DIS:D9> =de0etion after
a save to disk>.
%o not mi1 tape and dis/ backups.
B3A3C;#2( has a series of ca00 options that determine how the off0ine redo 0o, fi0es are processed.
SAP recommends the option 8cds becauseG =:> #f an off0ine redo 0o, fi0e has the status SA=9D! it is
saved to tape for a second time! and subseIuent0y de0eted from disk. 'his procedure is repeated unti0
no off0ine redo 0o, fi0e with status SA=9D is found. $e1t! a00 off0ine redo 0o, fi0es with status
AR06I=9 are backed up to tape for the first time. =-> After the backup! a00 off0ine redo 0o, fi0es e1ist
at two 0ocationsG either =a> in saparch and on tape! or =b> on two different tapes. 'hus! you can
achieve a hi,h fai08safe rate without drastica00y increasin, the tape reIuirement.
=C> SAP AG BC505 :-
6.13
SAP AG 1999
DBA#lanning Calendar
#lanning $oto 4isting Ielp "ystem
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
brarchi%e Acds Ad tape
Ac A( system
Command prompt A *
1
Calendar
Sc!ed4le an Action (or 4e 0'
1>?00?00 "tart time
#eriod 6)ee0s:=
J(ll database o''line S redo log bac0(p
J(ll database o''line bac0(p
J(ll database online S redo log bac0(p
J(ll database online bac0(p
Redo log bac0(p
#artial database o''line bac0(p
#artial database online bac0(p
Chec0 optimi?er statistics
Adapt ne*t e*tents
Chec0 database
i A Bac0 (p o''line redo log 'iles
"A#DBA A *
a A Archi%e '(nction CopyD deleteD and
sa%e archi%e logs
c A Archi%e de%ice type tape
s A "tart BRARCI81,
"A#DBA A *
#er'orming O''line Redo 4og Jile Bac0(ps
DB!3
'o schedu0e a00 periodic off0ine redo 0o, fi0e backups that are part of your backup strate,y! use the
%BA P0annin, Ca0endar =transaction D)73>. Back up off0ine redo 0o,s every day.
Lou can start an off0ine redo 0o, backup usin, SAP%BA by se0ectin, i 1 )ac/up offline redo lo2s. 'o
se0ect another type of backup! such as 0opy# delete and sa"e offline redo lo2s! se0ect a 1 Archi"e
function. 'o start the backup! se0ect s 1 Start )RAR06I=9.
#f you ca00 B3A3C;#2( usin, the command prompt! the parameters that have been preset usin, the
parameter fi0e =defau0tG init<SID>$sap> can be temporari0y overridden usin, ca00 options. 'o obtain
the 0ist of ca00 options! see the 3.4 &n0ine %ocumentation.
'o ensure that the tapes are readab0e! check backups re,u0ar0y usin, the option 1"erify or 1w.
SAP recommends that you perform an off0ine redo 0o, fi0e backup usin, "erify once per backup
cyc0e. #f the time window reIuired for the off0ine redo 0o, fi0e backup usin, "erify is avai0ab0e! the
tape readabi0ity check shou0d be performed durin, each off0ine redo 0o, fi0e backup.
#f you start B3A3C;#2( by choosin, 1f ?@illup-! a00 off0ine redo 0o, fi0es in saparch are initia00y
backed up accordin, to the se0ected backup function. B3A3C;#2( then periodica00y checks new0y
,enerated off0ine redo 0o,s and writes them to tape unti0 the tape is fu00.
'o cance0 brarchi"e 1f! use the command brarchi"e 1f stop on0y. $ever use TCtrl A 0B or the /ill
command =9$#)>.
=C> SAP AG BC505 :4
6.14
SAP AG 1999
sapr3."DBAI
sapr3."DBAD
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
DBA #lanning Calendar
#lanning $oto 4isting Ielp "ystem
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
-O& -O& +7, +7, 2,D 2,D +I7 +I7 JR8 JR8 "A+ "A+ "7& "7&
cd /oracle/G"8DH/saparch
cat archG"8DH.log V more
cat aGtimestampH.cds V more
Command prompt A *
4 A "ho) / Clean(p
"A#DBA A *
a A "ho) log 'iles / pro'iles
"A#DBA A *
' A BRARCI81, log 'iles
"A#DBA A *
-onitoring O''line Redo 4og Jile Bac0(ps
Database Operations
-onitor 6DB4:
CC-" Calendar
6DB!3:
DB!3
B3A3C;#2( writes 0o,s to SAP tab0es S%BA; and.or S%BA%! and to fi0es in directory saparch.
'herefore! you can check in 3.4 whether the off0ine redo 0o, fi0e backup was performed
successfu00y! by usin, SAP%BA or fi0e editors.
#n 3.4! you can monitor off0ine redo 0o, fi0e backups usin, the %BA P0annin, Ca0endar =transaction
D)73>. 'o se0ect the compressed data from tab0es S%BA; and S%BA%! choose the action you want.
Lou can branch to the correspondin, detai0 0o,s at the operatin, system 0eve0. #n addition!
transaction D)*( provides an overview of a00 e1ecuted off0ine redo 0o, fi0e backups.
9sin, SAP%BA! you can disp0ay 0o,s for the off0ine redo 0o, fi0e backups. Se0ect
l 1 Show.0leanup! a 1 Show lo2 files . profiles! f 1 )RAR06I=9 lo2 files.
'he B3A3C;#2( 0o,s are 0ocated at the operatin, system 0eve0 in directory saparch. 'he summary
0o, arch<SID>$lo2 specifies which off0ine redo 0o, fi0e was backed up usin, what action to which
tape. 'he detai0 0o, a<time stamp>$<ext@ contains a comp0ete description of B3A3C;#2( activity.
'he fi0e suffi1 <ext> depends on the B3A3C;#2( function se0ected. 'he summary 0o, and detai0
0o,s can be viewed usin, commercia0 editors or the appropriate operatin, system commands.
"ith the option brarchive -o distHtimeI5timeHdistJ! additiona0 information is entered
in the detai0 0o,. 7or more information! see the database handbook in the 3.4 &n0ine %ocumentation.
=C> SAP AG BC505 :6
6.15
SAP AG 1999
sapr3."DBAI
sapr3."DBAD
expir expir3period3SAPDBA3normal 3period3SAPDBA3normal F !! F !!
expir expir3period3dail$3check 3period3dail$3check F 5 F 5
expir expir3period3B,BAC4"P 3period3B,BAC4"P F 30 F 30
expir expir3period3B,A,C-I'5 3period3B,A,C-I'5 F 30 F 30
expir expir3period3oracle3trace 3period3oracle3trace F ! F !
....
....
....
....
init*SID+.dba
delete bGtimestampH.and
Command prompt A *
4og 'iles 4og 'iles
....
....
.... ....
....
....
....
....
....
....
4 A "ho)/Clean(p
"A#DBA A *
b A Clean(p log 'iles / directories
"A#DBA A *
a A "A#DBA log 'iles and d(mp directories
b A "A#DBA daily chec0 log 'iles
c A BRBAC/7# log 'iles
d A BRARCI81, log 'iles
' A ORAC4, traces and a(dits
"A#DBA A *
4og Jile Clean(p
'he 0o, fi0es of these SAP too0s are written to the correspondin, fi0es at operatin, system 0eve0 and
to the backup tapes. #n case of dama,e to the database! SAP%BA takes repair actions based on these
0o, fi0es.
;owever! you must de0ete 0o,! trace! and audit fi0es re,u0ar0y! especia00y those that are ,enerated by
the database. #f you do not do this! the fi0e systems overf0ow. As a resu0t of cryptic fi0e names! 0o,s
that are sti00 needed can easi0y be de0eted accidenta00y. 'herefore! you shou0d not de0ete these fi0es
usin, operatin, system commands. 'o use the SAP%BA de0ete function! se0ect l 1 Show.0leanup and
b 1 0leanup lo2 files . directories. 'his choice refers to 0o,s in directories sapreor,! sapcheck =both
SAP%BA 0o,s>! sapbackup =B3BACJ9P>! saparch =B3A3C;#2(>! saptrace.back,round!
saptrace.usertrace! and ?&3AC*(E;&M(@.rdbms.audit =a00 of which are &rac0e>. SAP%BAUs
defau0t va0ues for the minimum a,e of a 0o, before de0etion is permitted are derived from the
SAP%BA confi,uration fi0e init<SID>$dba. 'he parameters expir_period_C represent 0ower 0imits!
from which de0etion is permitted usin, SAP%BA. Lou shou0d adapt these 0imits to the backup cyc0e
used.
SAP%BA simu0taneous0y de0etes the correspondin, data in data tab0e S%BA%. 'he entries in header
tab0e S%BA; are retained. B3BACJ9P de0etes entries o0der than 600 days from tab0es S%BA; and
S%BA%. ='he operatin, system 0o,s are not de0eted.>
SAP%BA can be ca00ed in the command prompt mode usin, SAP%BA 8c0eanup. A00 directories are
then c0eaned up! accordin, to the parameters in init<SID>$dba.
=C> SAP AG BC505 :5
6.16
SAP AG 1999
Detecting an archier st#ck
-onitoring the directory saparch
' A Archi%e mode
"A#DBA A *
c A "ho) all archi%e in'ormation
"A#DBA A *
JR,, "#AC, = ...
"A#DBA A *
cd saparch
d' A0 .
Command prompt A *
../saparch
alert3*SID+.lo!=
+hread GnH cannot allocate ne) logD
All online logs needed archi%ing
BBBBBBBBBB
BBBBBBBBBB
BBBBBBBBBB
BBBBBBBBBB
"A#$78 A *
.W .W ....
Resol%ing an archier st#ck
Remo%e
d(mmy 'iles
and
R(n BRARCI81,
G"8DHA0! G"8DHA0!
D(mmy
Jreespace #roblems in Directory saparch
RL0
DB4
#n the A3C;#2(*&G mode! the 0o,writer process can override an on0ine redo 0o, fi0e on0y if it has
been backed up successfu00y to directory saparch! usin, the archiver process. 'herefore! for a
database in the A3C;#2(*&G mode! you must make sure that the archiver process is active! and
that sufficient freespace is avai0ab0e in saparch. Lou must monitor freespace dai0y.
'o monitor the freespace in saparch! use transaction D)7*. 'his transaction a0so shows an overview
of the backup status of the off0ine redo 0o, fi0es. #n SAP%BA! this freespace is disp0ayed in the
saparch directory under menu option f 1 Archi"e mode# c 1 Show all archi"e information. Lou can
a0so check the freespace usin, operatin, system commands.
#f the 0o,writer process attempts to switch to the ne1t on0ine redo 0o, fi0e! and this on0ine redo 0o,
fi0e has not been backed up by the archiver process! the database waits. 'his situation is ca00ed
archi"er stuc/ =see a0so the unit A'op :0 Prob0emsB>. A possib0e cause is missin, freespace in
saparch. 'he database a0ert 0o, then contains error messa,es. 'o reso0ve the archi"er stuc/! the
off0ine redo 0o, fi0es must be backed up to tape usin, the standard copy function! and then de0eted
from directory saparch. 'o do so! use SAP%BA or! if SAP%BA can no 0on,er 0o, on to the database!
use B3A3C;#2( at the command prompt 0eve0.
'#PG P0ace a dummy fi0e in directory saparch. #n case of an archi"er stuc/! the dummy fi0e is de0eted!
the archiver a,ain backs up off0ine redo 0o, fi0es! and the database keeps runnin, for a short time.
'his interva0 is sufficient to enab0e you to start off0ine redo 0o, fi0e backups as usua0 usin, SAP%BA.
=C> SAP AG BC505 :/
6.17
SAP AG 1999
&o) yo( are able to=
Describe the "A# bac0(p tools
-aintain the appropriate pro'ile parameters
"ched(leD per'ormD monitorD and %eri'y
database bac0(ps and o''line redo log 'ile bac0(ps
Clean (p the log 'iles )ritten d(ring a bac0(p
7nit "(mmary
=C> SAP AG BC505 :P
6.1
SAP AG 1999
J(rther Doc(mentation
/no)ledge #rod(ct CD
"A# Database Administration Oracle
Online Doc(mentation
Database Administration= Oracle
"A#&et
"A# &otes !;;0;D @505D 33630D ;;;6D
3345D !00400D !3446D !@56D !53;5D
!66;4D !064;5D !!55
=C> SAP AG BC505 :H
6.1!
SAP AG 1999
,*ercises
Q
"ol(tions
7nit Actions
=C> SAP AG BC505 :5
6.20:er3ormin" Back8,s: )6ercises
&o. ,*ercise
! Database Bac0(ps
+his e*ercise teaches yo( to (se "A# database bac0(p tools. +he
e*ercise re'ers to the play databasesD and is limited to the operating
system le%el.
1.1 0sin& SAP-/A< #er(orm a .ac,4# t!at meets t!e (ollo)in& criteria?
+!ole
$((line
o dis,
+it!o4t so(t)are com#ression
+it! a .inary veri(y
1.2 Per(orm a .ac,4# t!at meets t!e (ollo)in& criteria?
+!ole
$nline
o dis,
+it!o4t com#ression
+it!o4t 4sin& veri(y
0se eit!er SAP-/A or /R/AC;0P in t!e command #rom#t mode.
1.3 Con(irm t!at yo4r .ac,4# !as .een #er(ormed correctly .y c!ec,in& t!e lo&
(iles at t!e o#eratin& system level< and .y 4sin& SAP-/A. +!ere e1actly !as
t!e data .een .ac,ed 4#H
"ched(ling #eriodic Database Bac0(ps
+his e*ercise teaches yo( to (se the DBA #lanning Calendar in the R/3
"ystem.
2.1 +!ere in R/3 can yo4 sc!ed4le data.ase .ac,4#s #eriodically< and c!ec, a
.ac,4# a(ter it !as .een r4nH 3Please do not sc!ed4le a .ac,4#L5
3 Bac0ing 7p O''line Redo 4og Jiles
+his e*ercise teaches yo( to (se "A# bac0(p tools 'or o''line redo log
'iles. +he e*ercise re'ers to the play databasesD and is limited to the
operating system le%el.
3.1 0sin& SAP-/A< #er(orm an o((line redo lo& (ile .ac,4# t!at meets t!e
(ollo)in& criteria?
o dis,
+it! a veri(y
As an e1ce#tion< 4se t!e co#y (4nction save%delete.
3.2 Con(irm t!at yo4r o((line redo lo& (ile .ac,4# !as .een #er(ormed correctly .y
c!ec,in& t!e lo& (iles at t!e o#eratin& system level< and .y 4sin& SAP-/A.
+!ere e1actly !as t!e data .een .ac,ed 4#H
4 Optional ,*ercise= 4ogical Database Bac0(p Chec0
+his e*ercise teaches yo( to chec0 a logical database bac0(p (sing the
Oracle tool DBE1,R8J<.
=C> SAP AG BC505 -0
4.1 C!ec, t!e .ac,4# yo4 #er(ormed in e1ercise 1.1 (or lo&ical consistency 4sin&
-/B6:R"DC.
=C> SAP AG BC505 -:
6.21:er3ormin" Back8,s: 7ol8tions
&o. "ol(tion
!
1.1 Start SAP-/A. o &et to t!e .ac,4# men4< c!oose
h - &acku! database.
o start t!e .ac,4#< c!oose a - &acku! $uncti#n' (#r)al backu!. S#eci(y t!e
.ac,4# device ty#e .y c!oosin&
c - &acku! device ty!e' l#cal disk.
o de(ine )!ic! o.Kects are to .e .ac,ed 4#< c!oose
d - *b+ects $#r backu!? all.
o de(ine t!e .ac,4# ty#e< c!oose
e - &acku! ty!e #$$line.
0nder h - S!ecial #!ti#ns, c!oose
b - C#)!ress' n#
c - .eri$icati#n a$ter backu!' &inary (#$$line) #r by size (#nline)
o start t!e .ac,4# r4n< c!oose
S - Start &R&AC/01.
!e .ac,4# r4n is e1tended si&ni(icantly .y a veri$y. Additional dis, s#ace is
not reF4ired.
1.2 Sol4tion 4sin& SAP-/A?
Start SAP-/A. o &et to t!e .ac,4# men4< c!oose
h - &acku! database.
o start t!e .ac,4#< c!oose
a - &acku! $uncti#n' (#r)al backu!.
o s#eci(y t!e .ac,4# device ty#e< c!oose
c - &acku! device ty!e' l#cal disk.
o de(ine )!ic! o.Kects are to .e .ac,ed 4#< c!oose
d - *b+ects $#r backu!? all.
o de(ine t!e ty#e o( .ac,4#< c!oose
e - &acku! ty!e #nline.
0nder h - S!ecial #!ti#ns< c!oose
b - C#)!ress' n#
c - .eri$icati#n a$ter backu!' n#.
o start t!e .ac,4# r4n< c!oose S - Start &R&AC/01.
Sol4tion 4sin& /R/AC;0P?
At t!e o#eratin& system level< enter?
brbackup -c -d disk -t online -k no
o set /R/AC;0P to t!e non-monitored mode< 4se t!e o#tion -c. /e(ore
#er(ormin& t!is call< set t!e data.ase 4ser syste) #ass)ord to )ana2er
37$:? !is is only (or t!e #lay data.aseM do not 4se t!is settin& at !ome5. "(
yo4 !ave not done so< yo4 m4st enter t!e #ass)ord 4sin&
I-uH-user IGuser<I/Gpassword<JJ.
=C> SAP AG BC505 --
1.3 !e /R/AC;0P lo&s are in s4.directory sa#.ac,4# o( directory E=$%:?
cd
cd sa!backu!
!e detail lo& is named b3ti)e sta)!4.3e5t4< )it! 3e5t4 6 a$d si&ni(yin& $ull
#$$line #n disk< and 3e5t46and si&ni(yin& $ull #nline #n disk. 0sin& t!e time
t!e lo& )as created< select t!e a##ro#riate lo&< and vie) it .y enterin& 3(or
e1am#le5?
more bGtime stamp<'Ge8t<'
o vie) lo&s in SAP-/A< c!oose l - Sh#"/Cleanu!
a - Sh#" l#2 $iles / !r#$iles e - &R&AC/01 l#2 $iles.
!e (iles t!at !ave .een .ac,ed 4# are located in s4.directories o(
sa#.ac,4#. !e names o( t!ese s4.directories are identical to t!e
corres#ondin& names o( t!e detail lo&s 3)it!o4t e1tensions5.
2.1 Co4 can sc!ed4le .ac,4#s #eriodically (rom )it!in R/3 .y 4sin& t!e -/A
Plannin& Calendar 3transaction D&785.
o ma,e an entry< do4.le-clic, a (ree slot 3t!at is< day5. /y enterin& a #eriod
3(or e1am#le< 1 )ee,5 and &oin& t!ro4&! t!e )ee,days< a data.ase
administrator can F4ic,ly set 4# a .ac,4# strate&y. Dor every .ac,4# entry< a
corres#ondin& .ac,&ro4nd Ko. is created. o dis#lay t!ese .ac,&ro4nd Ko.s<
call transaction S98:.
!e mornin& a(ter t!e .ac,4#< t!e s4ccess(4l .ac,4# r4n s!o4ld also .e
c!ec,ed 4sin& transaction D&;< or D&78 3do4.le-clic, t!e .ac,4# action5.
3
3.1 Start SAP-/A. o &et to t!e desired men4< c!oose
i - &acku! #$$line red# l#2s.
o select t!e co#y (4nction< c!oose
a - Archive $uncti#n d - Save and delete archive l#2s.
o s#eci(y t!e .ac,4# device ty#e< c!oose
c - Archive device ty!e' l#cal disk.
0nder h - S!ecial #!ti#ns< c!oose
c - .eri$icati#n a$ter backu!' yes
o start t!e .ac,4# r4n< c!oose S - Start &RARCI.=.
7$:? !e .ac,ed 4# o((line redo lo& (iles cannot .e c!ec,ed at t!e .inary
level (or all co#y (4nctions. Dor an overvie) o( co#y (4nctions< see t!e R/3
online doc4mentation.
3.2 !e /RARC="6: lo&s are in s4.directory sa#arc! o( directory E=$%:?
cd
cd sa!arch
!e detail lo& is named b3ti)e sta)!4.3e5t4< )it! 3e5t4 6 svd si&ni(yin&
save % delete #n disk. 0sin& t!e time t!e lo& )as created< select t!e
a##ro#riate lo&< and vie) it .y enterin& 3(or e1am#le5?
more bGtime stamp<'Ge8t<'
o vie) lo&s in SAP-/A< c!oose
l - Sh#"/Cleanu! a - Sh#" l#2 $iles / !r#$iles $ - &R&AC/01 l#2 $iles.
=C> SAP AG BC505 -4
!e (iles t!at !ave .een .ac,ed 4# are located in directory sa#.ac,4#.
4
4.1 Co4 can #er(orm a de(erred lo&ical c!ec, o( a .ac,4# to ta#e< 4sin&
SAP-/A< .y c!oosin&
h - &acku! database a - &acku! $uncti#n $ - .eri$y &R&AC/01 ta!e.
!e .ac,4# yo4 ran (or e1ercise 1.1 )as #er(ormed to dis,. S4c! .ac,4#s
cannot .e c!ec,ed (rom )it!in SAP-/AM !o)ever< t!ey can .e c!ec,ed
4sin& /RR:S$R: at t!e command #rom#t level.
Dirst< determine t!e name o( t!e /R/AC;0P detail lo& (rom e1ercise 1.1.
o c!ec, t!e lo&< enter
brrestore -d disk -k no -w use0dbv Kb GBRB!C@"-detail
log<'
7$:? Dor .ac,4#s to dis,< -/B6:R"DC can only .e 4sed (or r4ns )it!o4t
so(t)are com#ression.
=C> SAP AG BC505 -6
7
SAP AG 1999
Restore and Reco%ery
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
7.2
SAP AG 1999
Restore and Reco%ery
Contents
Restore and reco%ery options (sing "A#DBA
"A#DBA '(nctions and their limitations
ObCecti%es
At t!e end o( t!is 4nit< yo4 )ill .e a.le to?
Analy?e the physical database str(ct(re (sing "A#DBA
Reco%er the database (sing the "A#DBA '(nction
Partial ,estore and Complete ,ecoer$
Reset the database (sing the "A#DBA '(nction ,eset Database
#er'orm a point in time reco%ery (sing the "A#DBA '(nction
6#ll ,estore and ,ecoer$
=C> SAP AG BC505 -
7.3
SAP AG 1999
,rror types=
"tatement
#rocess
8nstance
7ser
-edia
Database ,rrors
Most importantly,
be prepared for disasters.
Dont think you will never
see a failure. Every DBA will
experiene a database failure.
!ts "ust a matter of when...
#ood luk.$
Rama 1elp(ri
#n an &rac0e database! various kinds of errors can occur that reIuire the database administrator
=%BA> to take action. 'he different types of database error areG
7tatement errors! such as an attempt to enter incorrect data in a tab0e. &rac0e terminates the
statement with an error messa,e! and performs a statement ro00back.
:rocess errors! such as termination of the connection between a work process and a server
process. PM&$ ro00s back the open transaction! and re0eases occupied resources.
.nstance errors! such as when a back,round process fai0s. 'he ne1t time an instance is started! a
consistent status is restored by means of automatic instance recovery.
(ser errors! such as when a user accidenta00y enters the S+* statement drop table.
2edia errors! such as a head crash! or accidenta0 de0etion of a database fi0e.
#f user and media errors occur! the %BA must take action. 'his unit describes both of these error
types and the appropriate repair scenarios.
'o he0p you determine e1act0y when to app0y &rac0e too0s! the SAP%BA functions and their
0imitations are discussed in detai0 in this chapter.
7or further information about database errors! see the 3.4 &n0ine %ocumentation on database
administration.
=C> SAP AG BC505 4
7.4
SAP AG 1999
Control 'iles
!0
!0
!0
3@
3@
3@
O''line and online
redo log 'iles
!! ! 35 3@ . . .
Data 'iles
!0
!0
!0
3@
3@
J(ll bac0(p
!0 ; 36
3@
4egend=
4og seB(ence n(mber
;
"cenarios= 8ntrod(ction
#n an 3.4 System with an &rac0e database! most data fi0es have the status online and read.write. 7or
a functionin,! consistent database! a00 data fi0es as we00 as the contro0 fi0es must therefore be
synchronous R that is! they must match in terms of time.
&rac0e creates synchroniNation data usin, time stamps. 'ime stamps are inte,ers that are increased
durin, certain database actions! and entered in a00 data and contro0 fi0e headers by the 0o, writer or
checkpointer process at the checkpoint.
An e1amp0e of synchroniNation data is the 0o, seIuence number =*S$>! which is increased by :
durin, every 0o, switch. At a more sophisticated 0eve0! &rac0e can define synchroniNation on
transaction 0eve0 usin, the system chan,e number =SC$>! which is increased! for e1amp0e! after the
C&MM#' in a chan,e transaction! or at the checkpoint.
'he scenario shown in this s0ide =and the fo00owin, three s0ides> depicts a database that has been
saved comp0ete0y and error8free at time >S3D7'. At time >S3D35! a media or user error dama,es
the database so e1tensive0y that the database instance breaks down or the database is inconsistent.
'he off0ine and on0ine redo 0o, fi0es that were created between the be,innin, of the backup and the
occurrence of the error are avai0ab0e.
=C> SAP AG BC505 6
7.5
SAP AG 1999
3@
3@
3@
3@
3@
3@
3@
3@
3@
!0
3@
!0
#artial restore
!0 !! 35 3@ . . .
Complete
reco%ery
3; . . .
mo#nt open
"cenario= #artial Restore and Complete Reco%ery
Control 'iles
O''line and online
redo log 'iles
Data 'iles
7cenario: Because of a head crash! data has been 0ost durin, business operation. 'he database is
inconsistent! and is no 0on,er runnin, proper0y.
A partial restore and complete reco"ery is performed to ,et the database runnin, proper0y a,ain! and
to recover the database to its status Oust before the error occurred.
%urin, a restore! database fi0es are copied from the backup medium back to the disk. %urin, a
partial restore and complete reco"ery! on0y the reIuired minimum of data is copied. 'he database
fi0es that are to be copied back can be combined from different backups. Because the database fi0es
are no 0on,er synchronous after a partia0 restore! the database is inconsistent and wi00 not run
proper0y after the copy8back procedure has terminated.
'o synchroniNe the fi0es! the database eva0uates the synchroniNation data that has been saved in the
fi0e headers. 'he database reIuests a00 off0ine redo 0o, fi0es that have accumu0ated since the Ao0destB
database fi0e =in 0o,ica0 terms>! in uninterrupted seIuence. %urin, a reco"ery! a00 data chan,es
0o,,ed by these off0ine redo 0o, fi0es are rep0icated in the fi0es that have been copied back. "ith a
partial restore and complete reco"ery! a00 chan,es are performed a,ain unti0 a00 data fi0es are at the
same SC$ =a procedure ca00ed media reco"ery>. "hen the database is subseIuent0y started up!
durin, the instance reco"ery! a00 transactions that are not committed are taken back! usin, the
ro00back se,ments! which are 0ikewise recovered. 'he database is now consistent! capab0e of runnin,!
and back to its data status Oust before the error occurred.
=C> SAP AG BC505 5
7.6
SAP AG 1999
J(ll restore
!0
!0
!0
!0
!0
!0
;
!0 !! 35 3@ . . .
!0 !! . . .
open
"cenario= Database Reset
Control 'iles
O''line and online
redo log 'iles
Data 'iles
7cenario: %urin, an up,rade! e1tensive software or hardware prob0ems have arisen. As a resu0t! the
up,rade must be terminated. 'he database is inconsistent! and is no 0on,er runnin, proper0y.
7ortunate0y! a fu00 off0ine backup was performed immediate0y before the up,rade.
A database reset is performed to ,et the database runnin, proper0y a,ain! and to reset the database to
its status immediate0y before the up,rade.
'he database is reset usin, a full restore. "ith a full restore! a00 data fi0es as we00 as the o0der on0ine
redo 0o, fi0es and contro0 fi0es are copied back from the backup medium. Since these fi0es must
ori,inate from the same va0id off0ine backup! the database is consistent and ready to run after the
copy8back procedure has terminated. 'herefore! a reco"ery is not reIuiredS the database can be
started up at once.
After the database startup! new off0ine redo 0o, fi0es are ,enerated which! at the technica0 0eve0! AfitB
the fu00 backup as precise0y as the o0d off0ine redo 0o, fi0es. #f an additiona0 fu00 restore is reIuired!
you risk makin, a recovery possib0e in two different 0o,ica0 directions.
A database reset a0ways resu0ts in data 0oss. 'he data that has been ,enerated between the fu00
backup and the prob0em situation is 0ost. &f course! the database as such does remain consistent.
=C> SAP AG BC505 /
7.7
SAP AG 1999
!0
!0
!0
!0
!0
!0
!0 !! 5 . . .
! . . .
6 35 . . .
mo#nt Open resetlogs
4
4
5
5
5
5
5
5
!
!
!
!
!
!
8ncomplete
reco%ery
"cenario= #oint in +ime Reco%ery
Control 'iles
O''line and online
redo log 'iles
Data 'iles
J(ll restore
7cenario: %urin, an up,rade! a user accidenta00y enters the command drop table. As a resu0t!
the up,rade must be terminated. A fu00 backup is avai0ab0e! but was not performed immediate0y
before the up,rade process be,an.
A point in time reco"ery is performed to ,et the database runnin, proper0y a,ain! and to reset the
database to the status at a certain point in time before the up,rade. 7rom that point on! the data is
recovered up to a certain point! for e1amp0e! up to the start of the up,rade! or up to the tab0e drop.
#nitia00y! a00 data fi0es are rep0aced by copies of on0ine.off0ine backups! usin, a full restore. 'he
termination point of the recovery determines whether the contro0 fi0es shou0d a0so be rep0aced. A00
data fi0es and on0ine redo 0o, fi0es are entered in the contro0 fi0es with specified paths. 'he contro0
fi0es must reproduce this fi0e structure at the operatin, system 0eve0 accordin, to the status of the
structure at the end of the recovery procedure.
%urin, the recovery phase! the chan,es to the dataset are performed a,ain. Incomplete reco"ery
refers to the end point of recovery! which can be anywhere between the end of the copied backup and
the 0ast entry in the current on0ine redo 0o,. 'he recovery end point can be defined by the redo 0o,
fi0e seIuence number! or by specifyin, either a point in time or an SC$.
After a point in time reco"ery! the database is norma00y opened usin, alter database open
resetlogs! un0ess a comp0ete recovery is performed. Since a recovery cannot be performed after
usin, open resetlogs! a who0e backup must be tri,,ered immediate0y.
=C> SAP AG BC505 P
7.
SAP AG 1999
Io) to Iandle #roblems
Do not ma0e any rash decisions
Analy?e the problem in detail
Create a problemAsol%ing strategy
Be'ore restoring any 'ilesD chec0=
2hat is ca(sing the problem
2hether there is eno(gh dis0 space to sa%e and restore 'iles
2hether a hard)are e*tension is necessary
+he 'ile system and mo(nt points
+he a%ailability o' bac0(ps
+he a%ailability o' o''line redo log 'iles
#f a database prob0em occurs! you must ana0yNe the prob0em and create a prob0em8so0vin, strate,y.
'o ana0yNe the database prob0em! check the database a0ert 0o, and the trace fi0es be0on,in, to the
back,round processes in directory D&3AC*(E;&M(.saptrace.back,round.
Lour prob0em8so0vin, strate,y depends on the answers to the fo00owin, IuestionsG "hat is the status
of the database R avai0ab0e or not avai0ab0eV #s this a user error or a media errorV "hich fi0es are
corruptedV "hich fi0e types =data fi0es! contro0 fi0es! on0ine redo 0o, fi0es> are affectedV #s software
or hardware mirrorin, avai0ab0eV
'o be on the safe side =and time permittin,>! perform a full offline bac/up be3ore the fi0es are copied
back! usin, B3BACJ9P or operatin, system =&S> backup too0s.
#n the event of a hard disk prob0em! such as a head crash! hardware must be rep0aced. #n this unit! we
assume that! at the &S 0eve0! a fi0e system has been created and mounted at the o0d 0ocation.
#f you fo00owed the backup cyc0e recommended by SAP! you wi00 have a number of database
backups and off0ine redo 0o, fi0e backups for a restore and recovery. Lour prob0em8so0vin, strate,y
wi00 determine which backup and off0ine redo 0o, fi0es are copied back! and how they need to be
app0ied.
Do not make an9 ras$ decisions. #f you make mistakes or act care0ess0y! you can drastica00y
a,,ravate the restore and recovery situation. 'he costs incurred by a consu0tin, session provided by
SAP or an SAP partner are ne,0i,ib0e compared to the business conseIuences of data 0oss! even for a
sin,0e day of production operation.
=C> SAP AG BC505 H
7.!
SAP AG 1999
Detail logs
back*SID+.lo!
arch*SID+.lo! Reco%ery
script
saparch
Jind o''line
redo log 'iles
Restore
data 'iles
Reco%er
database
Restore o''line
redo log 'iles
Jind
bac0(ps
Chec0
Database
Database
#artial Restore and Complete Reco%ery 6!:
'he SAP%BA function partial restore and complete reco"ery rep0aces 0ost data fi0es by usin,
appropriate backups! and subseIuent0y recovers the restored data fi0e status usin, redo 0o, fi0es. 'o
be ab0e to use this function! your on0ine redo 0o, fi0es and contro0 fi0es must be va0id. 'he partial
restore and complete reco"ery procedure consists of si1 phases that are e1ecuted either manua00y or
automatica00y! in a predetermined seIuence R that is! a particu0ar phase can on0y be se0ected after the
previous one has been comp0eted successfu00y =statusG finished or not needed>.
#n the 0hec/ Database phase! the status of a00 fi0es in the database =that is! the contro0 fi0es! on0ine
redo 0o, fi0es! and data fi0es> as we00 as the tab0espace status =on0ine.off0ineS on0ine backup mode> are
checked. 0hec/ Database can be e1ecuted re,u0ar0y with the database runnin,S thus! it provides an
overview of the physica0 status of the database.
#n the 0hec/ Database phase! SAP%BA refers to entries in &rac0es 2D2iews =such as
2D%A'A7#*(! 2D3(C&2(3E7#*(>. #f an error is detected durin, this phase! a safe chec/ must be
performed R that is! the database must be shut down =initia00y usin, shutdown immediateS if
this is unsuccessfu0! SAP%BA su,,ests shutdown abort>. $e1t! to update the 2D2iews! the
database is set to status mount. SAP%BA 0o,s any recorded errors in data fi0es in directory sapreor,
with the suffi1 =rc"> for recovery. A safe check is a prereIuisite for any subseIuent restore and
recovery activities.
Missin, sapdata directories are not created automatica00yS rather! they are mount points. ;owever!
missin, subdirectories are created automatica00y.
=C> SAP AG BC505 5
7.10
SAP AG 1999
Detail logs
back*SID+.lo!
arch*SID+.lo! Reco%ery
script
Chec0
Database
Jind o''line
redo log 'iles
Restore
bac0(p 'iles
Reco%er
database
Restore o''line
redo log 'iles
Jind
bac0(ps
saparch
Database
#artial Restore and Complete Reco%ery 6:
#n the @ind )ac/up @iles phase! backups are determined usin, the entries in the B3BACJ9P
summary 0o, fi0e bac/<SID>$lo2 =return code ' or 7>. 'he associated detai0 0o,s show whether the
reIuired data fi0es were in the backup. 'he data fi0es can be compi0ed from various backups. 'o
minimiNe the subseIuent recovery time! SAP%BA a0ways su,,ests the most recent backup.
#n the Restore )ac/up @iles phase! the data fi0es are restored to their ori,ina0 0ocation. #f on0y inde1
fi0es are missin,! SAP%BA can recreate and bui0d up these fi0es usin, %atabase %ictionary
information.
#n the @ind ffline Redo >o2 @iles phase! the off0ine redo 0o, fi0es reIuired for a comp0ete recovery
are determined. 'he B3A3C;#2( summary 0o, fi0e arch<SID>$lo2 0ists the tapes where the off0ine
redo 0o, fi0es have been saved. Lou can choose between a first or second backup =for e1amp0e! when
saved! with brarchi"e 1cds>. SAP%BA takes e1istin, on0ine redo 0o, fi0es and off0ine redo 0o, fi0es in
saparch into consideration. After the appropriate backups have been found for a00 reIuired off0ine
redo 0o, fi0es! the @ind Archi"e @iles phase ends with the status finished.
#n the Restore ffline Redo >o2 @iles phase! the off0ine redo 0o, fi0es that have been found are read
=from tape> back to directory saparch.
#n the Reco"er Database phase! SAP%BA creates recovery scripts in a subdirectory of sapreor,.
9sin, these scripts! a contro0 fi0e is saved! and a reco"er database statement =that is! a comp0ete
recovery> is transmitted to &rac0e. 'he SAP%BA messa,e Reco"er database terminated successfully
indicates that the database has been recovered comp0ete0y.
=C> SAP AG BC505 :0
7.11
SAP AG 1999
#artial Restore and Complete Reco%ery 4imitations
4ogs
&o data or o''line redo
log 'ile bac0(ps a%ailable
&o BRBAC/7#/BRARCI81,
logs a%ailable
Control 'iles damaged
Online redo log 'iles damaged
init*SID+.7
&o init*SID+.7
'iles a%ailable
#roblem "ol(tions
#er'orm a database reset
#er'orm a point in time
reco%ery
7se the "A#DBA '(nction
,estore indiid#al files
Restore these 'iles 'rom
tape (sing command
brrestore -n init0ora
Copy one o' its mirrors
"ee R/3 Online Ielp
'he SAP%BA function partial restore and complete reco"ery can be used to restore 0ost data and to
hand0e the most freIuent0y occurrin, database prob0ems. #n some cases! however! partial restore
and complete reco"ery reIuires additiona0 manua0 tasks! or the use of &rac0e too0s.
#f there are no appropriate data backups! or if a00 off0ine redo 0o, fi0es ,enerated since the 0ast backup
are not avai0ab0e! you cannot run a partial restore and complete reco"ery. #n this case! you must
perform a database reset or a point in time reco"ery up to the 0ast e1istin, off0ine redo 0o, fi0e.
#f other database fi0es are corrupted! in addition to data fi0es! the partial restore and complete
reco"ery function terminates and you must restart this function once the additiona0 error has been
reso0ved.
#f the B3BACJ9P.B3A3C;#2( 0o,s cannot be found! you can restore them from the 0ast backup
usin, the SAP%BA function Restore indi"idual files.
#f the fi0es init<SID>$dba and init<SID>$ora cannot be found! you can restore them from tape. At
the command prompt! enter brrestore -n init0ora.
#f init<SID>$sap has been 0ost! SAP too0s can no 0on,er access the tape drive. #n this case! adapt a
samp0e init<SID>$sap =directory SAP8()(>! or use &S command cpio to restore it from the third
position on a B3BACJ9P or B3A3C;#2( tape.
#f a contro0 fi0e is dama,ed! you can copy one of its mirrors.
#f a00 the contro0 fi0es or on0ine redo 0o, fi0es are 0ost! see 3.4 &n0ine ;e0p! section D)A racle.
=C> SAP AG BC505 ::
7.12
SAP AG 1999
Database
sapreorg
"a%e c(rrent
online redo log 'iles
and control 'ile
O%er)rite all
data 'ilesD control 'ilesD
and online redo log 'iles
Jind
'(ll o''line
bac0(ps
Detail logs
back*SID+.lo!
Database
mo#nt
Database
open
Database Reset 7sing a J(ll O''line Bac0(p
"hen you perform a database reset! the database is reset to its previous consistent status R that is! its
status at the time of a fu00 backup. 'o determine the 0ast possib0e fu00 backup! SAP%BA is ,uided by
the entries in the B3BACJ9P summary 0o, fi0e bac/<SID>$lo2 and the associated detai0 0o,s.
3esettin, the database a0ways invo0ves data 0oss. 'herefore! SAP recommends performin, a full
offline bac/up be3ore resettin, the database. =#f the database is runnin, proper0y! use SAP too0sS
otherwise! use operatin, system too0s.>
'he SAP%BA function Reset Database can be se0ected with a fu00 off0ine backup =choose Restore
database and startup open or Restore database and startup mount>! or a fu00 on0ine consistent
backup =choose Restore database usin2 online consistent bac/ups>.
%ependin, on the function chosen! SAP%BA sets the database ether to status open =that is! no reset
lo2s> or to status mount. #f the database has status mount! you can recover data usin, &rac0e too0s!
such as the Server Mana,er. #f the database has the status open! you cannot perform a retroactive
recovery. 7or a retroactive recovery! use Restore database and startup mount instead of Restore
database and startup open.
"ith a database reset usin2 a full offline bac/up! the data fi0es! contro0 fi0es! and online redo 0o,
fi0es are overwritten usin, the appropriate =taped> backups. 7or security reasons! these fi0es are
copied immediate0y to a subdirectory of sapreor,. ='o enab0e these copies to be made! the database
must have the status mount.>
=C> SAP AG BC505 :-
7.13
SAP AG 1999
Reco%ery
script
saparch
Database
sapreorg
"a%e online
redo log 'iles
and control 'ile
Jind
OnlineECons
bac0(ps
Detail logs
back*SID+.lo!
Reco%er
database
(ntil cancel
Database
open
resetlogs
Database Reset 7sing a Consistent Online Bac0(p
O%er)rite all
Data 'iles and
control 'iles
O''line
redo log 'iles
"hen you perform a database reset usin2 a full online consistent bac/up! the database is reset to a
consistent status from the end =point in time> of the fu00 backup.
"ith a database reset usin2 a full online consistent bac/up! data fi0es! contro0 fi0es! and o33line redo
0o, fi0es are overwritten by the appropriate =taped> backups. 'herefore! you must save a00 off0ine redo
0o, fi0es in saparch usin, B3A3C;#2( and perform a fu00 backup be3ore you reset the database
usin, &n0ineECons. %urin, this process! note the messa,es disp0ayed by SAP%BA.
After a fu00 restore! durin, a point in time reco"ery =recover database using backup
controlfile until cancel>! on0y the off0ine redo 0o, fi0es created durin, the on0ine
consistent backup are restored and app0ied. $o other point in time can be chosen. 'he database is
then started usin, option resetlo2s. 'he on0ine redo 0o, fi0es are new0y initia0iNed or new0y created.
%ata cannot be recovered after openin, the database with the option resetlo2s! therefore! you must
perform a backup. $one of the backups performed before the database reset usin2 online consistent
bac/ups can be used for a partial restore and complete reco"ery. $oteG After a successfu0 database
reset! any off0ine redo 0o, fi0es that have been restored shou0d be de0eted manua00y from saparch.
#f SAP too0s have been used! reworkin, is reIuired after a database reset. Since 0o, tab0es S%BA;
and S%BA% are reset to an obso0ete status! B3BACJ9P may reIuest tapes that have been re0eased
=in 0o,ica0 terms>! but which are physica00y sti00 0ocked. B3A3C;#2( may not reco,niNe the new
off0ine redo 0o, fi0es as needin, to be saved. 7or more detai0s! see 3.4 &n0ine ;e0p! chapter D)A
racle.
After a successfu0 database reset! the data fi0es can be searched for corrupt b0ocks! usin, the &rac0e
too0 %BE2(3#7L.
=C> SAP AG BC505 :4
7.14
SAP AG 1999
Jind o''line
redo log 'iles
Jind '(ll o''line/
online bac0(ps
Detail logs
back*SID+.lo! arch*SID+.lo!
Reco%er
(ntilQ
"tat(s=
allo)edQ
reor!*SID+.lo!
Database
8np(t=
time
&ot allo)ed i' (for example8=
A &o bac0(p speci'ied
A &o o''line redo log 'iles 'o(nd
A Reco%ery o%er tablespace reorg
A Bac0(p be'ore open resetlo!s
J(ll Restore and Reco%ery 6!:
"ith a full restore and reco"ery! the database is reset to a consistent status between the =end> point in
time of the fu00 backup! and the current point in time. 'his SAP%BA function corresponds to the
point in time recovery.
A full restore and reco"ery usua00y invo0ves data 0oss. 'herefore! SAP recommends that you perform
a full offline bac/up be3ore any full restore and reco"ery. =#f the database is runnin, proper0y! use
SAP too0sS otherwise! use operatin, system too0s.> #n addition! a00 off0ine redo 0o, fi0es in saparch
shou0d be saved usin, B3A3C;#2(.
A full restore and reco"ery can be performed usin, SAP%BA if the database can be set to status
mount or open. 7irst! a fu00 on0ine =or! if app0icab0e! &n0ineECons>! or a fu00 off0ine backup must be
se0ected. A,ain! SAP%BA is ,uided by the B3BACJ9P summary 0o, fi0e bac/<SID>$lo2 and the
correspondin, detai0 0o,s. $e1t! enter the recovery end point. 7or a comp0ete recovery! enter B#L.
'he off0ine redo 0o, fi0e backups reIuired for this point in time recovery are determined usin, the
entries in the B3A3C;#2( summary 0o, fi0e arch<SID>$lo2.
9nder Show Status! SAP%BA indicates whether the intended recovery is a00owed =statusG allowed>.
A recovery may be reOected ifG
$o fu00 backup has been specified! or the reIuired off0ine redo 0o, fi0es have not been found
'he recovery to be run contains a tab0espace reor,aniNation with data fi0es
'he se0ected backup is dated before the 0ast time the database was opened usin, the option
resetlo2s.
=C> SAP AG BC505 :6
7.15
SAP AG 1999
Reco%ery
script
saparch sapreorg
"a%e online
redo log 'iles
and control 'ile
Reco%er
database
6(ntil time:
Database
Database
open
6resetlogs:
O%er)rite all
Data 'iles and
control 'iles
6i' necessary:
O''line redo
log 'iles
J(ll Restore and Reco%ery 6:
7or security reasons! the current on0ine redo 0o, fi0es and a contro0 fi0e are copied to a subdirectory
of sapreor,. A00 data fi0es are restored from the backup medium =full restore>. 'he contro0 fi0es may
a0so be restored! dependin, on whether a tab0espace was e1tended at the recovery time point.
After a fu00 restore! SAP%BA can rep0icate the tab0espace e1tension in the database! usin, alter
database add data file... #nformation about fi0e specifications is contained in directory sapreor, in
the SAP%BA 0o,s struct<SID>$lo2 and reor2<SID>$lo2. After a tab0espace e1tension! or after
movin, data fi0es to another 0ocation! ensure you back up the new0y chan,ed structure.
'he off0ine redo 0o, fi0es reIuired for the indicated recovery time point are restored to directory
saparch. 9sin, a recovery script! the database is recovered to the desired point in time =recover
database until time 88yy77 Iusing backup controlfileJ>.
#f recovery was incomp0ete! the database must be opened usin, the option resetlo2s. 9sin, the
&rac0e too0 %BE2(3#7L! the database can be searched for corrupt data b0ocks. #n addition!
SAP%BA automatica00y ,oes to the backup menu! since the database has been opened usin,
resetlo2s.
'he copied off0ine redo 0o, fi0es shou0d be de0eted from directory saparch. #f you have used SAP
too0s! reworkin, is reIuired after an incomp0ete recovery. 7or more detai0s! see 3.4 &n0ine ;e0p!
chapter D)A racle.
=C> SAP AG BC505 :5
7.16
SAP AG 1999
7nit "(mmary
&o) yo( are able to=
Analy?e the physical database str(ct(re (sing
"A#DBA
Reco%er the database (sing the "A#DBA '(nction
Partial ,estore and Complete ,ecoer$
Reset the database (sing the "A#DBA '(nction
,eset Database
#er'orm a point in time reco%ery (sing the "A#DBA
'(nction 6#ll ,estore and ,ecoer$
=C> SAP AG BC505 :/
7.17
SAP AG 1999
J(rther Doc(mentation
/no)ledge #rod(ct CD
"A# Database Administration Oracle
R/3 Online Ielp
Basis Database interface DBA 9racle
"A# +ech&et
Information Media Center S$stem
Mana!ement CCMS
R. 1elp(riD A. Ad0oli
Oracle@ Bac0(p and Reco%ery Iandboo0.
Oracle #ressD Osborne
=C> SAP AG BC505 :P
7.1
SAP AG 1999
,*ercises
Q
"ol(tions
7nit Actions
=C> SAP AG BC505 :H
7.1!'estore and 'eco%er9: )6ercises
&o. ,*ercise
! Partial ,estore and Complete ,ecoer$ 7sing "A#DBA
!is e1ercise demonstrates data.ase .e!avior a(ter accidental loss o( data<
)it! t!e aim o( (amiliariGin& t!e #artici#ant )it! 4se o( t!e SAP-/A (4nction
1artial rest#re and c#)!lete rec#very< and o( #ointin& o4t t!e limitations o(
t!is #ro&ram.
1.1 :ns4re t!at at least one valid (4ll .ac,4# 3online/o((line5 is availa.le< and t!at
yo4r o((line redo lo& (ile c!ain is .ac,ed 4# )it!o4t any &a#s.
1.2 Sim4late a !ead cras! .y deletin& t!e entire contents o( directory sa#data3
3s4.directories #rotdB1< sta.iB1< 4ser1iB15.
Restore yo4r data.ase com#letely 4sin& one o( t!e .ac,4#s yo4 #er(ormed
(or t!e 4nit NSc!ed4lin&< Per(ormin&< and %onitorin& /ac,4#sN. 0se t!e
SAP-/A (4nction 1artial rest#re and c#)!lete rec#very.
1.3 Sim4late a !ead cras! .y deletin& directory sa#data2 3s4.directories #rotiB1<
sta.dB1< 4ser1dB1< cntrl5.
Restore yo4r data.ase com#letely 4sin& one o( t!e .ac,4#s yo4 #er(ormed
(or t!e 4nit NSc!ed4lin&< Per(ormin&< and %onitorin& /ac,4#sN. 0se t!e
SAP-/A (4nction 1artial rest#re and c#)!lete rec#very. C!oose t!e o#tion
1artial rest#re and c#)!lete rec#very a second time a(ter yo4 !ave
eliminated t!e error.
=C> SAP AG BC505 :5
7.20'estore and 'eco%er9: 7ol8tions
&o. "ol(tion
!
1.2 C!an&e to directory sa#data3< 4sin& cd /#racle/3SID4/sa!data8.
o con(irm t!at only s4.directories #rotdB1< sta.iB1< 4ser1iB1 are located in
sa#data3< enter ls Kl'
o delete t!ese directories< enter
rm Kr protd0/5 stabi0/5 user/i0/'
Start SAP-/A. 0nder +' Rest#re/Rec#very< c!oose a' 1artial rest#re and
c#)!lete rec#very. o determine t!e (4nction o( eac! o( t!e si1 #!ases< r4n
t!ro4&! eac! o( t!em man4ally and in seF4ence.
"n t!e a' Check #!ase, t!e loss o( data (iles is detected. 7e1t< SAP-/A
attem#ts to s!4t do)n t!e data.ase< 4sin& shutdown immediate' Since a
consistent data (ile stat4s can no lon&er .e ac!ieved< t!is attem#t (ails. !e
-/A m4st s4.seF4ently con(irm t!e shutdown abort. SAP-/A .rin&s t!e
data.ase to t!e )#unt stat4s< and detects t!e loss o( a total o( t!ree data
(iles.
"n t!e b' Find &acku! Files #!ase< 4nder d' Select a backu! run $#r rest#re<
yo4 can c!oose one o( t!e .ac,4#s yo4 #er(ormed (or t!e 4nit NSc!ed4lin&<
Per(ormin&< and %onitorin& /ac,4#sN. SAP-/A a4tomatically s4&&ests t!e
most recent .ac,4#. 0nder c' Select a backu! $ile $#r rest#re< con(irm t!at t!e
.ac,4# yo4 !ave c!osen is .ein& 4sed (or t!e restore.
A(ter t!e desired data (iles !ave .een s4ccess(4lly restored d4rin& t!e c'
Rest#re &acku! Files #!ase< t!e reF4ired o((line redo lo& (iles are determined
d4rin& t!e d' Find Archive Files !hase.
"( .ac,4#s !ave .een #er(ormed to several ta#es 3(or e1am#le< brarchive
-cds5< t!e individ4al r4ns can .e selected 4nder e' Rest#re Archive $iles.
Recovery is started 4sin& $' Rec#ver Database. !e messa&e Rec#ver
database ter)inated success$ully indicates s4ccess(4l com#letion o( a re#air
action.
1.3 C!an&e to t!e $racle !ome directory 4sin& cd /#racle/3SID4. -elete t!is
directory .y enterin& rm Kr sapdata6'
As )it! e1ercise 1.2< c!an&e to t!e e5!ert mode. 0nder +' Rest#re/Rec#very<
start t!e (4nction a' 1artial rest#re and c#)!lete rec#very.
"n t!is scenario< alon& )it! directory SAP-AA< a control (ile !as also .een
lost in addition to data (iles. +!en t!is error occ4rs< t!e -/A m4st ta,e
man4al action. -4rin& t!e c!ec, #!ase< 1artial rest#re and c#)!lete
rec#very is a.orted.
"n (ile init3SID4.#ra< c!ec, )!ere t!e data.ase e1#ects control (iles< and
enter?
cd /oracle/GS1D</dbs
more initGS1D<'ora
C!ec, t!e val4e set (or #arameter c#ntr#l$iles.
0sin& SAP-/A< s!4t do)n t!e data.ase< .y c!oosin&
a' Startu!/Shutd#"n instance b' Shutd#"n d' Shutd#"n ab#rt
Create directory sa#data2 once a&ain 3normally< t!is is t!e mo4nt #oint in t!e
=C> SAP AG BC505 -0
data.ase system5.
S!4t do)n t!e data.ase 4sin& SAP-/A )it! Shutd#"n ab#rt. "n (ile
init3SID4.#ra< con(irm t!e location o( yo4r data.ase control (iles< and t!eir
names 34nder #arameter c#ntr#l>$iles5. "n directory sa#data2< create a
s4.directory (or t!e control (ile< and co#y a mirror o( t!e control (ile to t!is
s4.directory. 37$:? Co#yin& a control (ile (rom one o( yo4r .ac,4#s leads
to an 4nnecessary recovery sit4ation t!at can only .e resolved .y a $ull
rest#re and $ull rec#very< or .y 4sin& $racle commands.5
7e1t< t!e SAP-/A (4nction !artial rest#re and $ull rec#very can .e restarted.
"t t!en r4ns a4tomatically.
"n t!e $racle !ome directory< create a ne) sa#data2 directory. Dor t!is
directory< create a s4.directory (or t!e control (ile .y enterin&?
cd /oracle/GS1D<
mkdir sapdata6
cd sapdata6
mkdir cntrl
Co#y a mirrored control (ile @so4rceA to t!e ne) directory.
cd cntrl
cp Gsource<
7$:? Co#yin& a control (ile (rom one o( t!e .ac,4#s leads to a recovery
sit4ation t!at can no lon&er .e resolved 4sin& 1artial rest#re and c#)!lete
rec#very.
As (or e1ercise 1.2< in SAP-/A 4nder +' Rest#re/Rec#very< start t!e (4nction
a' 1artial rest#re and c#)!lete rec#very. !e data.ase re#air is no)
#rocessed as descri.ed in e1ercise 1.2.
=C> SAP AG BC505 -:
SAP AG 1999
Bac0(p "trategies 7sing R-A&
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
.2
SAP AG 1999
Contents
Bac0(p strategies (sing R-A&
ObCecti%es
At t!e end o( t!is 4nit< yo4 )ill .e a.le to?
,*plain the %ario(s bac0(p strategies (sing R-A&
Decide )hether R-A& bac0(p strategies 'it the
needs o' yo(r company
Bac0(p "trategies 7sing R-A&
3MA$ =3ecovery Mana,er> is de0ivered with &rac0e. 'his chapter describes the various 3MA$
backup options that are avai0ab0e for use with SAP too0s.
=C> SAP AG BC505 -
.3
SAP AG 1999
J(ll Bac0(p 64e%el 0: )ith R-A& and "A# +ools 6!:
cpio/dd
brbac0(p
R-A&
Control (iles
-ata.ase (iles
! ! !
3 3 3
le%el 0=
back#p3mode back#p3mode F '(ll F '(ll
tape3 tape3cop$3cmd cop$3cmd F cpioVdd F cpioVdd
cpio/dd
#f you use SAP too0s for a database backup with 3MA$! you cannot perform a native backup with
3MA$.
'wo types of backup usin, 3MA$ can be performedG
7u00 backup =a0so ca00ed 0eve0 0 backup>
#ncrementa0 backup =a0so ca00ed 0eve0 : backup>. An incrementa0 backup is based on the 0ast fu00
backup! and wi00 be discussed 0ater in this chapter.
7or more information about full! incremental and whole backup types! see SAP $ote :P00:4.
A fu00 backup is a0ways performed with backupEmode M fu00. #n a fu00 backup! there are two ways of
writin, data to tapeG
Backin, up data with 3MA$
Backin, up data with &S too0s
#f SAP too0s are used! no recovery cata0o, is reIuired. 'he backed up data fi0es are cata0o,ed in the
contro0 fi0e.
"ith 38ll back8, with O7 tools! the tapeEcopyEcmd parameter is set to cpio or dd and the data fi0es
are saved to tape with the command specified. After that! brbackup starts 3MA$. 3MA$ cata0o,s
the backed up data fi0es to the contro0 fi0e as 0eve0 0 backup. A contro0 fi0e is then backed up to tape
with the &S too0 specified =cpio or dd>.
=C> SAP AG BC505 4
.4
SAP AG 1999
J(ll Bac0(p 64e%el 0: )ith R-A& and "A# +ools 6:
Oracle
shado)
process
3 3 3
R-A&
le%el 0=
"B+ 4ib
back#p3mode back#p3mode F '(ll F '(ll
tape3cop$3 tape3cop$3cmd cmd F rman F rman
Control (iles
-ata.ase (iles
cpio
brbac0(p
! ! !
"ith 38ll back8, with '2A< the tapeEcopyEcmd parameter is set to rman. Brbackup starts
3MA$! which backs up the data fi0es. 3MA$ reads a00 data fi0e b0ocks! and on0y backs up those
b0ocks that are no 0on,er in initia0 status. ConseIuent0y! b0ocks from dropped tab0es are a0so backed
up. 'he b0ocks are backed up by the &rac0e shadow process direct to tape. A backup 0ibrary for
&rac0e must therefore be insta00ed =see SAP $ote :6-/45>. %urin, the data fi0e backup! 3MA$
cata0o,s the 0eve0 0 backup to the contro0 fi0e. After the data fi0e backup! a contro0 fi0e =with a00 0eve0
0 information> is saved to tape.
Advanta,es of backin, up with 3MA$G
A00 b0ocks are checked for b0ock corruption
'he tab0espaces are not set to be,in.end backup mode. 'hus! usua00y! fewer off0ine redo 0o, fi0es
are created.
*ess data to be backed up
Ca8tionG A who0e or partia0 backup with 3MA$ =tapeEcopyEcmdMrman! backupEmode M a00> is
possib0e! but is not a 0eve0 0 backup. ;owever! a00 other advanta,es mentioned above app0y.
7u00 backups to disk can a0so be performed =backupEdevEtypeMdisk>. 'he parameter diskEcopyEcmd
is used instead of the parameter tapeEcopyEcmd! with the correspondin, settin,s. 'he method differs
on0y where 3MA$ is usedG $o backup 0ibrary for &rac0e is needed! and data fi0es instead of savesets
are saved =as is the case when usin, &S too0s>.
=C> SAP AG BC505 6
.5
SAP AG 1999
sa%eset
Ieader
+railer
"a%esets
sa%esetEmembers F !V V 3V 4 sa%esetEmembers F tsp sa%esetEmembers F all
sa%eset
Ieader
+railer
sa%eset
Ieader
+railer
btabd.data!
btabd.data9
sa%eset
Ieader
+railer
sa%eset
Ieader
+railer
data'ileA
data'ileB
data'ileC
data'ileD
data'ile!
data'ile&
#n a backup usin, 3MA$! the tape 0ayout is the same as with a backup usin, &S too0s. 'he
difference is that savesets are backed up instead of data fi0es.
A saveset consists of a header! a trai0er! and the b0ocks of at 0east one data fi0e. Savesets are on0y
used when the backup is performed with 3MA$.
'he init?S#%@.sap parameter savesetEmembers determines the number of savesets. 'his parameter
can be overridden in sapdba or by ca00in, up brbackup.
'he fo00owin, settin,s are possib0eG :! -! 4! 6! tsp or a00. 7or e1amp0eG
#f savesetEmembers M 6! four data fi0es are ,rouped to,ether to form one saveset. #n a comp0ete
database backup! severa0 savesets are formed! each with the data from four data fi0es. 'hese
savesets are backed up to tape.
#f savesetEmembers M tsp! a saveset is formed for every tab0espace that is to be backed up. 'he
saveset contains the data of a00 data fi0es per tab0espace.
#f savesetEmembers M a00! on0y one saveset is formed. 'his saveset contains the data of a00 data
fi0es.
#f savesets are formed from more than one data fi0e! 3MA$ reads the data in para00e0 from the
appropriate data fi0es.
Advanta,eG ;i,her output to the tape station=s>. 7ast tape stations can be kept in streamin, mode!
thus reducin, the time reIuired for a backup.
%isadvanta,eG #n a restore.recovery situation! if the data from one data fi0e is needed! the comp0ete
saveset must be read from the tape. #f a disk that contains severa0 data fi0es is dama,ed! these data
fi0es must be restored from severa0 savesets for the restore.recovery.
=C> SAP AG BC505 5
.6
SAP AG 1999
#reparation R(n
brbac0(p
! ! !
R-A&
/de%/n(ll
compression
rate
sa%esetEmembers F ! sa%esetEmembers F !
sa%esetEmembers F 4 sa%esetEmembers F 4
sa%eset != compressratio * sa%eset != compressratio *
data'ileA data'ileA
data'ileB data'ileB
data'ileC data'ileC
data'ileD data'ileD
sa%eset = compressratio y sa%eset = compressratio y
sa%esetEmembers F tsp sa%esetEmembers F tsp
sa%esetEmembers F all sa%esetEmembers F all
3 3 3
4 4 4
data 'ile
"tart preparation
r(n once
per cycle
"tart preparation
r(n once
per cycle
Oracle
shado)
process
"B+ 4ib
brtools
#f tape stations with hardware compression! or savesets with more than one member! are used! you
must perform a preparation run.
#n the preparation run! brbackup starts an 3MA$ backup of every data fi0e to a saveset of its own.
'he data is compressed by brtoo0s! and sent to .dev.nu00. 'herefore! no additiona0 space on the hard
disk is reIuired. 'he compression rate of every saveset with one member is verified by brtoo0s! and
sent to brbackup.
At this point! brbackup determines how data fi0es are a00ocated to savesets for every possib0e va0ue of
savesetEmembers! and ca0cu0ates the compression rate of each saveset. 'he a00ocation cannot be
contro00ed! and on0y chan,es =if necessary> when a further preparation run is performed. 'herefore!
between two preparation runs! if the savesetEmembers parameters are the same! the savesets contain
the same data fi0es.
#f data fi0es e1ist that were not inc0uded in the preparation run =for e1amp0e! because a data fi0e was
added>! each one of these fi0es is put in its own saveset.
"e recommend that you perform a preparation run once per backup cyc0e! or after maOor database
chan,es! for e1amp0e! reor,aniNation! mass data transfer! or an SAP or database re0ease up,rade.
=C> SAP AG BC505 /
.7
SAP AG 1999
8ncremental 64e%el !: Bac0(p
4e%el 0 bac0(p
!0
!0
!0
5
5
5
brbac0(p
Oracle
shado)
process
R-A&
4e%el ! bac0(p
! ! !
3 3 3
le%el 0= X !0 le%el 0= X !0
Control (iles
-ata.ase (iles
"B+ 4ib
cpio/dd
!0
!0
!0
5
5
5
#ncrementa0 backup =a0so known as 0eve0 : backup> is a0ways based on the last le%el 0 backup =fu00
backup>. "ith SAP too0s! on0y cumu0ative 0eve0 : backup is supported as incrementa0 backup.
3MA$ retrieves information about the 0ast 0eve0 0 backup from the contro0 fi0es. An incrementa0
backup is a0ways a backup of the who0e database! not of individua0 data fi0es.
#n an incrementa0 backup! all b0ocks of a00 data fi0es are a0ways read. ;owever! on0y those b0ocks
that have chan,ed since the 0ast 0eve0 0 backup are backed up. 'herefore! if 0on, backup runtime was
caused by 0ow throu,hput on the tape stations! incrementa0 backup can reduce the backup time.
&n0y one saveset =endin, in .#$C3> is created for an incrementa0 backup 'he parameter
savesetEmembers is set to a00. Since on0y one saveset is created! the backup must fit on one tape.
7o00ow8up tapes cannot be used. After the incrementa0 backup is comp0ete! a contro0 fi0e is saved to
tape.
#f data fi0es have been added to the database between the 0ast 0eve0 0 backup and the 0eve0 : backup!
a 0eve0 0 backup is performed for these new data fi0es before the 0eve0 : backup starts. A00 new data
is backed up to one saveset =endin, in .79**>! even if the data was partia00y backed up.
=C> SAP AG BC505 P
.
SAP AG 1999
4e%el ! Bac0(p= 8mportant Considerations 6!:
"at/"(n
4e%el 0
bac0(p
4e%el !
bac0(p
4e%el !
bac0(p
4e%el !
bac0(p
-on +(e Jri
. . .
. . .
4e%el 0
bac0(p
-on Jri
4e%el !
bac0(p
4e%el !
bac0(p
. . .
. . .
data 'iles data 'iles
#artial restore and complete reco #artial restore and complete reco%ery )ith %ery )ith sapdba sapdba
reco%ery )ith o''line redo log 'iles 4e%el ! bac0(p based on 4e%el 0 bac0(p
"at/"(n
"ith SAP too0s! on0y cumu0ative incrementa0 backups are supported at 0eve0 :. 'his means that
incrementa0 backups contain a00 b0ocks that have chan,ed since the most recent 0eve0 0 backup =in
re0ation to the time the 0eve0 : backup was performed>.
#f a restore.recovery is necessary =for e1amp0e! due to a disk crash>! a 0eve0 : backup is not sufficient
to repair the database. 'he 0eve0 0 backup of the dama,ed data fi0es are al5a9s needed. 'hese data
fi0es must be restored from the 0eve0 0 backup. 'hen the chan,ed b0ocks from the 0eve0 : backup
=which must be based on t$is 0eve0 0 backup> can be imported to the data fi0e. $ow you on0y need to
perform a recovery from the time the 0eve0 : backup was made. #f no 0eve0 : backup is avai0ab0e for
this 0eve0 0 backup! then you must perform a recovery based on the 0ast avai0ab0e 0eve0 0 backup.
'his usua00y takes 0on,er than usin, the 0eve0 : backup as a basis.
#f the 0atest 0eve0 0 backup is dama,ed! then you must use the previous 0eve0 0 backup as a basis for
recoverin, the data fi0e. &n0y 0eve0 : backups can be used that are based on t$is =that is! previous>
backup. 'he 0eve0 : backups that are based on the dama,ed 0eve0 0 backup cannot be used.
=C> SAP AG BC505 H
.!
SAP AG 1999
4e%el ! Bac0(p= 8mportant Considerations 6:
Recommended?
! le%el 0 bac0(p
per )ee0
Stron&ly recommended?
4 le%el 0 bac0(ps
per cycle
6i' necessaryD increase
bac0(p cycle:
As basis 'or a
le%el ! bac0(p
"e recommend that you
Perform at 0east one 0eve0 0 backup per week
"e stron,0y recommend that you
(nsure that each backup cyc0e contains four 0eve0 0 backups. #f necessary! increase the backup
cyc0e. &therwise! the who0e backup strate,y is dependent on one or two 0eve0 0 backups. #f the
most recent 0eve0 0 backup was not performed in the current backup cyc0e! a warnin, appears
when the 0eve0 : backup is performed. Ca8tion: #f the most recent 0eve0 0 backup was not
performed in the current backup cyc0e! then it cannot norma00y be used for a restore because it has
been overwritten. 'herefore! if a disk error occurs! the resu0t can be a com,lete loss o3 data.
"e recommend that you verify a 0eve0 0 backup at 0east once per backup cyc0e! but preferab0y once a
week. A de0ayed verification with brrestore is on0y possib0e on the database host with an open or
mounted database.
=C> SAP AG BC505 5
.10
SAP AG 1999
Reco%ery 7sing 8ncremental Bac0(p )ith sapdba
Database
Restore
data 'iles
Jind
bac0(ps
Detail logs
back*SID+.lo!
Chec0
Reco%er
database
Reco%ery
script
saparch
Jind
o''line
redo log
'iles
arch*SID+.lo!
Restore
le%el !
bac0(p
Detail logs
back*SID+.lo!
Jind
le%el !
bac0(ps
Jind
le%el 0
bac0(ps
Restore
o''line redo
log 'iles
Restore
le%el 0
bac0(p
A partia0 restore and comp0ete recovery with 0eve0 0 and 0eve0 : backup is on0y s0i,ht0y different than
a partia0 restore and comp0ete recovery of a who0e backup.
'he check and repair phase is performed as norma0.
#n the find backup phase! the 0eve0 0 backup is se0ected. #n the restore backup phase! the data fi0e=s>
is.are restored.
#n the find 0eve0 : backup phase! a 0eve0 : backup is se0ected that is based on the 0eve0 0 backup
se0ceted. #n the restore 0eve0 : backup! the b0ocks that were backed up in the 0eve0 : backup are
written to the restored data fi0es.
'he phases that fo00ow are performed as norma0.
=C> SAP AG BC505 :0
.11
SAP AG 1999
7nit "(mmary
&o) yo( are able to=
,*plain the %ario(s bac0(p strategies (sing R-A&
Recogni?e the ad%antages and limitations o' these
strategies
Decide )hether R-A& bac0(p strategies 'it the
needs o' yo(r company
=C> SAP AG BC505 ::
.12
SAP AG 1999
J(rther Doc(mentation
/no)ledge #rod(ct= "A# Database
Administration Oracle
,&: 9nline Doc#mentation; BC
SAP Database Administration;
9racle
SAPTech<et DB Admin. 9racle
4no%led!e Base
"A# &ote !500!3
=C> SAP AG BC505 :-
.13
SAP AG 1999
,*ercises
Q
"ol(tions
7nit Actions
=C> SAP AG BC505 :4
.14Back8, 7trate"ies (sin" '2A<: )6ercises
3$#tional5
&o. ,*ercise
! J(ll Bac0(p 64e%el 0:
8n these e*ercises yo( per'orm a '(ll bac0(p )ith the "A# database
bac0(p tools. +he e*ercise re'ers to the play databasesD and is limited
to the operating system le%el.
1.1 %aintain t!e standard settin&s (or (4ll .ac,4#s in t!e (ile init@S"-A.sa#.
-ecide )!et!er to #er(orm t!e (4ll .ac,4# )it! $S tools or )it! R%A7 and
maintain t!e a##ro#riate #arameter. 3:ns4re t!at t!e .ac,4# is made to
dis,.5
1.2 Per(orm a (4ll .ac,4# to dis, )it! SAP-/A.
1.3 Con(irm t!at yo4r (4ll .ac,4# !as .een #er(ormed correctly .y c!ec,in& t!e
lo& (iles at t!e o#eratin& system level< and .y 4sin& SAP-/A.
1.4 $#tional? Dorce several lo& (ile s)itc!es 3ca. 35
8ncremental Bac0(p 64e%el !:
2.1 Per(orm an incremental .ac,4# to dis, )it! SAP-/A.
2.2 Con(irm t!at yo4r incremental .ac,4# !as .een #er(ormed correctly .y
c!ec,in& t!e lo& (iles at t!e o#eratin& system level< and .y 4sin& SAP-/A.
2.3 +!ic! (ile contains t!e .ac,ed-4# .loc,sH
+!ere can yo4 (ind t!is (ileH
3 Partial ,estore and Complete ,ecoer$ 7sing 8ncremental Bac0(p )ith
"A#DBA
3.1 :ns4re t!at at least one valid (4ll .ac,4# 3*evel 0< online/o((line5 is availa.le<
and t!at yo4r o((line redo lo& (ile c!ain is .ac,ed 4# )it!o4t any &a#s.
3.2 Sim4late a !ead cras! .y deletin& t!e entire contents o( directory sa#data3
3s4.directories #rotdB1< sta.iB1< 4ser1iB15.
3.3 Re#air yo4r data.ase 4sin& t!e (4ll and incremental .ac,4#s yo4 #er(ormed
in :1ercises 1 and 2. 0se t!e SAP-/A (4nction 1artial rest#re and c#)!lete
rec#very.
=C> SAP AG BC505 :6
.15Back8, 7trate"ies (sin" '2A<: 7ol8tions
&o. "ol(tion
!
1.1 0sin& t!e $S editor< in (ile /oracle/@S"-A/d.s c!an&e t!e (ollo)in&
#arameters o( (ile init@S"-A.sa#?
.ac,4#Bmode O (4ll
.ac,4#BdevBty#e O dis,
dis,Bco#yBcmd O co#y
or dd or rman
1.2 Start SAP-/A. o &et to t!e .ac,4# men4< c!oose
h - &acku! database.
o start t!e .ac,4#< c!oose a - &acku! $uncti#n' (#r)al backu!. S#eci(y t!e
.ac,4# device ty#e .y c!oosin&
c - &acku! device ty!e' l#cal disk.
o de(ine )!ic! o.Kects are to .e .ac,ed 4# and )!ic! ,ind o( .ac,4# is to
.e #er(ormed< c!oose
d - *b+ects $#r backu!? $ull.
o de(ine t!e .ac,4# ty#e c!oose (or e1am#le
e - &acku! ty!e #nline.
0nder h - S!ecial #!ti#ns< c!oose
b - C#)!ress' n#
o start t!e .ac,4# r4n< c!oose
S - Start &R&AC/01.
1.3 !e /R/AC;0P lo&s are in s4.directory sa#.ac,4#.
cd /oracle/GS1D</sapbackup
!e detail lo& is named b3ti)e sta)!4.3e5t4< )it! 3e5t4 6 $nd si&ni(yin& $ull
#nline #n disk< and 3e5t46$$d si&ni(yin& $ull #$$line #n disk. 0sin& t!e time t!e
lo& )as created< select t!e a##ro#riate lo&< and vie) it .y enterin& 3(or
e1am#le5
more bGtime stamp<'Ge8t<
o vie) lo&s in SAP-/A< c!oose l - Sh#"/Cleanu!
a - Sh#" l#2 $iles / !r#$iles e - &R&AC/01 l#2 $iles.
!e (iles t!at !ave .een .ac,ed 4# are located in s4.directories o(
sa#.ac,4#. !e names o( t!ese s4.directories are identical to t!e
corres#ondin& names o( t!e detail lo&s 3)it!o4t e1tensions5.
1.4 Start t!e $racle server mana&er 4sin&? svrm&rl
-is#atc! t!e (ollo)in& commands in t!e order s!o)n .elo)?
connect internalM
alter system s)itc! lo&(ileM
alter system s)itc! lo&(ileM
alter system s)itc! lo&(ileM
e1itM
&e*t
,*tent
(ach tab0e and inde1 is assi,ned to a tab0espace! which consists of one or more data fi0es at the
operatin, system 0eve0. A00 tab0e and inde1 data is stored in the data fi0es of the tab0espace.
&rac0e stores tab0es and inde1es in individua0 data b0ocks. #n an 3.4 insta00ation! data b0ocks are H
JB in siNe. "hen new stora,e space is reIuired for a tab0e or inde1! one or more conti,uous data
b0ocks of a data fi0e are a00ocated to form an extent. #f there is not enou,h conti,uous freespace to
a00ocate a new e1tent! the &rac0e error messa,e &3A8:/54 =for a tab0e> or &3A8:/56 =for an inde1>
occurs.
&rac0e data obOects have severa0 stora,e parameters that inf0uence ,rowthG
'he first e1tent =initial extent> shou0d be 0ar,e enou,h for the e1pected tab0e or inde1 siNe. #f an
e1tent of a data obOect becomes fu00 durin, an insert or update operation! the &rac0e stora,e
mana,ement system attempts to a00ocate another e1tent in the tab0espace.
An obOect can a00ocate e1tents up to the 0imit MA)()'($'S. #f the ma1imum number of e1tents
for each obOect is reached! the error messa,e &3A8:/4: =for a tab0e> or &3A8:/4- =for an inde1>
is disp0ayed. #f this occurs! you must increase the parameter MA)()'($'S and check the siNe of
the tab0eQs $()' parameter.
PC'73(! PC'9S(%! and PC'#$C3(AS( are three additiona0 stora,e parameters. &n0y chan,e
them under specia0 circumstances and after consu0tin, SAP for support.
=C> SAP AG BC505 4
10.4
SAP AG 1999
. . .
0 0 ! ! 3 3 4 4 5 5
ObCects 6tables/inde*es:
+ablespace
GtablespaceH.data!
3
! 0
3
0
0
!
0
4
!
4
5
Ga#s
Oracle bloc0 8nternal
'ragmentation
7sed
Jree
3 5
! 4
,*ternal
'ragmentation
!
DataE!
0
!
0
Reorgani?ation= Basics
'o e0iminate stora,e8re0ated prob0ems! perform a reor,aniNation. 'he obOects that can be reor,aniNed
inc0ude tab0es! inde1es! and data fi0es of the database.
After a tab0e or inde1 is reor,aniNed! b0ock usa,e for the reor,aniNed obOect is optima0. (1tents can
be mer,ed to,ether to reduce the number of e1tents present in the database. Stora,e space reIuired
for the obOect can a0so be minimiNed.
"hen data fi0es of a tab0espace are reor,aniNed! some data fi0es are mer,ed to,ether. 'his means
the number of data fi0es present in the database can be minimiNed.
'o perform a reor,aniNation! additiona0 stora,e space is reIuired to store intermediate data. 'his
stora,e space is either reIuired in the database or in directories created for this purpose. #ntermediate
data can a0so be stored on tape. SAP%BA tries to forecast the amount of additiona0 stora,e space
reIuired. "hen a reor,aniNation is performed! bott0enecks can occur in the fo00owin, areasG
'he data fi0es of the tab0espace where the reor,aniNed obOect resides. 'ypica0 errorG $o data fi0e
has enou,h freespace to ho0d the new 0ar,er e1tents or a temporary second copy of the obOect.
'he directory sapreor2. 'ypica0 errorG 'his directory is too sma00 to ho0d the e1port sets
'he tab0espace PSAP'(MP. 'ypica0 errorG 'his tab0espace is too sma00 for an inde1 recreation
#f an error occurs durin, a reor,aniNation! data can be 0ost. #f a va0id and up8to8date data backup
e1ists! the risk of data 0oss is minimiNed. After the data fi0es of a tab0espace have been reor,aniNed
successfu00y! you must immediate0y perform a backup.
=C> SAP AG BC505 :4
10.14
SAP AG 1999
Dis0E4
! 0
3
0
!
0
4
5
3
! 0
3
0
!
0
4
5
3
Dis0E3
! 0
3
0
!
0
4
5
3
! 0
3
0
!
0
4
5
3
Dis0E
! 0
3
0
!
0
4
5
3
! 0
3
0
!
0
4
5
3
Dis0E!
! 0
3
0
!
0
4
5
3
! 0
3
0
!
0
4
5
3
Dis0
Yhot spotsY
D
i
s
0
a
c
c
e
s
s
e
s
N
P
O
Dis0
Reorgani?ation= Reasons
De&ai( (.- 9909050715.a(y
CD"RTS !F 20 EMPTB 15DEXES - @S15; V"?1D"TE STR@CT@RE
86751 i*+e,e3 a*a(y7e+. 3.%&e+ )y em6&y 36a'e /i&0i* BTREE
E @SED$BB$BTREE - @SED:
T"B?ESP"CE$5"ME 15DEX$5"ME T!T"?8C): @SED$BB$BTREE8C): @SED8C):
PS"PP!!?1 "T"B>0 72720 72648 20563
PS"PP!!?1 T512T>0 7280 7200 4641
PS"PP!!?1 RTXT?>0 11920 10072 7745
PS"PP!!?1 T800B>0 8800 8744 6726
PS"PP!!?1 T52C5>0 5480 5424 3760
PS"PP!!?1 @S!BX$C>0 4160 4032 2627
"A#DBA Detail 4og
Jragmented
8nde*es
. . .
0 0 ! ! 3 3 4 4 5 5
Oracle
bloc0
8nternal
'ragmentation
Jree
7sed
3eor,aniNin, physica0 data obOects is cost0y! both in terms of time and resources! and shou0d be
performed on0y in e1ceptiona0 cases. 'o minimiNe the need for reor,aniNations! monitor the database
re,u0ar0y.
'he 3.4 System is not avai0ab0e durin, a reor,aniNation. 'herefore! reor,aniNe physica0 data obOects
for the fo00owin, reasons on0yG
%isk hot spotsG 9nfavorab0e physica0 distribution of tab0es! inde1es! or data fi0es resu0ts in non8
uniform distribution of disk accesses on avai0ab0e disks
;eavi0y fra,mented inde1esG 7ra,mented inde1es can affect performance. 7ra,mented tab0es wi00
on0y affect performance in specia0 cases =check for SAP $otes indicatin, this prob0em>.
'o avoid havin, to perform reor,aniNationsG
3un sapdba 1next week0y to adapt the stora,e parameters of a00 tab0es and inde1es. 'his prevents
database obOects from a00ocatin, a hi,h number of e1tents. #f a tab0e has a hi,h number of e1tents!
chan,e the parameters $()' and MA)()'($'S. %o not perform a reor,aniNation.
'ry to estimate ,rowth of a critica0 tab0espace before e1tendin, it with a data fi0e of an appropriate
siNe. 9se SAP archivin, to archive obso0ete data. 'his prevents the number of fi0es in your
database system from approachin, the 0imit %BE7#*(S. #f there is a hi,h number of data fi0es! try
to increase the parameters MA)%A'A7#*(S =number of fi0es your &S can hand0e> and
%BE7#*(S. %o not reor,aniNe a tab0espace.
=C> SAP AG BC505 :6
10.15
SAP AG 1999
-o%ing / Renaming data 'iles
Dis0 *
! 0
3
0
!
0
4
5
3
! 4
0
Dis0 y
! 0
3
0
!
0
4
5
3
! 4
0
Reorgani?ation o' a tablespace
Data 'ileE!
! 0
3
0
!
0
4
5
3
Data 'ileE
5 6
@ ;
!
5
4
!0
6
!!
5
Data 'ileE
0
Data 'ileE!
0
0
0
Reorgani?ation o' a tablespace )ith data 'iles
Data 'ileE!
Data 'ileE
! 0
3
0
!
0
4 5
5 6
@ ;
!
5
4
!0 !!
Data 'ileEne)
0
0
0 0
0
Reorgani?ation o' a single
obCect or a list o' obCects
#hases Directories
OCreate script and restart 'ile sapreorg/GtimestampH/GtimestampH.Ge*tensionH.
Chec0 the 'ree space sapreorgD #"A#+,-#.
O#er'orm a reorgani?ation #"A#RO44D obCects tablespace
#hases Directories
OCreate script and restart 'ile sapreorg/GtimestampH/GtimestampH.Ge*tensionH.
Chec0 the 'ree space sapreorgD #"A#+,-#.
O#er'orm a reorgani?ation #"A#RO44D obCects tablespace
Data 'ileE!
0 0
!
!
Data 'ileE!
0
0
!
Dis0 Yhot spotsY
Jragmented inde*es
8nternal 'ragmentation
8nternal and e*ternal 'ragmentation
Jragmented inde*es
Dis0 Yhot spotsY
Reorgani?ation= #hases and +ypes
SAP%BA reor,aniNations are performed in two phasesG
#n phase one! the S+* script for the reor,aniNation process is created in the subdirectory
<timestamp> of the workin, directory. 'he fi0e restart$<extension> is created in this subdirectory
to enab0e a restart of the reor,aniNation =first e0iminate the cause of the error>. 3eversib0e actions
can be reset. SAP%BA checks if there is enou,h stora,e space avai0ab0e to perform the
reor,aniNation.
#n phase two! the reor,aniNation script is e1ecuted. =Action 0o, nameG <timestamp>$<extension>>
Reor2ani8ation of a sin2le obEect =tab0e or inde1>G 9se this function to e0iminate interna0
fra,mentation! to reduce the number of e1tents a00ocated for a tab0e or inde1! and to move a tab0e or
inde1 to another tab0espace in order to e0iminate a disk hot spot =e1tension rsi>
Reor2ani8ation of a list of obEectsG 9se this function to reor,aniNe a ,roup of severa0 obOects. An
ASC## fi0e must be created in the workin, directory with the reIuired 0ist of obOects. =e1tension rli>
Reor2ani8ation of a tablespaceG 9se this function to reor,aniNe a00 obOects be0on,in, to this
tab0espace. 'he directory and fi0e structure of the tab0espace wi00 remain unchan,ed. =e1tension rtc>
Reor2ani8ation of a tablespace with data filesG 9se this function to chan,e the data fi0e structure and
to reor,aniNe the obOects contained in the tab0espace. 'he number of data fi0es e1istin, in the
database can be minimiNed. =e1tension rtd>
,o"in2 and renamin2 data filesG 9se this function to move fi0es to another disk. 'his is not
c0assified as a reor,aniNation because the action is performed on fi0e 0eve0 =e1tension rm">.
=C> SAP AG BC505 :5
10.16
SAP AG 1999
4egend=
SS F %ery goodD S F goodD o F a%erageD &A F &ot applicable
8 F #arallel on inde*D + F #arallel on table. 6Oracle #ARA44,4 cla(se:
# F #arallel on process le%el 6"A#DBA creates se%eral processes:
Reor&aniGation o( ta.les
%et!od R4ntime Sec4rity Additional s#ace R3C!o# Parallel Com#ress Restrictions
Create ta.le QQ QQ $.Kects ta.les#ace 7A 7A 7o ta.les )it!
as select PSAPR$** *$7G/RA+ (ields
SAP-/A 4nload. Q Q sa#reor& 7$ P 7$ e1#ort @ ma1B(ileBsiGe
S2*Rloader PSAP:%P 34s4ally 2 G.yte5
$racle o Q sa#reor& C:S P C:S
e1#ort/im#ort PSAP:%P
Reorgani?ation o' inde*es
-ethod R4ntime Sec4rity Additional s#ace Parallel
Alter inde* QQ QQ $.Kects ta.les#ace "
reb(ild PSAP:%P
8nde* Q Q PSAP:%P "
recreate
Reorgani?ation= -ethods
'here are two methods to e1port and import tab0e data. #n both cases! because tab0es are dropped
before they are recreated! data may be 0ost G
export . import uses &rac0e ()P&3' and #MP&3' commands. Additiona0 stora,e space for the
e1port dump is reIuired in directory sapreor2 and in PSAP'(MP =inde1 recreation>.
SAPD)A unload . load uses either the too0 SAP%BA *&A% or the &rac0e S+*X0oader. Additiona0
stora,e space for the *&A% fi0e is reIuired in directory sapreor2 and in PSAP'(MP =inde1
recreation>.
'he fo00owin, methods do not reIuire the e1port and import of database dataG
0reate table $$$ as selectG SAP%BA first ,enerates the tab0e to be reor,aniNed with the new
parameters under a new name =by addin, the character Y>. 'he data is copied direct0y from the o0d
tab0e to the new. 'he o0d tab0e is dropped and the new tab0e is renamed. 'his option cannot be
used for tab0es with *&$G co0umns or for reor,aniNin, tab0espaces with data fi0es. Additiona0
stora,e space is reIuired as the tab0e temporari0y e1ists twice in the same tab0espace. (nou,h
space must be avai0ab0e in PSAP3&** to ho0d ro00back information.
Alter index . RebuildG 'he inde1 is first rebui0t in tab0espace PSAP'(MP usin, the e1istin, inde1.
'hen it is copied into the correspondin, tab0espace. 'he o0d inde1 is dropped and the optimiNed
inde1 is activated. 'ab0e and inde1 are 0ocked durin, this process. Additiona00y reIuired stora,e
space can be up to twice the siNe of the inde1.
Recreate indexG 'he inde1 is dropped and recreated. Stora,e space is reIuired in PSAP'(MP.
=C> SAP AG BC505 :/
10.17
SAP AG 1999
Compress extents;
<es &o
0
0 !
!
0
0
3
! 4
0 ! 3 4
,ed#ce ob?ect si)e;
<es &o
0
0 !
!
0
0
3
! 4
0
Jreespace
Chop (export d#mp8;
<es &o
sapreorg
$B $B
sapreorg
4 $B
Compress (export d#mp8;
<es &o
sapreorg
! $B
$B
sapreorg
$B
$B
Parallel export & import
6,*ample= processes in parallel:
e*pEimpEdegree F
sapreorg!
d(mp!
sapreorg
d(mp
Database
#rocess !
#rocess
Both conditions reB(ired=
e*pEimpEdegree F
and
d(mp destinations
#ossibleQ #ossibleQ
Reorgani?ation= Options
'o define a reor,aniNation! you can specify the fo00owin, optionsG
0ompress extents D Hes. SAP%BA mer,es the e1tents occupied by the tab0e or inde1 to one
e1tent. #f this option is not used! the e1tents are a00ocated usin, the current stora,e parameters of
the obOect. AdOacent free stora,e fra,ments in the entire tab0espace are mer,ed.
Reduce obEect si8e D Hes. SAP%BA automatica00y tries to reduce the siNe of the obOects =a00ocated
stora,e space> durin, the reor,aniNation for an e1port or import. 'o determine the actua0 stora,e
space occupied! SAP%BA uses the &rac0e A$A*LW( command. Script ,eneration reIuires a
specific amount of time and 0ocks the tab0es to be reor,aniNed.
0hop D Hes. SAP%BA sends the e1ported data to the chop too0 throu,h a named pipe. 'he chop
too0 then sp0its the e1port data into severa0 fi0es. 'his option is on0y avai0ab0e if parameter
chop_util_name is entered in the profi0e init?S#%@.dba. 'his option is not avai0ab0e for "indows
$'. #f the e1port dump fi0es are 0ar,er than the ma1imum fi0e siNe =usua00y - GB> for the operatin,
system! use this option.
0ompress D Hes. 'he e1port dump is compressed usin, &S faci0ities =not for dump to tape>.
Parallel export.importG 'he e1port and the import are distributed to severa0 para00e0 processes. 'he
init?S#%@.sap parameter exp_imp_de2ree determines the ma1imum number of processes that are
created for the reor,aniNation. 'he number of directories and.or tape devices specified for the
e1port dump fi0es a0so 0imits the number of processes created.
racle PARA>>9> clauseG 'he reor,aniNation is acce0erated with the he0p of the &rac0e
PA3A**(* +9(3L functiona0ity.
=C> SAP AG BC505 :P
10.1
SAP AG 1999
7nit "(mmary
&o) yo( are able to=
,*plain the concepts o' Oracle storage management
&ame the problems o' data storage
-onitor and a%oid problem sit(ations
"ol%e storage related problems e''iciently
#n an &rac0e database! the way physica0 hard disk space is a00ocated for a tab0e or inde1 is contro00ed
by the obOects stora,e parameters. Stora,e parameters that are set incorrect0y can 0ead to unwanted
,rowth behavior.
'he fo00owin, 3.4 System too0s provide you with an effective means of preventative monitorin,! and
shou0d be used to avoid uncontro00ed database ,rowthG
'he SAP%BA checks the database for possib0e stora,e re0ated prob0ems
Lou can e1tend the database usin, the SAP%BA
'he SAP%BA adapts stora,e parameters of ,rowin, obOects to optimiNe ,rowth behavior
'he SAP%BA provides comprehensive support for the reor,aniNation of &rac0e database obOects
Lou can monitor the current status of the database usin, the CCMS %atabase Monitors =D)'*#
S&'(# D)*(>.
Lou can 0imit ,rowth of the database by archivin, obso0ete data. 3.4 provides you with the reIuired
archivin, functiona0ity.
=C> SAP AG BC505 :H
10.1!
SAP AG 1999
,*ercises
Q
"ol(tions
7nit Actions
=C> SAP AG BC505 :5
10.207tora"e 2ana"ement: )6ercises
&o. ,*ercise
! 7se sBlpl(s to r(n the script createtab.sBlD )hich is located in directory
scripts=
4og on as (ser oraG"8DH. 8' the database is not openD open it (sing
"A#DBA. ")itch to directory scripts. "tart sBlpl(s. 4og on to the
database as (ser "A#R3 )ith pass)ord "A#. "tart the script
createtab.sBl by entering the sBlpl(s command line Zcreatetab.sBl
R(n sapdba Rchec0 on yo(r database.
2.1 C!ec, t!e lo& (ile o( sa#d.a Sc!ec, (or messa&es re&ardin& ta.le
/C'0'C=:C; and inde1 /C'0'C=:C;T0.
3 Adapt the storage parameters o' table BC505CI,C/ (sing "A#DBA.
,ns(re that the ne) -A9,9+,&+" %al(e is larger than n(mber o'
e*tents c(rrently allocated S 30P. Do not (se the "A#DBA
recommendation 'or &,9+D b(t set it bac0 to the c(rrent %al(e.
3.1 R4n sa#d.a Sc!ec, a&ain. :1#lain t!e di((erence in t!e lo& (iles o( t!e
sa#d.a Sc!ec, r4ns .e(ore and a(ter yo4 ada#ted %A9:9:7S o( ta.le
/C'0'C=:C;.
4 7se "A#DBA to a(tomatically adapt the &,9+ e*tent si?es 'or all "A#
tablespaces.
4.1 C!ec, (or #ro.lems in t!e sa#d.a Sne1t lo&.
4.2 R4n sa#d.a Sc!ec, a&ain and c!ec, (or #ro.lems related to ta.le
/C'0'C=:C; in t!e lo& (ile. +!y s!o4ld yo4 al)ays r4n sa#d.a Sc!ec,
a(ter a sa#d.a Sne1tH
5 "ol%e the problems 'o(nd 'or tablespace #"A#7",R!D by adding a
ne) data 'ile 6! -B in si?e:.
'.1 Solve t!e #ro.lems (o4nd (or ta.les#ace PSAP0S:R1" .y addin& a ne) data
(ile 3200 ;/ in siGe5.
'.2 Restart sa#d.a Sc!ec, and c!ec, (or #ro.lems in t!e sa#d.a Sc!ec, lo&.
:1#lain )!at !a##ened to t!e entries (or ta.le /C'0'C=:C; and inde1
/C'0'C=:C;T0.
6 2hy is it important to r(n a bac0(p a'ter yo( ha%e changed the 'ile
str(ct(reQ
5 Chec0 'or internal 'ragmentation o' tablespace #"A#7",R!D
8.1 0sin& Uestimate sam#le 10 #ercentV
8.2 0sin& Ucom#4te statistics / validate str4ct4reV
8.3 C!ec, t!e lo& (iles o( t!e analyGe actions. +!at is t!e di((erence .et)een
.ot! met!odsH
@ Reorgani?e the inde* tablespace #"A#7",R!8 (sing Alter 8nde*
Reb(ildD the storage options compress e*tent and red(ce obCect si?eD
and hide the table d(ring reorgani?ation.
>.1 C!ec, t!e lo& (ile o( t!e reor&aniGation.
=C> SAP AG BC505 -0
; Reorgani?e tablespace #"A#7",R!D incl(ding the data 'ilesD (sing the
"A#DBA (nloader / ORAC4, "34.loaderD )ith option red(ce obCect
si?eD red(ce data 'ile si?e 6accept the de'a(lt:.
9.1 C!ec, t!e lo& (ile o( t!e reor&aniGation.
!0 Optional= Reorgani?e tablespace #"A#7",R!D incl(ding the data 'iles
(sing the Oracle e*port/importD red(ce obCect si?e and hide table d(ring
reorgani?ation.
10.1 C!ec, t!e lo& (ile o( t!e reor&aniGation.
!! Optional= R(n script extent.s@l 'rom "34.#l(s to create an e*tent
problem in tablespace #"A#7",R!D. &o) e*ec(te the script
extent3r#n.s@l. Analy?e the error message.
11.1 Correct t!e error and try to s4ccess(4lly com#lete t!e scri#t e5tent>run.sAl.
! Optional= R(n script ts3oer.s@l 'rom "34.#l(s. Analy?e the error
message.
12.1 Solve t!e #ro.lem.
=C> SAP AG BC505 -:
10.217tora"e 2ana"ement: 7ol8tions
&o. "ol(tion
!
As (ser ora*SID+D iss(e command sapdba Kcheck.
2.1 A(ter SAP-/A !as (inis!ed< s)itc! to directory sa!check and loo, (or t!e (ile
3ti)esta)!4.chk. :dit t!e (ile 34sin& command more Gcheck file
name<< and 4se t!e s#ace.ar to &o to t!e ne1t #a&e5. !e (ollo)in&
messa&es are dis#layed?
S:G%:7B%A7CB:9:7S ? /C'0'C=:C;
A/*:SPAC:BD0** ? PSAP0S:R1"
3!is #ro.lem )ill .e solved later.5
3 "tart "A#DBAD and choose= d 2 ,eor!ani)ation b - Alter&sho% table
or index stora!e parameters b - specif$ table name BCA/AC-5C4
s - Alter&sho% parameters b - <5BTD enter c(rrent %al(e d 2
MAB5BT5<TSD enter ne) %al(e s 2 commit.
3.1 A(ter SAP-/A !as (inis!ed< s)itc! to directory sa!check and loo, (or t!e (ile
3ti)esta)!4.chk. :dit t!e (ile 34sin& command more Gcheck file
name<5. !e (ollo)in& messa&e s!o4ld no lon&er .e dis#layed?
S:G%:7B%A7CB:9:7S ? /C'0'C=:C;
4 R(n sapdba Kne8t "S!"M. +hen r(n sapdba Kcheck again.
4.1 A(ter SAP-/A !as (inis!ed< s)itc! to directory sa!check and loo, (or t!e (ile
3ti)esta)!4.n5t. 7:9 (or /C'0'C=:C; !as .een c!an&ed .y sa#d.a S
ne1t.
4.2 /C'0'C=:C; is no) re#orted as a critical o.Kect .eca4se PSAP0S:R1- is
too small to !old a 7:9 e1tent o( t!is ta.le. As sa#d.a Sne1t can increase
t!e 7:9 siGe o( ta.les or inde1es< t!e lar&er 7:9 e1tents may not (it into
t!e ta.les#ace anymore. R4n sapdba Kcheck to detect t!ese #ro.lems.
5 "tart "A#ADBA and choose= c - Tablespace administration a 2
TablespaceD enter "S!"S*R/D f 2 Alter tablespace PSAP"S5,.D
add data file c 2 <e% si)eD enter /3 s 2 Start.
<o( can s0ip the bac0(p action recommended by "A#DBA.
'.1 Start SAPA-/A and c!oose c - Tables!ace ad)inistrati#n a -
Tables!ace< enter "S!"S*R/1 $ - Alter tables!ace 1SA10S=R7I add
data $ile c S (e" size< enter 6--@B s - Start
Co4 can s,i# t!e .ac,4# action recommended .y SAP-/A
'.2 As PSAP0S:R1-/PSAP0S:R1" are no) lar&e eno4&! to !old a 7:9
e1tent o( /C'0'C=:C;/ /C'0'C=:C;T0< t!e critical o.Kect entries are no
lon&er dis#layed.
6 <o( sho(ld al)ays sa%e the e*tended tablespace and the ne) %ersion
o' the control 'ile a'ter the e*tension so that the complete reco%ery
'(nctionality o' the "A#DBA is a%ailable 6partial restore and complete
reco%ery:. +o do thisD yo( can (seD 'or e*ampleD the "A# tool
BRBAC/7#. Jor this reasonD a'ter a tablespace e*tensionD "A#DBA
=C> SAP AG BC505 --
a(tomatically branches to the bac0(p database men( to enable yo( to
start the appropriate bac0(p immediately.
5
8.1 R4n command sapdba Kanaly7e "S!"S*R/D -method * Koption
"/-
8.2 R4n command sapdba Kanaly7e "S!"S*R/D -method C1
8.3 *o& (iles are )ritten in directory sa#c!ec,.
!e lo& (ile name o( an analyGe action is @timestam#A.aly.
Dor t!e estimate met!od< em#ty and neverB.eenB4sed al)ays !ave t!e
same val4e.
Dor t!e com#4te statistics/validate str4ct4re met!od< t!e val4es (or em#ty
and neverB.eenB4sed di((er< as t!is met!od is more acc4rate.
@ "tart "A#DBA and choose d 2 ,eor!ani)ation e 2 ,eor!ani)e
tablespace a 2 TablespaceD and enter "S!"S*R/1. +hen choose ! 2
Stora!e parameters d 2 ,ed#ce ob?ect si)e @ 2 ret#rn @ 2 ret#rn
h - 9b?ect handlin! a 2 -ide tables d#rin! reor! c 2 ,eb#ild
indexes @ 2 ret#rn s 2 Start.
A'ter generating a scriptD start the script immediately (sing option !.
>.1 C!ec, t!e (ile 3ti)esta)!4.rtc in directory sa!re#r2.
; "tart "A#DBA and choose d 2 ,eor!ani)ation f 2 ,eor!ani)e
tablespace and data files a 2 TablespaceD and enter "S!"S*R/D.
+hen choose f 2 9,ACC5 exp&imp. +hen choose b to toggle to "nload &
load @ 2 ret#rn ! 2 Stora!e parameters d 2 ,ed#ce ob?ect si)e
@ 2 ret#rn h 2 9b?ect handlin! d 2 ,ed#ce data file si)e 6(se
!0P de'a(lt: @ 2 ret#rn s 2 Start.
A'ter generating a scriptD start the script immediately (sing option !.
9.1 C!ec, t!e (ile 3ti)esta)!4.rtd in directory sa!re#r2.
!0 "tart "A#DBA and choose d 2 ,eor!ani)ation f 2 ,eor!ani)e
tablespace and data files a 2 TablespaceD and enter "S!"S*R/D.
+hen choose ! - Stora!e parameters d 2 ,ed#ce ob?ect si)e @ 2
ret#rn @ 2 ret#rn h - 9b?ect handlin! a 2 -ide tables d#rin!
reor! @ 2 ret#rn s 2 Start.
A'ter generating a scriptD start the script immediately (sing option !.
10.1 C!ec, t!e (ile 3ti)esta)!4.rtc in directory sa!re#r2.
!! Change to directory &*9,ACC53-9M5+&scriptsD start "34#47"D log on
as (ser SAP,:D and r(n Ze*tent.sBl. &o) e*ec(te the script
e*tentEr(n.sBl. A -A9,9+,&+ problem is displayed 'or table
BC505CI,C/.
11.1 "ncrease #arameter %A9:9:7S (or ta.le /C'0'C=:C; 3see e1ercise 35.
! Change to directory &*9,ACC53-9M5+&scriptsD start "34#47"D log on
as (ser SAP,:D and r(n Zts3oer.s@l. &o) e*ec(te the script
tsEo%erEr(n.sBl. A tablespace o%er'lo) )ill be displayed 'or tablespace
#"A#7",R!D.
=C> SAP AG BC505 -4
12.1 Add a data (ile to ta.les#ace PSAP0S:R1- 3see e1ercise '5.
=C> SAP AG BC505 -6
11
SAP AG 1999
#er'ormance -onitoring
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
11.2
SAP AG 1999
#er'ormance -onitoring
Contents
CostAbased optimi?er
-emory con'ig(ration
Application design
#hysical and logical layo(t
ObCecti%es
At t!e end o( t!is 4nit< yo4 )ill .e a.le to?
8denti'y per'ormance problems
Re'resh the statistics (sed by the costAbased optimi?er
"hen you have comp0eted this unit! you wi00 be ab0e toG
#dentify performance prob0ems by monitorin, theG
Cost8based optimiNer
Memory confi,uration
App0ication desi,n
Physica0 and 0o,ica0 0ayout
3efresh the statistics used by the cost8based optimiNer
=C> SAP AG BC505 -
11.3
SAP AG 1999
#er'ormance iss(es
#er'ormance iss(es
CostAbased optimi?er
CostAbased optimi?er
-emory con'ig(ration
-emory con'ig(ration
Application design
Application design
#hysical and logical layo(t
Database Related #er'ormance 8ss(es
Poor database performance can resu0t from prob0ems with the cost8based optimiNer! database
memory confi,uration! app0ication desi,n! or the physica0 and 0o,ica0 0ayout.
'his unit focuses on how to use 3.4 to monitor and identify these performance prob0ems.
=C> SAP AG BC505 4
11.4
SAP AG 1999
CostAbased optimi?er
CostAbased optimi?er
-odi'ying the
standard
proced(re
-odi'ying the
standard
proced(re
Re'reshing the
obCect statistics
Re'reshing the
obCect statistics
Reasons 'or
per'ormance
problems
Reasons 'or
per'ormance
problems
CostABased Optimi?er
'he fo00owin, section describesG
"hat cost8based optimiNation means
;ow to check for performance prob0ems ori,inatin, from the cost8based optimiNer environment
;ow to refresh the statistics used by the cost8based optimiNer
;ow to modify the standard procedure used for refreshin, the optimiNer statistics
=C> SAP AG BC505 6
11.5
SAP AG 1999
O#+8-8L,R O#+8-8L,R
2hich is the optimal access pathQ 2hich is the optimal access pathQ
Database
table
ADDR
8nde* A
J(ll
table
scan
8nde* B
",4,C+ . JRO- ADDR ",4,C+ . JRO- ADDR
2I,R, name F [miller[ 2I,R, name F [miller[
A&D A&D pn(m pn(m F !3 F !3
A&D city F [Io(ston[ A&D city F [Io(ston[
initG"8DH.ora
O#+8-8L,RE-OD, F choose
KK KK
KKK KKK
KKKK KKKK
#ossible access paths #ossible access paths
Costs Costs
Oracle CostABased Optimi?er= Re%ie)
'he cost8based optimiNer determines the most effective strate,y for retrievin, database data. 'he
access strate,y used depends on the information in theG
+ueried tab0e =or tab0es! for a view or Ooin>
7ie0ds specified in the ";(3( c0ause of the S+* statement
#nde1es defined for the tab0es Iueried
'he cost8based optimiNer computes the cost of severa0 strate,ies for accessin, the tab0es! and
chooses the one that reIuires the sma00est amount of data accesses. 'o ca0cu0ate the cost of a
strate,y! the optimiNer reIuires statistica0 information about the tab0es and inde1es of the database!
such asG
$umber of tab0e or inde1 rows and number of b0ocks a00ocated for the obOect
$umber of distinct va0ues in each co0umn of the tab0e
'he statistica0 information for a tab0e or inde1 is stored in the %ata %ictionary of the database. 'o
co00ect the statistica0 information! use the &rac0e S+* command analy7e table.
=C> SAP AG BC505 5
11.6
SAP AG 1999
"<"+,-
"tatistic
in'ormation
Old statistic in'ormation
&o precise statistic
in'ormation
8ncorrect ass(mptions
&ot (sing "A#Atools to
re'resh the statistics
CostABased Optimi?er #er'ormance #roblems
Performance prob0ems can occur if the cost8based optimiNer usesG
&0d or non8e1istent statistic information
$o precise statistic information
#ncorrect assumptions! such as uniform0y distributed data within the obOect
Lou can so0ve performance prob0ems re,ardin, o0d! non8e1istent! or no precise statistic information
byG
3efreshin, the obOect statistics by usin, the SAP two8phase strate,y
#ncreasin, the precision by modifyin, the SAP standard procedure
Lou can so0ve performance prob0ems re,ardin, incorrect optimiNer assumptions byG
9sin, optimiNer hints or histo,rams =as of 3.4 3e0ease 6.5A>. See SAP $otes :-54H5 and :406H0
9sin, the ru0e8based optimiNer access for some tab0es by modifyin, the SAP standard procedure
Chan,in, the app0ication access to the data
Performance prob0ems can a0so occur if SAP too0s =SAP%BA or CCMS> are not used to refresh the
obOect statistics. Statistic updates performed by non8SAP too0s can create severe performance
prob0ems if the precision of the update is not set correct0y.
=C> SAP AG BC505 /
11.7
SAP AG 1999
#hase !
SAP-/A determines )!ic! o.Kects in t!e
data.ase need re(res!in&
ObCect needs to be re'reshed i'=
+he n(mber o' ro)s in the table
'rom last the chec0
di''er 'rom
+he act(al n(mber o' ro)s
in the table
by more than the threshold
2able * "/- 8
Control table
6DB"+A+C:
$.Kect name
$#tion
7e) statistics
needed
%et!od
Re'reshing the ObCect "tatistics= #hase !
'o minimiNe the time and system overhead necessary to refresh the cost8based optimiNer statistics!
SAP provides the fo00owin, two8phase strate,yG
Phase :G SAP%BA determines which database obOects need refreshin,
Phase -G SAP%BA refreshes on0y the obOects determined in phase :
'he contro0 tab0e %BS'A'C stores information about the obOects that need to be refreshed. %urin,
phase :! SAP%BA determines which obOects need to be refreshed by the fo00owin, ru0eG
#f the number of rows in a tab0e found durin, the 0ast check differs from the actua0 number of rows
by more than a specific thresho0d number! then the obOect needs to be refreshed. By defau0t! the
thresho0d number is :0F for sma00 tab0es and :00F for 0ar,e tab0es.
3ows for obOects in the contro0 tab0e %BS'A'C that need to be refreshed are either updated or new
rows are created! then they are f0a,,ed as 3ew statistics needed.
'he four important co0umns in contro0 tab0e %BS'A'C for phase : areG
bEect nameG 'he name of the obOect that needs to be refreshed
,ethodG 'he method used to ana0yNe the obOect. (ither C =compute> or ( =estimate>. %efau0t va0ueG
9 =estimate>
ptionG Percenta,e =P?n@> or number of rows =3?n =X :000>@> to be ana0yNed if method (
=estimate> is chosen. %efau0t va0ueG 7' percent.
3ew statistics neededG A f0a, that indicates that the statistics need to be refreshed
=C> SAP AG BC505 P
11.
SAP AG 1999
"A#BDA
Reads entries in the control table
6DB"+A+C:
Chec0s the 'lag 'or ne) statistics
needed
#hase
SAP-/A re(res!es t!e o.Kects
7n'lagged
Control table
6DB"+A+C:
2able * "/- 8
$.Kect name
$#tion
7e) statistics
needed
%et!od
Re'reshing the ObCect "tatistics= #hase
&n0y the statistics of tab0es that are f0a,,ed with new statistics needed in the contro0 tab0e
%BS'A'C are refreshed durin, phase -.
After the statistics are refreshed! the row remains in the contro0 tab0e %BS'A'C! but the co0umn
3ew statistics needed is unf0a,,ed.
'he SAP standard procedure does not create statistics for poo0 and c0uster tab0es and de0etes any
statistics that a0ready e1ist. 'his ensures that the ru0e8based optimiNer access is used for poo0 and
c0uster tab0es. #f the &rac0e parameter optimi8er_mode is set to 0hoose and no statistics e1ist for any
database obOect part of an S+* statement! &rac0e chooses the ru0e8based optimiNer access instead of
the cost8based optimiNer access.
=C> SAP AG BC505 H
11.!
SAP AG 1999
Control table DB"+A+C
DB obCect +ODO 'lag W
A7J/ * W
,/#O W
/&1/ * W
48#" W
-/#J W
1B7/ * W
R,"B * W
"A# +)oA#hase "trategy
sapdba
Aanaly?e DB"+A+CO
"A#DBA A *
+he statistics 'or the
database obCects that are
mar0ed in table
DB"+A+C are (pdated
#IA",
sapdba
Achec0opt #"A#P
"A#DBA A *
Database obCects reB(iring an
(pdate o' optimi?er statistics
are determined and mar0ed in
table DB"+A+C
#IA", !
sapdba
Astatistics all
"A#DBA A *
,*ec(te both phases in
one stepD
once a )ee0
A4+,R&A+81,4<
&n0y up8to8date statistica0 information can ensure that the &rac0e cost8based optimiNer chooses the
optima0 access path. ;owever! ,atherin, optimiNer statistics is e1pensive and reduces system
performance.
"e recommend the fo00owin, two8phase strate,yG
#n the first phase! the SAP too0s determine which tab0es reIuire a statistica0 update. 'he command
sapdba 1chec/opt PSAPJ determines which database obOects contain obso0ete statistics! and
modifies the contro0 tab0e %BS'A'C accordin,0y.
#n the second phase! the statistics of the tab0es marked '&%& in the contro0 tab0e %BS'A'C are
refreshed usin, command sapdba 1analy8e D)S&A&0$
As of 3.4 3e0ease 6./B! you can use the command sapdba 1statistics$ 'his command runs both of the
phases in ,arallel. 'hat is! you do not have to schedu0e the second phase separate0y. Lou shou0d
schedu0e command sapdba 1statistics to be run once a week! durin, periods of 0ow system activity.
=C> SAP AG BC505 5
11.10
SAP AG 1999
-odi'ying the "tandard #roced(re
...
7e) :ntries? -etails o( Created :ntries
$.Kect in(ormation
-/ o.Kect BC.-.2S
-/ o.Kect ty#e -/
$)ner
-ata.ase
-e(a4lt settin&s
0se - Analysis met!od
Analysis o#tion
Active !
-ate c!an&ed
$-$ settin&s
$-$ (la& 8 C4stomer -
$-$ date
a.le vie) :dit Goto Selection criteria 0tilities System =el#
!ct Short te8t
! !ctive =generating statistics?
1 1gnore
" "ositive =active with priority?
Forced =statistics are constantly updated?
R Restrictive =only active for the appl' tab' monitor?
Control (la& (or analysis
X
*
"4-
=istory C4stomer
Analysis
'o modify the standard procedure used for refreshin, the optimiNer statistics! use the CB& Contro0
Pane0 =transaction D)*7>.
'here are two ways you can modify the standard procedureG
#ncrease the precision of the statistics for a sin,0e tab0e =inc0udin, the inde1>
%e0ete statistics for a sin,0e tab0e =inc0udin, the inde1>
'o increase the precision! you must enter the name of the D) obEect! the D) obEect type ='7 for a
tab0e>! the &ype of usa2e = for optimiNer>! Acti"e =A for active or P for active with priority>! the
Analysis method =9 for estimate! 0 for compute! 96 for estimate with histo,rams or 06 for compute
with histo,rams>! and the ption =percenta,e =P?n@> or number of rows =3?n =X :000>@> to be
ana0yNed if method estimate is chosen>.
7or every customer defined entry in the contro0 tab0e %BS'A'C! you must se0ect the fie0d 0ustomer.
#f the fie0d 0ustomer is not se0ected! entries defined as &ype of usa2e D that are not chan,ed for
more than 40 days are removed from contro0 tab0e %BS'A'C automatica00y.
Lou can de0ete statistics for a sin,0e tab0e so that the ru0e8based optimiNer is used. Specify the va0ue
for Acti"e as I =i,nore> if you do not want the obOect to be ana0yNed! or specify the va0ue as R
=restrictive> to a00ow the obOect to be ana0yNed for space purposes.
"hen you modify the standard procedure! se0ect the '&%& f0a, so that the modifications are used
the ne1t time the statistics are refreshed.
=C> SAP AG BC505 :0
11.11
SAP AG 1999
...
Database Checks
2ablespaces
2ables/1nde8es
Database per'ormance= +ables and 8nde*es A *
+ables and 8nde*es -onitor
CO"+ABA",D O#+8-8L,R Actions
A *
,dit "ystem Ielp
Begin of action *nd of action Fct #bject RC
66'-4'/DDD -6+-/+66 66'-4'/DDD -6+6,+/6 aly DBS2!2C# ---6
6/'-4'/DDD -6+-/+/E 6/'-4'/DDD -6+6&+.& opt "S!"M ---/
/.'-4'/DDD -6+-/+/, /.'-4'/DDD -6+6/+-D aly DBS2!2C# ----
/&'-4'/DDD -6+-/+/D /&'-4'/DDD -6+6E+/E opt "S!"M ----
"elect options "elect options "ort "ort
DBA 4ogging -onitor
"A# &ote "earch
Search Criteria+
F&a)(e *ameG
Pe%<.%ma*'e
A *
"A# &otes
7se "A# tools only to re'resh 7se "A# tools only to re'resh
R/3 table statistics R/3 table statistics
7sing R/3 to -onitor #er'ormance #roblems
7or ,enera0 performance prob0ems! use the %BA *o,,in, Monitor =transaction D)7(> to check
whether the statistics are up8to8date.
#f a specific S+* statement causes performance prob0ems! you must check whetherG
'he statistics of a00 the tab0es accessed by the S+* statement are up8to8date with the correct
precision! usin, the 'ab0es and #nde1es Monitor =transaction D)'*>
'here is an SAP $ote re0ated to the prob0em
A statistica0 update is necessary for any of the tab0es accessed
'he ru0e8based optimiNer wou0d use a better access path
#f no so0ution can be found or if you have to switch back to the ru0e8based optimiNer! create a
customer messa,e in SAP$et usin, the component BC8%B8&3A.
3ememberG "hen you refresh the statistics of 3.4 tab0es! use SAP too0s on0y. SAP too0s ensure that
the statistica0 update is performed usin, the method and option defined for the obOect in the contro0
tab0e %BS'A'C. Statistica0 updates performed by non8SAP too0s can create severe performance
prob0ems if the precision of the update is not set correct0y.
=C> SAP AG BC505 ::
11.12
SAP AG 1999
-emory Con'ig(ration -emory Con'ig(ration -emory Con'ig(ration
Data b(''er Data b(''er Data b(''er
"hared pool "hared pool "hared pool
-emory Con'ig(ration
'he fo00owin, section describesG
'he &rac0e memory confi,uration
"hat the data buffer is used for
;ow the siNe of the data buffer is determined
"hat the shared poo0 is used for
;ow the siNe of the shared poo0 is determined
=C> SAP AG BC505 :-
11.13
SAP AG 1999
+he data b(''er '(nctions as a cache 'or the database
Database
RDB-"
"$A "$A Data b(''er Data b(''er
"hared pool
parsed "34
statements and
e*ec(tion path
dc in'ormation
abo(t obCects
o' the database
Data
'iles
...
System PSAP/A/" PSAP/A/" PSAPSA/-
-emory
area
"hared "34 Area Ro) Cache
R/3 )or0
process
",4,C+ .
JRO- -ARA
2I,R, ...
"hado)
process
4ogical 4ogical
reads reads
#hysical reads #hysical reads
Data B(''er 7tili?ation
A physica0 read must ,o to the disk to access the database data. "hen a physica0 read occurs! a copy
of the data b0ock is written to the data buffer and then read and ana0yNed by the shadow process.
A 0o,ica0 read does not need to ,o to the disk to access the database data! instead! it reads the data
b0ock from the data buffer.
Accessin, the data buffer is :000 times faster than accessin, the disk. 'o minimiNe disk access! the
data buffer must be tuned.
"hen a database update occurs! the data b0ocks are updated in the data buffer immediate0y! and
written to disk at 0ater time.
=C> SAP AG BC505 :4
11.14
SAP AG 1999
"+04= Database per'ormance analysis= Oracle database o%er%ie)
q q Q Q
Re'resh Detailed Analysis -en(
q q
q q
q q
q q q q
ORAC4, -onitor
Data B(''er
"hared #ool
Calls
"i?e
3(ality
56D000
;5
4og b(''er
Reads
#hysical reads
)rites
3@;D4
!0D@0;
D35
0b
P
...
...
...
...
;4
8denti'ying the Data B(''er Iit Ratio
'he hit ratio =<uality> of a database is defined as the percenta,e of data b0ocks accessed =Reads>
compared with the tota0 number of data b0ocks read from disk =Physical reads>. 'he Reads are the
sum of the 0o,ica0 and physica0 reads.
'he hit ratio is disp0ayed in the %atabase Performance Monitor =transaction S&'(>! and shou0d be at
0east 56F.
Since the hit ratio is poor in the first few hours after startup! you shou0d on0y eva0uate the hit ratio
after your system has been up for some time. As a ,enera0 ru0e! wait unti0 the number of Reads
e1ceeds -0!000!000.
Before you increase the siNe of the database buffer! check for poor0y Iua0ified S+* statements.
Prob0ems in the app0ication can cause poor hit ratios in even the 0ar,est of database buffers! for
e1amp0e! in the case of inefficient S+* codin,! many b0ocks may be read into memory
unnecessari0y.
=C> SAP AG BC505 :6
11.15
SAP AG 1999
-/B/*$C;B/0DD:RS
#arameter in init@sidA.ora
7se the Operating "ystem -onitor
to analy?e the
operating system paging statistics
be'ore and a'ter increasing
DBEB4OC/EB7JJ,R"
$our "ages in "ages out "aged in "aged out
/h /h I@b/hJ I@b/hJ
/4 // - && -
/6 66E - D-, -
// 65/(6 65.&6 ,5(&, /-5/(,
/- (6( &(& 65.-& /5,.(
D 66 - ,, -
, 66 - ,, -
E &6 (& /(, 6.(
( E& (& 6D( 6.(
. 45-4& 654(4 /65/4( D5&.6
& /5(&, /5/-( (5.D6 &5&6&
4 66 - ,, -
6 6D - //( -
/ ,D - 4.( -
- ,4 - 446 -
64 44 - /46 -
66 /5-(4 - &56.6 -
6/ 66 - ,, -
6- ,5/.E 65&4. 465(6, D5E&-
/D 66 - ,, -
/, /6, - ./6 -
/E &5-&( 45-.( /(5/,& /6566&
/( .4 - 6/6 -
/. 6,/ - /5/6& -
/& 4D - /.( -
8ncreasing the "i?e o' the Data B(''er
#f the hit ratio is 0ower than 56F! consider increasin, the database buffer. But before you increase
the siNe of the database buffer! check for poor0y Iua0ified S+* statements. Prob0ems in the
app0ication can cause poor hit ratios in even the 0ar,est of database buffers! for e1amp0e! in the case
of inefficient S+* codin,! many b0ocks may be read into memory unnecessari0y.
'o increase the siNe of your database buffer! chan,e the init<sid>$ora parameter
%BEB*&CJEB977(3S =which is specified in units of b0ocks>. 'his parameter specifies the number
of database b0ocks buffered in memory. $oteG "hen you increase this parameter! you reduce the
memory avai0ab0e to other processes in the system! which may cause &S pa,in, and.or swappin, to
occur.
'o check the &S pa,in, use the &S Monitor =transaction S&'F > and choose Detailed Analysis
Pre"ious 6oursK ,emory.
(ach hardware p0atform has an upper 0imit on the tota0 amount of shared memory that can be
a00ocated. 'he sum of the fi1ed and variab0e portions =data buffer cache! shared poo0! and 0o, buffer>
of the System G0oba0 Area cannot e1ceed this amount.
'o monitor chan,es in any &rac0e initia0iNation parameters! use transaction D)'3.
=C> SAP AG BC505 :5
11.16
SAP AG 1999
+he shared pool caches parsed "34 statements and
Data Dictionary in'ormation 'rom the database
Database
RDB-"
"$A "$A
Data b(''er Data b(''er
"hared pool "hared pool
Data 'iles
-emory
area
"hared "34 Area Ro) Cache
...
R/3 )or0
process
"hado)
process
",4,C+ .
JRO- -ARA
2I,R, ...
7ser calls 7ser calls
Rec(rsi%e calls Rec(rsi%e calls
#"A#B+AB8 #"A#"+ABD "ystem
#arsed "34
statements and
e*ec(tion path
dc in'ormation
abo(t obCects
o' the database
8denti'ying 7sage o' the "hared #ool
'he shared poo0 consists of theG
Shared S<> Area! where parsed S+* statements are cached for shared access to a00 shadow
processes
Row 0ache! which ho0ds the &rac0e %ata %ictionary information! inc0udin, the cost8based
optimiNer statistics. $oteG "ith the cost8based optimiNer! the 3ow Cache wi00 have substantia00y
more information to ho0d than with the ru0e8based optimiNer
A user call refers to a shadow process accessin, the Shared S+* Area for parsed S+* statements.
A recursi"e call refers to the 3ow Cache makin, a physica0 read to 0oad &rac0e %ata %ictionary
obOects from the system tab0espace.
=C> SAP AG BC505 :/
11.17
SAP AG 1999
8denti'ying the ,''iciency o' the "hared #ool
"+04= Database per'ormance analysis= Oracle database o%er%ie)
q q Q Q
Re'resh
q q
q q
q q
q q q q
ORAC4, -onitor
Data B(''er
"hared #ool
Calls
"i?e 0b
DDAcache B(ality P
...
7ser calls
...
...
!@D000
;5
...
;6
!@D!3!
...
...
4og b(''er
Rec(rsi%e calls
...
...
D33@
...
...
7ser calls / Rec. calls
...
pinratio P
...
5.55
...
0.03 reloads/pins P
0.04
> @0
;5
#re%io(s Days Detailed Analysis -en(
'he ratio of user calls to recursi"e calls shou0d be at 0east - to :.
'he %ata %ictionary cache Iua0ity shou0d a0so be ,reater than H0F.
'he pin ratio shou0d be 0ar,er or eIua0 55F.
'he ratio of reloads to pins shou0d be at ma1imum 0.06.
Since these ratios are poor in the first few hours after startup! you shou0d on0y eva0uate them after
your system has been up for some time. As a ,enera0 ru0e! you shou0d wait unti0 the number of Reads
e1ceeds -0!000!000.
$oteG Creatin, new optimiNer statistics is heavi0y based on recursive ca00s. Lou shou0d therefore first
make sure that creatin, statistics is not responsib0e for the va0ues. 'o do this! check the history by
choosin, the Pre"ious days button.
=C> SAP AG BC505 :P
11.1
SAP AG 1999
"IAR,DE#OO4E"8L,
parameter in initGsidH.ora
,*amine the operating system paging statistics (sing the
Operating "ystem -onitor
be'ore and a'ter increasing "IAR,DE#OO4E"8L,
$our "ages in "ages out "aged in "aged out
/h /h I@b/hJ I@b/hJ
/4 // - && -
/6 66E - D-, -
// 65/(6 65.&6 ,5(&, /-5/(,
/- (6( &(& 65.-& /5,.(
D 66 - ,, -
, 66 - ,, -
E &6 (& /(, 6.(
( E& (& 6D( 6.(
. 45-4& 654(4 /65/4( D5&.6
& /5(&, /5/-( (5.D6 &5&6&
4 66 - ,, -
6 6D - //( -
/ ,D - 4.( -
- ,4 - 446 -
64 44 - /46 -
66 /5-(4 - &56.6 -
6/ 66 - ,, -
6- ,5/.E 65&4. 465(6, D5E&-
/D 66 - ,, -
/, /6, - ./6 -
/E &5-&( 45-.( /(5/,& /6566&
/( .4 - 6/6 -
/. 6,/ - /5/6& -
/& 4D - /.( -
8ncreasing the "i?e o' the "hared #ool
#f any of these ratios are 0ower then the thresho0d mentioned! increase the siNe of the shared poo0.
'here are no specific &rac0e parameters for increasin, the siNe of the 3ow Cache or the siNe of the
Shared S+* Area. By increasin, the area for the entire shared poo0! you a0so increase the amount of
space avai0ab0e for both areas.
'o increase the entire shared poo0! chan,e the init$ora parameter S;A3(%EP&&*ES#W( =which is
specified in units of bytes>. %o not cause e1cessive operatin, system pa,in, by usin, too much
memory.
=C> SAP AG BC505 :H
11.1!
SAP AG 1999
Application design Application design Application design
4oc0)ait sit(ations 4oc0)ait sit(ations 4oc0)ait sit(ations
,*pensi%e "34 statements ,*pensi%e "34 statements ,*pensi%e "34 statements
#oorly B(ali'ied statements #oorly B(ali'ied statements #oorly B(ali'ied statements
Application Design
'his section describes how to identi39 the fo00owin, app0ication desi,n prob0emsG
*ockwait situations
(1pensive S+* statements
Poor0y Iua0ified S+* statements
=C> SAP AG BC505 :5
11.20
SAP AG 1999
2or0
#rocess !
2or0
#rocess 3
2or0
#rocess 4
2or0
#rocess
AcB(ires
-ARA 4oc0
A long period
o' processing
Commit
7pdate
-ARA
2or0ing...
2A8+8&$\
7pdate
-ARA
ReB(ests
-ARA 4oc0
AcB(ires
-ARA 4oc0
Commit
2or0ing...
2A8+8&$\
7pdate
-ARA
ReB(ests
-ARA 4oc0
AcB(ires
-ARA 4oc0
2A8+8&$ ...
7pdate
-ARA
ReB(ests
-ARA 4oc0
-ARA
4oc0ed
by
2# ! 2# 2# 3
2hen a 4oc0)ait "it(ation Occ(rs
A 0ockwait situation occurs when numerous work processes reIuest a 0ock on the same obOect. #n
order for the 3%BMS to maintain transactiona0 consistency! the obOect is 0ocked by the process that
reIuested it first.
#f a user starts a 0o,ica0 unit of work and updates an obOect! such as the most often used materia0
number of the company! then a00 other users who want to update the same materia0 must wait unti0
the first user has committed the chan,es before they can ,et the record.
A user ho0din, a 0ock wi00 occupy an 3.4 work process. &ther users tryin, to app0y the same 0ock
must wait and at the same time occupy their own 3.4 work process. As the number of 0ockwaits
increases! fewer and fewer 3.4 user reIuests can be processed by avai0ab0e 3.4 work processes. #n a
worst8case scenario! the 0ock ho0ders and waiters wou0d eIua0 the number of 3.4 work processes!
and a sma00 number of users cou0d cause the entire 3.4 system to AfreeNeB.
=C> SAP AG BC505 -0
11.21
SAP AG 1999
7sing the ,*cl(si%e 4oc0)ait -onitor
ObCect Iolder 6OracleA"8DD A"#8D] ClientAIostD A#8D: 4e%el +ime 6s:
2aiters 6OracleA"8DD A"#8D] ClientAIostD A#8D: Ro)A8D
+!00 ; D ;.6@5 ] hs5@! D ;.6@! ! !
4!
30.05.!;;; !4=45=5@ +C! hs5@!
,*cl(si%e sessionAloc0 sit(ations
4e%el +ime 6s:
!4 D 5530 ] hs5@! D !6.4; ! 6
Do(bleAclic0
#rimary 0ey
%al(es
Oracle "essionA8D 0
4oc0ed obCect -O&8
4oc0ed Ro) 68D: AAAA@mAA4AAAA30AAJ
1al(es=
R,48D DB
"R+JD +C! snapshot!
"R+J
30.05.!;;; !4=5;=00 +C! hs5@!
,*cl(si%e sessionAloc0 sit(ations
9se the 9xclusi"e >oc/wait ,onitor =transaction D)'7> to identify e1c0usive 0ockwait situations and
to disp0ay information about theG
*ock ho0der
$umber of 0ock waiters
Primary key 0ocked
=C> SAP AG BC505 -:
11.22
SAP AG 1999
Red(cing ,*cl(si%e 4oc0)aits
Redesign the application to red(ce the loc0ing period by=
8ncreasing the commit 'reB(ency in the application
&ot allo)ing a single process to hold a loc0 'or a long period
4oc0ing the obCect as late as possible
AdC(st the Cob sched(ling cycle so that loc0 sit(ations do
not occ(r
#f e1c0usive 0ockwait situations occur because a user ho0ds the 0ock too 0on,! ana0yNe the app0ication
and determine whetherG
More commits can be safe0y bui0t into the app0ication
'he 0ock period can be shortened by acIuirin, the 0ock 0ater
#f e1c0usive 0ockwait situations occur because many users want to access the same record in hi,h8
vo0ume processin,! you can schedu0e the Oobs to be performed at different times.
=C> SAP AG BC505 --
11.23
SAP AG 1999
+otal Reads / B(''er $ets 5 P
8denti'ying ,*pensi%e "34 "tatements 6!:
B(''er
$ets
!D5D0;0
!D04D054
504D054
443D6;4
"hared "34 Area
6.!P
"orted
by
Database #er'ormance -onitor
q q Q Q
Re'resh Detailed Analysis -en(
q q
q q
q q
q q q q
ORAC4, -onitor
"hared #ool 4og b(''er
Reads
#hysical reads
)rites
0D@53D;34
5@!D@0;
4D35
... ...
Data B(''er
... ...
Reads / 7ser calls 5.@ < 0
An indicator for havin, e1pensive S+* statements in the system is the ratio of Reads to ;ser calls.
'his va0ue shou0d be 0ess than -0. #f this va0ue is ,reater than -0! you must check the S+* statements
in detai0.
(1pensive S+* statements have a hi,h number of )uffer 2ets compared to &otal reads.
#f the ratio of )uffer 2ets to &otal reads is ,reater or eIua0 than 5F! the S+* statement is e1pensive.
&nce a statement has been identified as e1pensive in the Shared S+* Area! run an 9xplain plan on
the statement.
After you have run an 9xplain plan on an e1pensive S+* statementG
Check the cost8based optimiNer settin,s for the tab0es bein, used in the S+* statement
Create a customer messa,e in SAP$et if the statement is identified as part of the SAP code
3edesi,n the app0ication if the statement is identified as part of the customer code
Check if the statement is poor0y Iua0ified
=C> SAP AG BC505 -4
11.24
SAP AG 1999
"+04 A Detailed Analysis A "34 ReB(est A Database #er'ormance= "hared "34
q q Q Q
Sort Reset Since Reset Since -/ Start
q q
q q
q q
q q q q
-etail stats.
5.05.!;;;!6=54=36 "hared C(rsor Cache 6last reset at 5.05.!;;; !5=!5=55 :
+otal C(rrent Dis0 Reads/ B(''er $ets/ Records Records/ B('gets/ "34
,*ec(tion ,*ec Reads ,*ec(tion $ets ,*ec(tion processed ,*ec(tion record "ort
5D456 0 !D46@ !.5 !D5D0;0 !50. 6D336 0.@ 00.@ 0
@! 0 !4;D60! !D@46.; 5D50;D3 ;5D!55.6 5@3 ;.5 ;D@45.@ 0
5 0 D5;4 4D5!@.@ !D04D054 40D@!4.@ !4D! @D444. @.5 0
3 0 !0D604 3D534.5 443D6;4 !45D@;@.0 0 0.0 443D6;4.0 !
&(mber o'
e*ec(tions
"orted by
&(mber o'
b(''er gets
per record
8denti'ying ,*pensi%e "34 "tatements 6:
'o identify e1pensive S+* statements! use the %atabase Performance Monitor =transaction S&'(>
and choose Detailed analysis S<> re%uest.
Ana0yNe the Shared S+* Area statistics co00ected since the 0ast startupG
'he co0umn &otal 9xecution refers to the number of times the S+* statement was e1ecuted
'he co0umn )uffer Lets refers to the tota0 number of buffers accessed by the statement
'he co0umn )uf2ets.record refers to the avera,e number of buffers accessed per record retrieved
Sort by the co0umn )uffer Lets. Check for statements that are e1ecuted very often with a 0ow number
of )uf2ets.record. 'hese statements shou0d be ana0yNed.
'o identify which pro,ram an S+* statement be0on,s to! you can checkG
'he ";(3(89S(% 0ist in the %ata %ictionary =transaction S97*>
'he System"ide "ork Process &verview =transaction S,FF> and the &rac0e Session Monitor
=transaction S&'( Detailed analysis>
=C> SAP AG BC505 -6
11.25
SAP AG 1999
+otal Dis0 Reads/ B(''er $ets/ "34
,*ec(tion Reads ,*ec(tion $ets ,*ec(tion +e*t
+otal Dis0 Reads/ B(''er $ets/ "34
,*ec(tion Reads ,*ec(tion $ets ,*ec(tion +e*t
55 554 ;.5 5D00D0@; ;!D;.6 ",4,C+ Y#$-8DY D YOB^,C+Y D Y D,1C4
"peci'y hint=
Jor testing only\
&o change to the "A# code
"34 "tatement
",4,C+
.
JRO-
Y+AD8RY
2I,R,
Y#$-8DY F =A0 A&D YOB^,C+Y F =A! A&D YD,1C4A""Y F =A A&D RO2&7- GF =A3 X
,*ec(tion #lan
",4,C+ "+A+,-,&+ 6 ,stimated Costs F ;5 :
' CO7&+ "+O#/,<
' +AB4, ACC,"" B< 8&D,9 RO28D +AD8R
8&D,9 RA&$, "CA& +AD8R_!
*8plain with hint *8plain with hint #ptimi7er trace #ptimi7er trace
S#eci(y =int
:nter t!e !int )it!o4t t!e comment
si&ns /RQ ... R/ 3(or t!e synta1 o(
!ints see t!e $RAC*: t4nin& &4ide5
Cancel Contin4e
R(nning an ,*plain #lan
Do(bleAclic0
'o run an 9xplain plan for an e1pensive S+* statement! doub0e8c0ick the appropriate 0ine in the
Shared S+* Area and choose 9xplain.
'he output of the 9xplain plan shows how the cost8based optimiNer has decided to access the data.
'he option 9xplain with hint a00ows you to check a possib0e chan,e in the access path usin, &rac0e
hints! such as checkin, the access path chosen by the ru0e8based optimiNer =;int 39*(>. "hen you
use a hint! on0y a new e1p0ain p0an is created! the actua0 S+* statement is not chan,ed.
7or further information about &rac0e hints! refer to &rac0e documentation.
;ere are the definitions of some 9xplain plan output for S+* statementsG
I3D9M RA3L9 S0A3G 'he database retrieves a number of records usin, an inde1 to 0imit the
resu0t set before ,oin, to the data pa,es
I3D9M ;3I<;9 S0A3G 'he database retrieves a sin,0e row from an uniIue inde1
I3D9M 3A,9G 'he name of the inde1 that the database uses for retrievin, data
030A&93A&I3G 'he database unites a set of rows retrieved for the Iuery
39S&9D >PSG 'he database Ooins one tab0e to a second tab0e! usin, the information found in
the first tab0e to check second tab0e! and bui0ds a resu0t set out of both tab0es
&A)>9 A009SS @;>>G 'he database retrieves a00 rows from the tab0e to bui0d the resu0t set
SR&G 'he database sorts the data before returnin, it
=C> SAP AG BC505 -5
11.26
SAP AG 1999
+otal B(''er B('gets/
,*ec(tion $ets Record
+otal B(''er B('gets/
,*ec(tion $ets Record
@ !D333D65 666D@!.5
+able -ARA
J(ll table scan 8nde* scan
",4,C+ . JRO- -ARA 2I,R, -A+,R8A4 F !000!
8nde* -ARA`O
#oorly 3(ali'ied "34 "tatements
Poor0y Iua0ified S+* statements do not use an inde1 correct0y to access the data. #f an inde1 is used
correct0y! data access is more efficient.
'o identify poor0y Iua0ified S+* statements! check the Shared S+* Area for e1pensive statements
with a hi,h number of )uf2ets.record. Poor0y Iua0ified statements usua00y occur ifG
$o inde1 is associated with the tab0e bein, accessed
A secondary inde1 is reIuired for the Iuery bein, performed
'he incorrect inde1 is bein, uti0iNed
An inde1 is bein, used a0thou,h a fu00 tab0e scan wou0d be more effective! for e1amp0e! in the case
of sma00 tab0es or a hi,h number of records retrieved
'he inde1 bein, used is defined incorrect0y
#f a statement is identified as a poor0y Iua0ified S+* statement because of an SAP report! create a
customer messa,e in SAP$et.
$oteG %o not chan,e the standard 3.4 inde1 desi,n. 'his is considered an Ae1pertB tunin, measure.
Contact SAP for support.
=C> SAP AG BC505 -/
11.27
SAP AG 1999
"34 5xplain Plan
&o inde* being (sed
J(ll +able "can
,*ec(tion #lan
",4,C+ "+A+,-,&+6 ,stimated Costs F 5; :
+AB4, ACC,"" J744 -ARA
+able -ARA
4ast statistics date 05.06.!;;@
&(mber o' ro)s 53D!@!
&(mber o' bloc0s allocated 6!0
&(mber o' empty bloc0s ;
A%erage space !D!33
Chain co(nt 0
A%erage ro) length 56
7&837, 8nde* -ARAEEEEE0
Col(mn &ame XDistinct
-A&D+ !
-A+&R 4D405
&O&7&837, 8nde* -ARAEEE4
Col(mn &ame XDistinct
-A&D+ !
-A+/4 5
Contin4e S!o) statistics
S!o) "nde1es o( a.le %ARA
Analy?ing #oorly 3(ali'ied "34 "tatements
'o check if an inde1 is bein, used to access data! run an 9xplain Plan on the S+* statement.
'o disp0ay the information about the inde1 structure or the structure of the tab0e and a00 inde1es!
doub0e8c0ick the inde1 or tab0e name. #nformation is a0so disp0ayed about the statistics that the cost8
based optimiNer used to create the access! and the date the statistics for this tab0e was 0ast refreshed.
=C> SAP AG BC505 -P
11.2
SAP AG 1999
#hysical and logical layo(t
8/O contention
Chec0point not complete
Rollbac0 statement problems
Jragmented inde*es
#hysical and 4ogical 4ayo(t
'his section describes the fo00owin, physica0 and 0o,ica0 0ayout prob0emsG
#.& contention
Checkpoint not comp0ete =for on0ine redo 0o, fi0es>
&3A8:555 Snapshot too o0d =for ro00back se,ments>
7ra,mented inde1es
=C> SAP AG BC505 -H
11.2!
SAP AG 1999
Occ(rs )hen n(mero(s shado) processes and the
database )riter access the same dis0 at the same time
"hado)
process
"hado)
process
"hado)
process
"hado)
process
"hado)
process
#"A#B+ABD
#"A#"+ABD #"A##OO4D
#"A#7",R!D #"A#B+AB8
#"A#"+ABD
Database
)riter
DB2R
R,AD
2R8+,
8/O Contention
#.& contention refers to the hi,h #.& wait times for processes accessin, the database. "hen
numerous &rac0e shadow processes and the database writer access the same disk at the same time!
#.& contention is 0ike0y to occur.
#.& contention occurs ifG
'he app0ication desi,n is inefficient! due to e1pensive! unnecessary! or poor0y Iua0ified S+*
statements
'he #.& is not even0y distributed across many disks
'he disks are not fast enou,h to hand0e the hi,h #.& activity
;eavi0y accessed tab0es or inde1es are not distributed or striped across many disks
'he hardware confi,uration is incorrect =for e1amp0e! many disks and not enou,h contro00ers>
#.& contention is often caused by app0ication desi,n prob0ems! therefore! check this first.
=C> SAP AG BC505 -5
11.30
SAP AG 1999
8/O per path
Chec0 'or=
A%erage read times H 0ms
De%iations 'rom the median %al(e H 0P
//'-,'/DDD /E+4.+66 2C/ hs.,6/
Statistics of physical accesses on #racle database
Blk Reads !vg=ms? !vg=ms?
,.5E./
/6E54,/
6(5D(65(D-
4.&
4445(4.
D45(6D
/E,5466
6&,56--
66566(
Filename
/oracle/2C//sapdata/
/oracle/2C//sapdata/-
/oracle/2C//sapdata6
/oracle/2C//sapdata4
/oracle/2C//sapdata&
/oracle/2C//sapdata.
/oracle/2C//sapdata(
/oracle/2C//sapdataE
/oracle/2C//sapdata,
/oracle/2C//sapdataD
Reads
6-54&(
,54.,
&56EE54--
D(
/445(&/
,D5E(/
,45/E4
6&45D,/
45&E,
/45E(&
Lrites
/65-.(
/(
45,(,
&4
(.5/6-
/5-(-
.-(
66/
&(
4- /,/5446
4
/
4
.
4
&
4
.
6
/
Blk Lrites
/65-.(
/(
45,(,
&4
&D45-(&
/5-(-
.-(
66/
&(
4-
E
(
(
/.
.
(
.
.
(
4
"orted by
8denti'ying 8/O Contention in the Database
'o identify #.& contention in the database! use the %atabase Performance Monitor =transaction S&'(>
and choose Detailed analysis @ile system re%uests I. per path.
'he I. per path a00ows us to identify the sapdata mount points where #.& contention is occurrin,.
Check the A"era2e ms co0umns for b0ock reads =)>: Reads> and b0ock writes =)>: writes>! and use
these va0ues to identify Ahot disksB.
#f the tota0 number of reads and writes is re0ative0y 0ow! there is no #.& contention.
#f the tota0 number of reads and writes is hi,h! check if the avera,e read time is hi,her than -0 ms.
Lou can a0so identify Khot disksK by checkin, for va0ues that deviate by more than -0F from the
median va0ue of the avera,e read or write times.
$oteG %ue to the various hardware confi,urations and disk speeds! the actua0 va0ues can differ
si,nificant0y from system to system. Contact your hardware vendor for specific information.
Because &rac0e writes data b0ocks asynchronous0y! the avera,e write time is not important.
;owever!the avera,e write time becomes important if &rac0e is not ab0e to hand0e the vo0ume
anymore. Lou can identify this situation by checkin, the write complete waits and the free buffer
waits in view vDsystemEevent.
=C> SAP AG BC505 40
11.31
SAP AG 1999
+otal per de%ice
Statistics of physical accesses on #racle database
Filename Reads Lrites Blk Reads!vgms Blk Lrites !vgms
docud0/
loadi0/
poold0/
poold06
protd0/
roll0/
/oracle/2C//sapdata/
es&-bd06
/oracle/2C//sapdata/-
ddicd06
docui0/
system0/
/oracle/2C//sapdata6
protd06
/oracle/2C//sapdata4
btabd0/
clui0/
4-4
6D
/&5D/&
65//4
/56D&
/5(D4
6-54&(
,54.,
,54.,
65//4
/5(D.
/56E45&D6
/56EE54--
D(
D(
/D-
//
//
&&
/4
(E4
//54-&
/65-.(
/(
/(
//
//
45,&(
45,(,
&4
&4
ED.
//
/5ED(
6D
(654E6
/&5D,6
&5,ED
/5(D4
,.5E./
/6E54,/
/6E54,/
/-5&-4
/5(D.
D.-5.D6
D(65(D-
4.&
4.&
&-5.D-
/D-
6
.
4
6
4
/
4
/
/
6
E
-
4
.
.
6
,
//
//
&&
/4
(E4
//54-&
/65-.(
/(
/(
//
//
45,&(
45,(,
&4
&4
ED.
//
-
-
/&
4
/.
/6
E
(
(
-
-
/D
(
/.
/.
/.
-
"ol%ing the 8/O Contention #roblem
'o so0ve the prob0em of #.& contention! you canG
%istribute the #.& even0y on the disks avai0ab0e
%istribute the #.& even0y on more disk =then wou0d be necessary to ho0d the database fi0es>
Purchase faster disks
Move Ahot spotB tab0es or inde1es to their own tab0espaces on their own disks =may be striped>
'o identify the tab0espace and the data fi0e that has a bott0eneck! you can break down the tota0 #.&
reIuests per fi0e system by choosin, &otal per de"ice. 'he tab0espace and the data fi0e can then be
moved to another physica0 disk in the system.
%ifferent hardware p0atforms may have bott0enecks in disk contro00er ports! motherboards! and back
p0anes. 3efer to your hardware vendor for #.& distribution ,uide0ines.
=C> SAP AG BC505 4:
11.32
SAP AG 1999
Online redo
log 'iles
. DBR2
)rites data
to dis0s
3. Redo log )riter
)rites to the online
redo log in parallel
4. 4ast online redo
log 'ile is '(ll b(t
the chec0point is
not completed
Data 'iles
Data b(''er
Redo log b(''er
saptrace/bac0gro(nd
alertEG"8DH.log
Chec0point not
complete
!. Online redo log 'ile
s)itch occ(rs
Chec0point not Complete
;ow the error 0hec/point not 0omplete occursG
:. An on0ine redo 0o, switch occurs and the check point process ta,s the on0ine redo 0o, ,roup bein,
written to unti0 the checkpoint tri,,ered by the on0ine redo 0o, switch is comp0ete.
-. A checkpoint is tri,,ered. 'hat means! dirty pa,es from the data buffer are bein, written to disk
by the database writer =%B"3>.
4. 'ransactions are sti00 occurrin, and committin,! so data is written from the redo 0o, buffer to the
on0ine redo 0o,s in para00e0 to the checkpoint.
6. (ventua00y! after some 0o, switches! a00 the on0ine redo 0o,s are in use before the checkpoint
tri,,ered has finished. $o data can be f0ushed from the redo 0o, buffer to an on0ine redo 0o, fi0e
because a00 on0ine redo 0o, fi0es are necessary for instance recovery.
'he &rac0e 3%BMS automatica00y hand0es this situation! no further chan,es are processed unti0 the
checkpoint is comp0ete and the on0ine redo 0o, fi0e can be overwritten.
'he messa,e ACheckpoint not comp0eteB is written to the &rac0e a0ert 0o, alert_<SID>$lo2. 'his
prob0em ,enera00y occurs durin, hi,h database activity and durin, peak hours.
#f the messa,e appears freIuent0y! increase the number of on0ine redo 0o, ,roups. #ncreasin, the siNe
of the on0ine redo 0o, fi0es is not recommended! un0ess the time between the two 0o, switches is 0ess
than three minutes.
$oteG 'his prob0em shou0d on0y be of concern if it occurs freIuent0y.
=C> SAP AG BC505 4-
11.33
SAP AG 1999
Reading B(ery
#ersA&o. "alary
!......... 350
......... 436
@......... 3040
4......... 5@5
;......... 4!60
+able
Ro)s changed
and committed
Rollbac0 "egments
+ransaction +! 67pdate:
+ransaction + 6"elect:
Commit
430
5550
30!0
4!!;
Rollbac0 segment
O%er)rite
or
shrin0
ORA
!555
'he ro00back se,ments are used by the &rac0e 3%BMS toG
Save before ima2es of uncommitted transactions
Provide read consistency durin, the runtime of a Iuery
#f rows of a tab0e are modified! the before ima,es of the data are copied to a ro00back se,ment. After
the commit! this information is no 0on,er needed! and the ro00back se,ment is freed by the process.
#f a tab0e is modified between the time a Iuery is issued and when the records are de0ivered by the
Iuery! the data is read from the ro00back se,ments. ;owever! ro00back se,ments are overwritten or
shrunk in a cyc0e and are not 0ocked for Iueries. #f a Iuery is not finished unti0 the ro00back se,ment
is overwritten or shrunk! the Iuery does not receive the data.
"hen this occurs! &rac0e issues error :555 Snapshot too old! and the Iuery is aborted. A short dump
then occurs! and an entry in the 3.4 System 0o, is ,enerated.
=C> SAP AG BC505 44
11.34
SAP AG 1999
"ol%ing Rollbac0 "egment #roblems
Database b(''er pool
. 4ong processing time
bet)een t)o data 'etches
A##lication server
4arge n(mber o'
b(''ers (sed on the
database ser%er
Database b(''er pool
A##lication server
Iigh processing
time on the
application ser%er
"nap
d(mp
ORA
!555
ORA
!555
!. ,*pensi%e B(ery
'here are two main reasons why this error occursG
(1pensive Iueries
*on, processin, time between the fetches
Because a S(*(C' does not norma00y read a00 the data at one time! 0on, processin, times between
the fetches can cause error &3A8:555! even if the statement is not e1pensive. 'he ne1t fetch is
processed on the database when it is reIuested. 'herefore! even if the statement is not e1pensive! the
time it takes unti0 the statement is finished is 0on,.
'o avoid error &3A8:555G
%ecrease the runtime of the statement! by tunin, the statement causin, the Snapshot too old
%ecrease the processin, time between two fetches of an S+* statement
Schedu0e the reports and the updates at different times
#f none of these tunin, methods are successfu0! increase the number or the siNe of ro00back
se,ments =preferab0y! increase the number>
3o00back data fi0es have the hi,hest amount of write activity in the database. 'o reduce bott0enecks
in the ro00back se,ments! distribute the #.& for the data fi0e even0y.
=C> SAP AG BC505 46
11.35
SAP AG 1999
... ... ... ... ... ... ... ... ... ... ... ...
... ... ... ...
8nde* 8nde*
... ... ... ...
... ... ... ...
... ...
+able +able
... ... ... ...
!
3 4 5 6 5 @ ;
8nde* )ith a
lo) 'ill le%el
-any b(''er gets per
e*ec(tion altho(gh the
correct inde* is (sed
Jragmented 8nde*es
7ra,mented inde1es have a 0ow fi00 0eve0.
#nde1es can become fra,mentedG
After data has been archived
After many records have been de0eted
#n hi,h0y dynamic tab0es
An inde1 that is fra,mented consists of empty b0ocks or branch and 0eaf pa,es with on0y a few va0id
entries. #f an inde1 is fra,mented! a Iuery that scans a ran,e in the inde1 must read many inde1
b0ocks. 'his affects the performance of the entire database! since data or inde1 b0ocks of other tab0es
are swapped out of the buffer by the new0y read inde1 b0ocks that contain on0y a few records.
#n this e1amp0e! 5 inde1 b0ocks and 5 data b0ocks are read in order to retrieve five rows of the tab0e.
=C> SAP AG BC505 45
11.36
SAP AG 1999
7se the +ables and 8nde*es -onitor
Jill le%el
+ables and 8nde*es= Detailed Analysis o' +!00_0 R/3
*
DB Analysis ,*tents +able Col(mns Detailed Analysis Iistory
14.05.1999 113620 "*a(y3i3 .< BA-&%ee
Da&a <%.m 15DEX$ST"TS
Storage summary "erformance summary
?e2e(3................ 3 ;e&3 6e% a''e33........ 4
B(.'C3 a((.'a&e+...... 1H315 Di3&i*'& Cey3.......... 517H152
"2ai( i* &%ee.....)y&e 10H477H868 M.3& %e6ea&e+ Cey...... 1
@3e+ i* &%ee......)y&e 9H856H219 R./3 6e% Cey........... 1
...................= 95
/i&0.4& +e(. %./3..= 94
B>-tree branch blocks B>-tree leaf blocks
B%a*'0 )(.'C3......... 4 ?ea< )(.'C3........... 1H309
e*&%ie3........ 1H308 e*&%ie3........... 517H152
3i7e.......)y&e 19H406 3i7e..........)y&e 9H836H813
3i7e#)(.'C.)y&e 8H012 3i7e#)(.'C....)y&e 7H980
+e(e&e+........... 6
+e(. 3i7e.....)y&e 114
Analy?e 8nde*
1alidate "tr(ct(re H
"torage 3(ality
1alidate "tr(ct(re HDialog
Bac0gro(nd
Dialog
8denti'ying a Jragmented 8nde*
'o ana0yNe the fi00 0eve0 of an inde1! use the 'ab0es and #nde1es Monitor =transaction D)'*> and
choose Detailed analysis.
#nde1es that have a fi00 0eve0 0ess than 50F shou0d be reor,aniNed if they are freIuent0y accessed.
'o create or refresh the inde1 statistics! choose Analy8e index =alidate structure Dialo2 or
)ac/2round.
%urin, the runtime of the 2a0idate structure! the re0ated tab0e remains 0ocked for chan,es.
7or further information about detectin, and recreatin, fra,mented inde1es refer to the artic0e about
Reor2ani8ation in SAP &ech3et.
=C> SAP AG BC505 4/
11.37
SAP AG 1999
7nit "(mmary
&o) yo( are able to=
De'ine a strategy 'or re'reshing the statistics (sed by
the costAbased optimi?er
8denti'y per'ormance problems ca(sed by the=
CostAbased optimi?er
-emory con'ig(ration
Application design
#hysical and logical layo(t
=C> SAP AG BC505 4P
11.3
SAP AG 1999
J(rther Doc(mentation
"A# +ech&et
Comm#nication SAP Tech<etDB Admin.
9racle
"A#&et
Information SAP Sol#tions SAP ,&:
Basis Technolo!$ S$stem Mana!ement
CCMS - Comp#ter Center Mana!ement
S$stem Database Mana!ement
"A# &otes !0;034D !55!5D !@!
=C> SAP AG BC505 4H
12
SAP AG 1999
+op !0 #roblems
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
12.2
SAP AG 1999
+op !0 #roblems
Contents
+he most 'reB(ent problems that occ(r )hen R/3 is installed on
an Oracle database
ObCecti%es
At t!e end o( t!is 4nit< yo4 )ill .e a.le to?
Recogni?e and sol%e these problems
#re%ent these problems 'rom occ(rring
'his unit e1p0ains the ten prob0ems that most freIuent0y occur when 3.4 is insta00ed on an &rac0e
database.
&nce you have comp0eted this unit you wi00 be ab0e toG
3eco,niNe and so0ve these prob0ems
Prevent many of these prob0ems from occurrin,! before they become prob0em
=C> SAP AG BC505 -
12.3
SAP AG 1999
R4n S!"DB! -check
R4n S!"DB! -check
Chec0 'or
error messages
in=
Chec0 'or
error messages
in=
R/3 "yslog
"A# &ote
"earch
Oracle bac0gro(nd
process trace 'iles
in directory=
saptrace/bac0gro(nd
Oracle bac0gro(nd
process trace 'iles
in directory=
saptrace/bac0gro(nd
Oracle (ser trace 'iles
in directory=
saptrace/(sertrace
Oracle (ser trace 'iles
in directory=
saptrace/(sertrace
R/3 startdb.log
in the home directory
o' (ser G"8DHadm
R/3 startdb.log
in the home directory
o' (ser G"8DHadm
Oracle alert log 'ile=
saptrace/bac0gro(nd
/alertEG"8DH.log
Oracle alert log 'ile=
saptrace/bac0gro(nd
/alertEG"8DH.log
Chec0 "A#&et
'or sol(tions
+ro(bleshooting "teps
"hen a prob0em occurs! run sapdba -check and check the 0o, fi0e in directory sapchec/.
'o be,in troub0eshootin,! you can check the 3.4 System 0o, or the fo00owin, &rac0e fi0esG
'he &rac0e a0ert 0o, fi0e &3AC*(E;&M(.saptrace.back,round.a0ertE?S#%@.0o,! which often
contains further information! such as the &3A8)))) return code that may identify the prob0em
'he &rac0e back,round process trace fi0es in directory saptrace.back,round
'he &rac0e user trace fi0es in directory saptrace.usertrace
'he startdb.0o, fi0e in the home directory of user <SID>adm! which contains error information in
the case of database instance startup fai0ure
'o check the 3.4 System 0o,! use transaction S,*7.
Lou shou0d a0so search for re0ated SAP $otes in SAP$et. #f you cannot find an app0icab0e SAP
$ote! create a customer messa,e in SAP$et! and provide the SAP hot0ine with the fo00owin,
informationG
Sys0o, messa,es and the short dump =transaction S&**> re0ated to the error
(rror messa,es from the &rac0e a0ert 0o, fi0e
(rror messa,es from the &rac0e back,round process and user trace fi0es
(rror messa,es from the fi0e startdb.0o,
*o, fi0es of SAP%BA or B3X too0s
=C> SAP AG BC505 4
12.4
SAP AG 1999
+he most 'reB(ently occ(rring problems are=
An archi%er st(c0 sit(ation
+he incorrect tape si?e on tape dri%es )ith hard)are compression
A missing Yend bac0(pY
A tablespace o%er'lo)
A table or inde* reaching the -A9,9+,&+" limit
Oracle error ORAA!555D snapshot too old
&et@ +C#/8# delay
Oracle error ORAA!55@D data bloc0 corr(ption
Oracle error ORAA600D internal database error
#oor per'ormance o' the costAbased optimi?er
+op !0 #roblems
'he ten most freIuent prob0ems that occur when 3.4 is insta00ed on an &rac0e database areG
An archiver stuck situation
'he incorrect tape siNe on tape drives with hardware compression
A missin, Aend backupB
A tab0espace overf0ow
A tab0e or inde1 reachin, its MA)()'($'S 0imit
&3A8:555! snapshot too o0d
$etH 'CP.#P de0ay
&3A8:5PH! data b0ock corruption
&3A8/00! interna0 database error
Poor performance of the cost8based optimiNer
=C> SAP AG BC505 6
12.5
SAP AG 1999
"A#$78 is hanging
Database in
ARCI81,4O$
mode
Archi%er
st(c0
O''line redo log
directory saparch
4og 'ile
s)itches
,rror
ORAA55 or
ORAA5
DB-"
Online redo logs
Archi%er "t(c0 "it(ation
'he database of a production system shou0d a0ways be operated in A3C;#2(*&G mode with an
active Archi"er process.
"hen the database is in A3C;#2(*&G mode! an on0ine redo 0o, fi0e can on0y be reused after it has
been comp0ete0y archived to the off0ine redo 0o, archive directory saparch. #f the directory saparch
is fu00! the on0ine redo 0o, fi0es cannot be comp0ete0y archived! and the database wi00 enter the
archi"er stuc/ state. 'his means that no further chan,es are possib0e to the system.
#f this occurs! the &rac0e error messa,e &3A8-55 or &3A8-P- is written to the database a0ert 0o,.
'he fo00owin, is an e1amp0e of the &rac0e a0ert 0o, fi0e alert_<SID>$lo2G
'ue May :5 :0G-5G:: :55H
&3A800-55G error archivin, 0o, :: of thread :! seIuence Y :44P
&3A8004:-G on0ine 0o, :: thread :GU.orac0e.'C:.ori,0o,A.0o,E,::m:.dbfQ
&3A8004:-G on0ine 0o, :: thread :G U.orac0e.'C:.mirr0o,A.0o,E,::m-.dbfQ
&3A800446G archived 0o,G U.orac0e.'C:.saparch.'C:arch:E:44P.dbfQ
&3A8:550-G write error on fi0e K.orac0e.'C:.saparch.'C:arch:E:44P.dbfK
"hen an archiver stuck situation occurs! the 3.4 Systems han,s! and you cannot perform
transactions unti0 the on0ine redo 0o, fi0e has been comp0ete0y archived to directory saparch.
=C> SAP AG BC505 5
12.6
SAP AG 1999
-onitor directory saparch
Do not delete
or mo%e
o''line redo
log 'iles
Create a Yd(mmy 'ileY
5 times the si?e o' an
online redo log 'ile
O''line redo log
directory saparch
Reser%e three times the
amo(nt o' the space
reB(ired 'or the daily
o''line redo log 'iles
Database
Administration
logEarchi%eEstart F tr(e
in initG"8DH.ora
A%oiding an Archi%er "t(c0 "it(ation
'o avoid an archiver stuck situationG
3eserve some disk space by creatin, a Adummy fi0eB in the archive directory saparch. Make the
siNe of the dummy fi0e five times the siNe of the off0ine redo 0o, fi0e. #f saparch becomes fu00!
remove the dummy fi0e and run B3A3C;#2( immediate0y.
#f B3A3C;#2( is schedu0ed to run dai0y! ensure that saparch has enou,h disk space to ho0d at
0east three times the amount of the dai0y off0ine redo 0o, fi0es.
Monitor how fu00 saparch is.
Check the fi0e init<SID>$ora to see if parameter lo2_archi"e_start M true.
Check if user ora<SID> has write authoriNation to saparch.
"arnin,G %o not de0ete or move fi0es from the archive directory saparch.
=C> SAP AG BC505 /
12.7
SAP AG 1999
cpio or dd error=
end o' tape
reached
Rede'ine the parameter tapeEsi?e
in 'ile initG"8DH.sap
Recalc(late the compression ratio
once per bac0(p cycle
Rede'ine the parameter tapeEsi?e
in 'ile initG"8DH.sap
Recalc(late the compression ratio
once per bac0(p cycle
,rror
8ncorrect +ape "i?e 6Iard)are Comp. +ape Dri%es:
'he physica0 tape siNe =tape 0en,th X write density> is specified in the parameter tape_si8e in the fi0e
init<SID>$sap. 'he physica0 tape siNe is the tota0 vo0ume of data that can actua00y be written to a
vo0ume without compression =in MB or GB>.
#f parameter tapeEsiNe is confi,ured too 0ar,e! cpio or dd reaches the physica0 end of the tape. 'his
causes severe prob0ems when database restoration is reIuired.
"hen usin, tape devices with hardware compression! a0ways 0eave a reserve of appro1imate0y -00
MB to take account of any errors in the ca0cu0ation of the compression rate.
"hen hardware compression is used! B3BACJ9P does not receive any information about the
compression ratios for the individua0 fi0es. Lou can obtain this information from B3BACJ9P by
runnin, a dummy compression. 'o do this! run command brbackup -compressH-k only .
3eca0cu0ate the dummy compression ratios at 0east once per backup cyc0e! and after a 0ot of data
chan,e activity in the database! such as re0ease up,rades and insertin, 0ar,e amounts of data.
'o ca0cu0ate the compression ratio! use the 1b 7* option of the compression command for the
correspondin, init<SID>$sap parameter. 7or e1amp0e! the compression command parameter shou0d
be defined as fo00owsG compress_cmd D Ncompress 1b 7* 1c ! > !O$
See a0so SAP $ote HP0P.
=C> SAP AG BC505 P
12.
SAP AG 1999
Online tablespace bac0(p
ORAA!!4; or
ORAA!!!3
-issing Yend bac0(pY
Restoring data 'iles
is not necessary
alter tablespace'''begin backup
'''in backup mode'''
alter tablespace'''end backup
7se the "A#DBA to=
Chec0 )hich tablespaces are
in Be!in back#p mode
"h(tdo)n the database 'or
error ORAA!!4;
Reco%er the database 'or
error ORAA!!!3
,rror
-issing Yend bac0(pY
#f you back up a tab0espace on0ine without 3MA$! the tab0espace must be in be2in bac/up mode
durin, the backup. 'his ensures that the &rac0e data fi0e headers of the data fi0es be0on,in, to the
tab0espace in the on0ine backup mode are not updated.
#f a tab0espace is in be2in bac/up mode and the command shutdown immediate is issued in
SAP%BA! SAP%BA puts every tab0espace into end bac/up mode before the database is shutdown.
#f a tab0espace remains in be2in bac/up mode and the command shutdown immediate is issued
in svrmgrl =or command stopsap db is issued>! the database returns error &3A8::65 =missin, end
backup>.
'o check which tab0espaces are sti00 in be2in bac/up mode! use SAP%BA and choose D) 0hec/
"erification D) System 0hec/. 'he system then prompts the user whether SAP%BA shou0d set
the end bac/up automatica00y.
#f the database crashes durin, an on0ine backup! or is powered down! or is shutdown by usin,
shutdown abort! some tab0espaces may remain in the be2in bac/up mode. #n this situation!
because the tab0espaces are in online bac/up mode when you try to open the database! error &3A8
:::4 is returned.
7or &3A8:::4! you must perform a database recovery. 'o perform the recovery! use SAP%BA and
choose Partial restore and complete reco"ery database.
#f a missin, end backup error occurs! you do not need to restore any data fi0es.
'he missin, end backup error does not occur if the backup is performed with 3MA$.
=C> SAP AG BC505 H
12.!
SAP AG 1999
GtablespaceH.data
&e) dis0
Add data 'ile
+ablespace
GtablespaceH.data!
Jile si?e depends
on the estimated
increase in the
tablespace
obCects
$aps
&ot
eno(gh
'ree space
'or this
e*tent
Data obCects
8nsertions
+ablespace
#er'orm a bac0(p
a'ter e%ery change in
'ile str(ct(re
ORAA!653 or
ORAA!654
,rror
+ablespace O%er'lo)
,*tents
#f an e1tent of a ,iven siNe is reIuired in a tab0espace! but there is not enou,h conti,uous freespace
avai0ab0e in the tab0espace! &rac0e returns error &3A8:/54 =for tab0es> or &3A8:/56 =for inde1es>.
'he error messa,es are disp0ayed in both the Sys0o, fi0e and the ABAP short dump.
'o so0ve this prob0em! use SAP%BA to e1tend the tab0espace with one e1tra data fi0e. 7rom the
SAP%BA! choose &ablespace administration Alter tablespace Add Data file. #f you e1tend
severa0 tab0espaces! make sure that you p0ace the data fi0es on different disks! otherwise there may be
prob0ems with the #.& speed of disk access.
Lou must perform a backup after every chan,e in the fi0e structure.
=C> SAP AG BC505 5
12.10
SAP AG 1999
AdC(st the
ne*t e*tentQ
Chec0
300 5 4 3 ! 0
. . . . . .
ObCect
8nitial
e*tent
&e*t
e*tents
-a*,*tents
. . .
. . .
ORAA!63! or
ORAA!63
,rror
8ncrease
-a*,*tents
by 50
S
AdC(st the
ne*t e*tentQ
-onitor the n(mber o'
e*tents reg(larly
R(n sapdba -ne8t )ee0ly
AdC(st the Max5xtents
parameters
-a*,*tents 4imit is Reached
#f the number of e1tents a00ocated to an obOect reaches the ma1imum number specified in the
,ax9xtents stora,e parameter! then this obOect cannot reIuest any more e1tents. "hen this
ma1imum va0ue is reached! &rac0e reports error &3A8:/4: =for tab0es> and &3A8:/4- =for inde1es>.
'he error messa,es are disp0ayed in both the Sys0o, fi0e and the ABAP short dump.
'o avoid this prob0emG
Monitor the number of e1tents re,u0ar0y
3un sapdba -ne8t once a week
AdOust the ,ax9xtents parameters as reIuired
'o chan,e the va0ues of the ne1t parameter for tab0es and inde1es! run sapdba -ne8t.
'o chan,e the va0ues of the ,ax9xtents parameter for tab0es and inde1es! use the SAP%BA and
choose Reor2ani8ation Alter.show table or index stora2e parameters Alter.show parameters$
#f the stora,e parameter ,ax9xtents is set to unlimited! the ma1imum number of e1tents is actua00y
-!:6P!6H4!/65.
%o not chan,e ,ax9xtents to unlimited for a00 se,ments in your database. %o not set the ,ax9xtents
to unlimited on ro00back se,ments.
=C> SAP AG BC505 :0
12.11
SAP AG 1999
7pdate...
Data a'ter
(pdate
S*)*C2'''
-< fetch
*BDS*)*C2
4ong r(nning B(ery
S*)*C2'''
4ong processing time
!
O%er)ritten
rollbac0
segment
data
7pdate 3 records and commit
!
3
+ables
3
ORAA!555
!
Data be'ore
(pdate
Rollbac0 segments
,rror
ORAA!555= "napshot +oo Old
&rac0e enforces statement80eve0 read consistency. 'his ensures that the data returned by a sin,0e
Iuery is consistent with respect to the time when the Iuery be,an. 'herefore! a Iuery never sees the
data chan,es made by transactions that commit durin, the course of e1ecution of the Iuery. 9sua00y!
a 0on, runnin, Iuery has error &3A8:555 if the data accessed by the Iuery is updated and
committed by another user or session after the Iuery has been started.
'he most common reasons for error &3A8:555 =snapshot too o0d> areG
A 0on, runnin, Iuery due to a poor0y Iua0ified data access
A hi,h processin, time between fetches of the same Iuery
#ncorrect ro00back se,ment setup
A 0on, run Iuery can cause some activities in the ABAP pro,ram 0oop to take too 0on,! even if the
S+* statement is correct. 7or e1amp0eG
S*)*C2 '''
Fetch =a 0on, runnin, activity>
*BDS*)*C2
Before you try to chan,e the number or siNe of the ro00back se,ments! check if the prob0em is caused
by e1pensive Iueries! such as inefficient app0ication desi,n! wron, inde1 desi,n! or insufficient cost8
based optimiNer statistics. Lou can adOust the ro00back se,ment setup by addin, more ro00back
se,ments or makin, them 0ar,er.
=C> SAP AG BC505 ::
12.12
SAP AG 1999
tnsnames.ora
sBlnet.ora
listener.ora
protocol.ora
ORAC4,EIO-,
/net)or0/admin
&et@ &et@
+C#/8# +C#/8#
Database ser%er
4istener process
"hado) process
"hado) process
"hado) process
"hado) process
2ait 'or 00ms to
'ill the &et@ +C#/8#
pac0ets ca(sing
poor per'ormance
&et@ +C#/8# pac0et
tnsnames.ora
sBlnet.ora
protocol.ora
ORAC4,EIO-,
/net)or0/admin
Remote
application ser%er
R/3 )or0 processes
R/3 )or0 processes
R/3 )or0 processes
R/3 )or0 processes
Delay
&et@ +C#/8# Delay
$etH is the &rac0e communication 0ayer between the c0ient =app0ication servers> and the database
server. *oca00y! it uses inter process communication =#PC>S remote0y! it uses 'CP.#P.
"hen you confi,ure $etH! you can choose to open the connection with de0ay or no8de0ay for
'CP.#P. By defau0t! &rac0e opens the connection in delay mode! which a00ows the 'CP.#P
imp0ementation on the operatin, system to de0ay sendin, ha0f8empty 'CP packets. 'he wait cyc0e is
appro1imate0y -00ms! which s0ows down the communication speed in 3.4.
'o so0ve this prob0em! perform the fo00owin, stepsG
%own0oad the fi0e protocol$ora from sapser"M
As user ora<SID>! copy this fi0e into the &3AC*(E;&M(.network.admin directory of the
database server and every app0ication server =even thou,h '$SEA%M#$ may point to a different
directory>
Give read permission for fi0e protocol$ora to users <SID>adm and ora<SID>
3estart the $etH 0istener on the database server
Stop and start a00 the app0ication servers.
7or further information! see SAP $ote P-/4H =9ni1> and SAP $ote :4-54P ="indows $'>.
=C> SAP AG BC505 :-
12.13
SAP AG 1999
Data 'ile
"A# &ote "earch
BC-DB-!R" C.m6.*e*&
Sea%'0 C%i&e%ia
!R"-1578
A *
Oracle
bloc0
ORAA!55@
,*tents
,rror
ORAA!55@= Data Bloc0 Corr(ption
(rror &3A8:5PH indicates a data b0ock corruption. %ata b0ock corruption usua00y occurs because of a
hardware error! and in most cases! remains undetected unti0 the corrupted information is reIuired.
7or further information! see SAP $otes :455- and -4465 or search for 0atest SAP $otes about error
&3A8:5PH.
&nce the hardware prob0em that caused the data b0ock corruption has been so0ved! you may need to
restore and recover parts of the database. #f an inde1 b0ock is corrupted! you can drop and re8create
the inde1.
"hen a norma0 backup is performed! a corrupted data b0ock wi00 remain undetected. 'o detect data
b0ock corruption ear0y! perform a database verification at 0east once in your backup cyc0e.
'o detect the corrupted data b0ock! do one of the fo00owin,G
9se command brbackup -verifyH-w only0dbvHuse0dbv durin, a norma0 backup! or
use the SAP%BA and choose / 1 D) chec/."erification D) "erification usin2 D) =9RI@H
9se profi0e parameter dis/_copy_cmdDrman to do the backup! because 3MA$ automatica00y does
a verify when it copies the b0ocks.
=C> SAP AG BC505 :4
12.14
SAP AG 1999
saptrace/bac0gro(nd
alertEG"8DH.log
"A# &ote "earch
BC-DB-!R" C.m6.*e*&
Sea%'0 C%i&e%ia
!R"-600
12700
A *
3on 3ay // /4+&.+-/ /DD,
*rrors in file
/oracle/B1B/rdbms/log/ora0/6-E'trc+
#R!---(--+ internal error code5
arguments+ I/6E--J5I66/.J5 I/-E4EEE,/&J5
I&J5 IJ5 IJ5 IJ5 IJ
3on 3ay // /4+&.+-/ /DD,
*rrors in file
/oracle/B1B/rdbms/log/ora0/6-E'trc+
#R!---(--+ internal error code5
arguments+ I/6E--J5I66/.J5 I/-E4EEE,/&J5
I&J5 IJ5 IJ5 IJ5 IJ
Create Original -essage *
BC-DB-!R" C.m6.*e*&
S0.%& Te,&
"%-4me*&
!R"-600 +e&e'&e+
12700
A
ORAA600
,rror
ORAA600= 8nternal Database ,rror
&3A8/00 indicates an interna0 database error.
3ecord the first ar,ument of the &3A8/00 error messa,e. #n this e1amp0e! the first ar,ument is
:-P00.
Search for any SAP $otes re0ated to &3A8/00 and the first ar,ument.
#f no SAP $otes correspond to the particu0ar &3A8/00 prob0em! create a customer messa,e in
SAP$et! and attach the re0ated trace fi0es! a0ertE?S#%@.0o,! and 3.4 Sys0o,.
(rror &3A8/00 is often fo00owed by a state dump in the trace fi0es. 'hese trace fi0es are found in
directory saptrace.bac/2round or saptrace.usertrace. 'he a0ertE?S#%@.0o, is in the directory
saptrace.bac/2round.
=C> SAP AG BC505 :6
12.15
SAP AG 1999
#er'ormance -emory "tr(ct(re Bac0(p/Reco%ery All database operations
All #er'ormance operations 6 :
8n'l(ence o' the CostABased Optimi?er
Old statistic
in'ormation can ca(se
serio(s per'ormance
problems
'he cost8based optimiNer determines the most efficient access path based on ana0yNed statistics for
tab0es and inde1es. &utdated or incorrect statistics can cause severe performance prob0ems.
'o prevent the cost8based optimiNer usin, an inefficient access path that cou0d cause performance
prob0ems! you must update the statistics re,u0ar0y.
#n case of ,enera0 performance prob0ems! check whether the statistics are up8to8date first. 'o do this!
disp0ay the D) peration ,onitor =transaction D)*(> and choose Performance.
=C> SAP AG BC505 :5
12.16
SAP AG 1999
7nit "(mmary
&o) yo( are able to=
Recogni?e and pre%ent the problems that occ(r most
'reB(ently )hen R/3 is installed on an Oracle database
=C> SAP AG BC505 :/
13
SAP AG 1999
Concl(sion
! Database O%er%ie) 6 Ad%anced Bac0(p +echniB(es
Bac0(p "trategy and
+ape -anagement
5 "torage -anagement
3 "ched(lingD #er'ormingD
and -onitoring Bac0(ps
@ #er'ormance -onitoring
4 Restore and Reco%ery ; +op !0 #roblems
5 Bac0(p "trategies
7sing R-A&
=C> SAP AG BC505 :
13.2
SAP AG 1999
<o( are no) able to=
De'ineD per'orm and monitor an appropriate
bac0(p strategy
-onitor and administrate yo(r R/3 Oracle system
by (sing the
R/3 database monitors
Database administration tools o''ered by "A#
8denti'y per'ormance problems by monitoring the
R/3 "ystem
Concl(sion
=C> SAP AG BC505 -
13.3
SAP AG 1999
+echnical Core Competence A
/no)ledge #rod(ct
Online Doc(mentation
&otes in the application area BCA
DBAORA
"A# +ech&et
"A#&et
Delta0ios0 in the "A#&et
J(rther Doc(mentation
=C> SAP AG BC505 4
13.4
SAP AG 1999
-en( #aths
Contents=
Appendi*
=C> SAP AG BC505 6
13.5?re>8entl9 (sed 2en8 :at$s
+ransA
action
+itle -en( #ath
-/01 AnalyGe :1cl4sive *oc,)aits ools Administration %onitor
Per(ormance -ata.ase :1cl4sive
loc, )aits
-/02 AnalyGe a.les and "nde1es ools CC%S Con(i&4ration *o&on
&ro4#s
-/03 Parameter C!an&es in
-ata.ase
ools Administration %onitor
Per(ormance -ata.ase Parameter
C!an&es
-/12 -/ /ac,4# %onitor ools CC%S -/ Administration
/ac,4# lo&s
-/13 -/A Plannin& Calendar ools CC%S -/ Administration
-/A Plannin& Calendar
-/16 -/ System C!ec,? %onitor ools CC%S -/ Administration
-/ System C!ec, -is#lay alerts
-/18 -/ System C!ec,?
Con(i&4ration
ools CC%S -/ Administration
-/ System C!ec, Con(i&4ration
-/21 -/ Cost-/ased $#timiGer?
Con(i&4ration
ools CC%S -/ Administration
Cost-.ased o#timiGer Con(i&4ration.
-/24 -ata.ase $#erations %onitor ools CC%S -/ Administration
$#erations monitor
RI20 CC%S %onitorin& ools CC%S Control/%onitorin&
Alert monitor
S:12 A/AP/4 -ictionary -is#lay 0se transaction S:11
S:11 A/AP/4 -ictionary -is#lay ools A/AP +or,.enc!
-evelo#ment A/AP -ictionary
S%21 $nline System *o& Analysis ools Administration %onitor
System lo&. $r? est System lo& 3(rom
t!e A/AP/4 -evelo#ment +or,.enc!
initial screen5
S%31 %aintain a.le 6ie)s System Services a.le maintenance
:1tended ta.le maintenance
S%66 System)ide +or, Process
$vervie)
ools CC%S Control/%onitorin&
All )or, #rocesses
S04 Select -/ Activities ools Administration %onitor
Per(ormance -ata.ase Activity
S06 $#eratin& System %onitor Drom t!e Per(ormance %onitorin& screen?
$#eratin& system *ocal Activity
=C> SAP AG BC505 5
+ransA
action
+itle -en( #ath
S22 A/AP -4m# Analysis ools A/AP +or,.enc! est
+or,.enc! -4m# Analysis
=C> SAP AG BC505 /