Vous êtes sur la page 1sur 56

Sebastian Schreckenbach

SAP® D a ta b a s e
A d m in is tra tio n fo r
AAicrosoft®SQL S erver

© Rheinwerk®
Publishing

Bonn • Boston
W h a t Y o u 'll Learn

Every SAP system has a database that needs to be managed. One o f the
easiest non-SAP databases to manage is the M icrosoft SQL Server. In this
E-Bite, w e discuss typical database-agnostic adm inistration tasks as well as
the m ost im portant database-specific details for M icrosoft SQL Server,
using step-by-step instructions and guiding screenshots.

1 M anaging Database Administration T a s k s ...................................... 5


1.1 Planning Database T a s k s ........................................................... 6
1.2 Changing and Deleting Database Tasks .................................. 10
1.3 Checking the DBA PlanningCalendar ..................................... 14
2 Checking D atabase Actions ................................................................ 16
3 Performing a D atabase A n a ly sis......................................................... 19
4 M onitoring D atabase P erform ance.................................................... 25
5 Using SQL Server M anagem ent Studio .......................................... 30
6 Starting and Stopping th e D atabase ............................................... 33
7 Storing Data on the Hard D is k ........................................................... 36
7.1 Pages and B locks......................................................................... 36
7.2 File Groups and F iles.................................................................. 38
7.3 Transaction Logs (L o g s)............................................................. 39
8 Initiating a Backup Process ................................................................ 41
9 Setting Up M aintenance Plans for a B ackup................................... 45
10 Backing Up System D a ta b a s e s ........................................................... 51
10.1 master D a ta b a s e ......................................................................... 53
10.2 msdb and model D atabases...................................................... 53
11 Accessing the SQL Server L o g s.......................................................... 54
12 W hat's N e x t? ......................................................................................... 55

4
1 M a n a g in g D a ta b a se A d m in is tra tio n Tasks

The database is an im portant com ponent w ithin the SAP system architec­
ture. In addition to the files at the operating system level, the database
contains the ABAP programs, system settings, and data required to oper­
ate the SAP system.

D epending on the size o f y o u r enterprise and the way in w hich it's orga­
nized, database adm inistration is also one o f the tasks o f the SAP adm in­
istrator. In this case, you require extensive know ledge o f database sys­
tems, in general, and knowledge o f the database system used for y o u r
SAP system, in particular. In some cases, how ever, database system
adm inistration is organizationally separate from SAP Basis m aintenance.
Then, you only need to have general know ledge o f database manage­
m ent, w hich will form part o f this section.

The M icrosoft SQL Server is the easiest non-SAP database system to m an­
age. The SQL Server is nevertheless a complex "enterprise-grade" data­
base system that, first, dem ands full attention and, second, dem ands that
the adm inistrator acquire the requisite expertise to manage it. If the SQL
Server contains enterprise-critical data, adm inistration can't be o f a
"casual" nature. The SQL Server is now suitable for large environm ents
w ith high perform ance requirem ents.

Database adm inistration w ith the M icrosoft SQL Server database will be
the topic o f our E-Bite. In this section, w e'll begin by introducing y o u to
the general tasks, SAP tools, and procedures y o u will use as a database
adm inistrator. Specifically, w e'll focus on the planning o f database tasks,
how to change and delete database tasks, and how to use the DBA Plan­
ning Calendar.

Transaction DBACOCKPIT
The functions described in the following subsections can also be accessed
centrally via the DBA Cockpit (Transaction DBACOCKPIT). We'll nevertheless
describe the transactions individually so that you can decide whether to use
the central screen (available via Transaction DBACOCKPIT) or to call each

5
M a n a g in g D a ta b a s e A d m in is tr a tio n T a s k s | 1

special transaction directly. If individual transactions aren't intended specifi­


cally for your database system, the system either informs you of this when
calling the transaction or directs you to Transaction DBACOCKPIT. Because
the DBA Cockpit view may vary depending on the database system, we
w on't make any general statements in this E-Bite.

1.1 P la n n in g D a ta b a s e Tasks

In the SAP system, the Database A dm inistration Planning Calendar (DBA


Planning Calendar; Transaction DB13) is available for planning database
adm inistration tasks. The DBA Planning Calendar is a planning tool for
database adm inistration. You can use this calendar to plan periodic recur­
ring database tasks such as the following:

» Archiving log files


» Reorganizing
» U pdating statistics
» Backing up the database
» Backing up the database log and transaction log
» Backing up the difference database
» Checking database inconsistencies
» Initializing tapes

M anaging and planning tasks from w ithin the SAP system is easier than
using the com m and-line interface because you can manage and plan the
tasks com fortably w ithout having to call the tools o f the respective data­
base m anufacturer. The tasks are automatically executed in the intervals
that y o u define. All you have to do is perform certain preparatory tasks
(e.g., providing tapes for backup purposes) and check the results.

In this section, you'll learn how to plan new database adm inistration tasks
that are to be perform ed regularly. Follow these steps:

6
M a n a g in g D a ta b a s e A d m in is tr a tio n T a sks | 1

1. Enter Transaction DB13 in the com m and field and press the I Enter | key
(or select the m enu option T ools • CCMS • DB A dministration • P lan ­
n in g Calendar • DB13 —Local).

2 The DBA P lanning Calendar screen is displayed (see Figure 1). To


plan a database adm inistration task, select a date and time in the calen­
dar, and choose A d d .

& Administration EcSt goto System Help

v] « I Q Q O ns
© : C) G ♦ J ♦ J T in q *
Jobs: DBA Planning Calendar
I ■§) Refresh Display<->Change
— _Day Week Month Save Settings ... Legend ...
DBAPlannng Calendar Action Pad
System V14 2015/1 2015, Offline Complete DBBackup +Redo Logs
WN 52 1 2 3 4 5 6 7 Complete Online DBBackup
Category DBAActions v MO 22 29 5 12 19 26 2 9 ] Offline Complete DBBackup
TU 23 3U 6 13 20 27 3 10 1 Oriine Complete DBBackup +Redo Logs
CalendarlD | v WE 24 31 7 14 21 28 4 11 J Check Database
TH 25 1 8 15 22 29 5 12 J* Clean Up Logs
FR 26 2 9 16 23 30 6 13 <v Compress Database *
<> <> Ful Database Offline Backup +Redo Log v

0 Action Details Edit Delete Add v Execute Pattern Setup - Cleanup Tapes
February
Week "■ Monday Tuesday Wednesday Thursday Friday Saturday Sunday
2015'.. January, 19 January, 20 January, 21 January, 22 January, 23 January, 24 January, 25
05:00:00 Update 05:00:00 Update 05:00:00 Update 05:00:00 Update 05:00:00 Update 04:00:00 NextExt.. 06:00:00 VerifyDf
06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 Cleanup..

2015’.. January, 26 January, 27 January, 28 January, 29 January, 30 January, 31 February, 01


05:00:00 Update... 05:00:00 Update. 05:00:00 Update.. 05:00:00 Update... 05:00:00 Update... 04:00:00 NextExt... 06:00:00 VerifyDf
06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 Cleanup..

2015’. February, 02 February, 03 February, 04 February, 05 February, 06 February, 07 February, 08


05:00:00 Update... 05:00:00 Update.. 05:00:00 Update.. 05:00:00Update. 05:00:00 Update... 04:00:00 NextExt... 06:00:00 VerifyDf
06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 CheckDB 06:00:00 Cleanup..

2015’.. February, 09 February, 10 February, 11 February, 12 February, 13 February, 14 February, 15

■ V14 Database connection DEFAULT estabSshed successfully

Figure 1 DBA Planning Calendar

7
M a n a g in g D a ta b a s e A d m in is tr a tio n T a sks 1

3, In the Schedule a N ew A ction dialog box, choose the task you require
(e.g., Check D atabase) in the A ction field. In the P lanned Start fields,
en ter the start date and start tim e (see Figure 2).

Figure 2 Planning a New Database Job

4 Switch to the Recurrence tab. In the Recurrence Pattern area, specify


the intervals in which the action is to be executed (e.g., every three days
at 02:00; see Figure 3). Click on A d d .

8
M a n a g in g D a ta b a s e A d m in is tr a tio n T a sks 1

Dr Schedule a New Action

Action Description
Action Check Database 1 /1
Planned Start “ 01/25/2015 0 14:00:00
Status

Action Parameters

Recurrence Pattern
Every
Day(s) at 00:00 01:00 V 02:00 03:00 04:00 05:00
06:00 07:00 08:00 09:00 10:00 11:00
12:00 13:00 14:00 15:00 16:00 17:00
18:00 19:00 20:00 21:00 22:00 23:00
Hour(s)
Week(s) on □ Hon □ Tue □W ed □'T hu £] Fri □ Sat QSun
Once only

Recurrence Range
Start 01/25/2015 a t 14:00:00 • No end date
End after Occurrences
End by a t 00:00:00

Execute action every 3 day(s) at 14:00

l Add ] X Cancel ^ Execute Immediately

Figure 3 Defining the Start Time and Recurrence

5 In the low er screen area, the system issues a message indicating that the
action has been added to the calendar. The scheduled actions are dis­
played in the weekly view (see Figure 4).
You've now scheduled the database action y o u require, w hich will be
autom atically executed at the defined start time.

9
M a n a g in g D a ta b a s e A d m in is tr a tio n T a sks | 1

&■ Administration Edrt Goto System Help

o [ 3 « isi o o o Tfhtt q q o q nn © *
Jobs: DBA Planning Calendar
, "0 Refresh ^ Display<->Change Day Week Month Save Settings... Legend ...
DBAPlanning Calendar Action Pad
System V14 2015/1 2015; Offline Complete DBBackup + Redo Logs
WN 52 1 2 3 4 5 6 7 Complete Online DBBackup
MO 22 29 5 12 19 26 2 9 3 Offline Complete DBBackup
Category DBAActions
TU 23 30 6 13 20 27 3 10 ] Online Complete DBBackup + Redo Logs
CalendarlD WE 24 31 7 14 21 28 4 11 1 Check Database
TH 25 1 8 15 22 29 5 12 U Clean Up Logs
FR 26 2 9 16 23 30 6 13 Compress Database A

< > < > Ful Database Offine Backup + Redo Log V

Q Action Details ./Edit U Delete ‘ Add ✓Execute Pattern Setup n Cleanup - Tapes
January 2015, Calendar Week 04
Monday, 19 Tuesday, 20 Wednesday, 21 Thursday, 22 Friday, 23 Saturday, 24 Sunday, 25
00:00
01:00
02:00
03:00
04:00 NextExtent
05:00 UpdateStats UpdateStats UpdateStats UpdateStats UpdateStats
06:00 CheckDB CheckDB CheckDB CheckDB CheckDB CleanupLogs VerifyDB
07:00
08:00
09:00
10:00
11:00
12:00
13:X
14:00 CheckDB
15:X
16:X
17:X
18:X
E B i t a i i p i E t i ] ___________
■ V14 Action has been added to calendar

Figure 4 Weekly View of Planned Actions

1.2 C h a n g in g an d D e le tin g D a ta b a s e Tasks

You can retroactively edit tasks that haven't been executed yet. You can
change the action param eters, or y o u can delete the tasks from the DBA
Planning Calendar.

10
M a n a g in g D a ta b a s e A d m in is tr a tio n T a s k s | 1

1. Call Transaction DB13.


2, In the DBA P lanning Calendar screen, navigate to the required date.
Position y o u r cursor on the planned task that y o u w ant to change. Click
on E dit (see Figure 5).

& &dmnistration £dit Goto System Help

© - « © o © 7171 © ^
Jobs: DBA Planning Calendar
H ^Refresh Display<->Change Day Week Month ? Save Settngs... Legend

DBAPlanmg Calendar Action Pad


System 2015/1 2015, Offlne Complete D6 Backup + Redo Logs
WN 52 1 2 3 4 5 6 7 Complete Onlne DBBackup
MO 22 29 5 12 19 26 2 9 3 Offline Complete DBBackup
Category DBAActions
TU 23 30 6 13 20 27 3 10 3 Online Complete DBBackup + Redo Logs
CalendarlD WE 24 31 7 14 21 28 4 11 1 Check Database
TH 25 1 8 15 22 29 5 12 3a CleanupLogs
FR 26 2 9 16 23 30 6 13 Compress Database
< > < > Full Database Offline Backup + Redo Log v

0 Action Detailsj Edit Detete Add v Execute 'ri Pattern Setup n Cleanup Tapes
February 2015, Calendar Week 05
- Monday, 26 Tuesday, 27 Wednesday, 28 Thursday, 29 Friday, 30 Saturday, 31 Sunday, 1
00:00
01:00
02:00 CheckDB 'CheckDB CheckDB
03:00
04:00 NextExtent
05:00 UpdateStats UpdateStats UpdateStats UpdateStats UpdateStats
06:00 CheckDB CheckDB CheckDB CheckDB CheckDB CleanupLogs VerifyDB
07:00
08:00
09:00

Figure 5 Editing an Action in the DBA Planning Calendar

3, You can adjust the action param eters for the task in the Edit D etails of
A ction dialog box (see Figure 6). You can also change recurrence data
such as the start date/tim e and recurrence interval here. If y o u r adjust­
m ent applies only to the action on the day selected, choose Change
Current O ccurrence . If you w ant the change to apply to all other peri­
odic recurrence dates, click on Change A ll O ccurrences .

11
M a n a g in g D a ta b a s e A d m in is tr a tio n T a s k s | 1

&• Edit Details of Action

Action Check Database - M ◄ > M 1 /1


Planned Start “ 01/29/2015 02:00:00
Status Planned

Action Parameters

Recurrence Pattern
Every
Day(s) at 00:00 01:00 02:00 V 03:00 04:00 05:00
06:00 07:00 08:00 09:00 10:00 11:00
12:00 13:00 14:00 15:00 16:00 17:00
18:00 19:00 20:00 21:00 22:00 23:00
Hour(s)
Week(s) ]Tue DWed □ T h u D F r i Q S a t QSun
Once only

Recurrence Range
Start 01/29/2015 a t 02:00:00 • No end date
End after 0 Occurrences
End by a t 00:00:00

Execute action every 3 day(s) at 02:00

Change Current Occurrence Change All Occurrences ^ ✓ Execute Immediately Delete X Cancel

Figure 6 Adapting the Action Parameters

The system issues a message indicating that the action has been success­
fully changed.

4 If y o u w ant to delete an action, position y o u r cursor on the task, and


click on D elete (see Figure 7).

12
M a n a g in g D a ta b a s e A d m in is t r a t io n T a s k s | 1

6 A dialog box for one-tim e planned actions is also displayed (see Fig­
ure 9). Confirm this by choosing D elete again.

Figure 9 Deleting One-Time Planned Actions

By deleting the action, you rem ove it from the DBA Planning Calendar
and undo the occurrence.

1.3 C h ec kin g th e D B A P la n n in g C a le n d a r

You can also use the DBA Planning Calendar to check the status o f a data­
base adm inistration task. For example, y ou can use the DBA Planning Cal­
endar to check w hether or not a task has been successfully perform ed by
following these steps:

1 Call Transaction DB13.


2 Check the colors assigned to the tasks in the calendar view. The color
indicates the status:
Red: Error
Yellow: W arning
Green: Success
Blue: Currently running
3 Position y o u r cursor on the action you require, and click on A ction
D etails to check the log (see Figure 10).
4 In the D isplay D etails of A ction w indow , sw itch to the J ob Log tab
(see Figure 11).

14
M a n a g in g D a ta b a s e A d m in is tr a tio n T a s k s | 1

S ' Administration Edit Goto System Help

O - « o © o h tt a g o o n n o *
Jobs: DBA Planning Calendar
Refresh Week Month Save Settings ... Legend
DBAPlanting Calendar Action Pad
System V14 2015/1 2015, Offline Complete DBBackup + Redo Logs
WN 52 1 2 3 4 5 6 7 Complete Online DBBackup
DBAActons MO 22 29 5 12 19 26 2 9 1 Offline Complete DBBackup
Category V
TU 23 30 6 13: 20 27 3 10 1 Onlne Complete DBBackup + Redo Logs
WE 24 31 7 14 21 28 4 11 1 Check Database
TH 25 1 8 15 22 29 5 12 ]A Clean Up Logs
FR 26 2 9 16 23 30 6 13 ; v Compress Database *
< > < > FuJ Database Offtne Backup + Redo Log v

0 Action Details Edit Delete Add v Execute Pattern Setup e Cleanup Tapes
February 2015, Calendar Week 05
Monday, 26 Tuesday, 27 Wednesday, 28 Thursday, 29 Friday, 30 Saturday, 31 Sunday, 1
00:00
01:00
02:00 ChprknR rhprkDR
03:00 1 jCheckDB CheckDB
04:00 NextExtent
05:00 UpdateStats UpdateStats UpdateStats UpdateStats UpdateStats
06:00 CheckDB CheckDB CheckDB CheckDB CheckDB CleanupLogs VerifyOB
07:00

Figure 7 Deleting an Action from the Calendar

5, For periodically scheduled tasks, the system displays a dialog box in


w hich you m ust select the execution times to be deleted (see Figure 8).
Set the checkmark, and click on D elete.

Confirm Actions to be Deleted

Select entry if all occurrences of a


recurring action are to be deleted.

Day Date Time Description


V Friday 01/30/2015 02:00:00 Check Database

/ Delete ^X cancel r. Fk *

Figure 8 D eleting Periodically Scheduled Actions

13
C h e c k in g D a ta b a s e A c t io n s | 2

Cr Display Detais of Action :


Action Description
Action Check Database v M[ « ] [ ► ! ] 1/ 1
Planned Start ~ 01/27/2015 0 06:00:00
Status Finished with warning
Action Started “ 01/27/2015 006:00:11
Action Finished 01/27/2015 06:00:54

Action Parameters Recurrence Action Log

01/27/2015 06:00:54
01/27/2015 06:00:54 BR0280I BRCONNECT time stamp: 2015-01-27 06:00:53
01/27/2015 06:00:54 BR0977I Checking database profile...
01/27/2015 06:00:54 BR0978W Database profile alert - level: WARNING, parameter: DB.FILES, value: 200 (< 254)
01/27/2015 06:00:54 BR0978W Database profile alert - level: WARNING, parameter: LOG_BUFFER, value: 14245888 (<
01/27/2015 06:00:54 BR0978W Database profile alert - level: WARNING, parameter: MAX_DUMP_FILE_SIZE, vaLe: US
01/27/2015 06:00:54 BR0978W Database profile alert - level: WARNING, parameter: OPTIMIZERJNDEX_COST_ADJ, v
01/27/2015 06:00:54
01/27/2015 06:00:54 BR0280I BRCONNECT time stamp: 2015-01-27 06:00:53
01/27/2015 06:00:54 BR0980I Number of changed database profile parameters: 0
01/27/2015 06:00:54
01/27/2015 06:00:54 BR0280I BRCONNECT time stamp: 2015-01-27 06:00:54
01/27/2015 06:00:54 BR0955I Number of signaled error/warning/exception alerts for database administration: 0/1/0
01/27/2015 06:00:54 BR0956I Number of signaled error/warning/exception alerts for database operations: 0/0/0
01/27/2015 06:00:54 BR0957I Number of signaled error/warning/exception alerts for database messages: 0/0/0
01/27/2015 06:00:54 |'BR0958I Number of signaled error/warning/exception alerts for database profile: 0/4/0
01/27/2015 06:00:54
01/27/2015 06:00:54 BR0806I End of BRCONNECT processing: cepsmvpb.chk2015-01-27 06:00:54
01/27/2015 06:00:54 BR0280I BRCONNECT time stamp: 2015-01-27 06:00:54
01/27/2015 06:00:54 BR0803I BRCONNECT completed successfully with warnings
01/27/2015 06:00:54 lob finished

< > < >

s/ Continue ^ Re-Execute X Cancel

Figure 11 Checking the Job Log

2 C hecking D a ta b a se A ctions

You can use Transaction DB12 (Backup Logs) to check the actions exe­
cuted using the DBA Planning Calendar. This transaction gives y o u central
access to the DBA action logs for tasks such as database backups. Let's first
take a look at the backup logs:

16
C h e c k in g D a ta b a s e A c t io n s | 2

1. Enter Transaction DB12 in the com m and field and press the I Enter I key
(or select the m enu option T ools • CCMS • DB A dministration •
DB12 —Backup Logs ).
2, On the Backup Logs : O verview for Database V I4 screen, choose the
D isplay Log button in the D atabase backups area to check the time and
content o f the last database backup (see Figure 12).

Figure 12 Initial Screen o f the Backup Logs

17
M a n a g in g D a ta b a s e A d m in is tr a tio n T a s k s | 1

5 Check the jo b log, for example, for w arnings o r e rro r messages. You can
double-click on a log entry to display the long text o f the message. To
exit the detail view, choose Continue .

Cr Administration Edit Goto System yelp

O 3«ei OOO T in Q %
Jobs: DBA Planning Calendar
Refresh Display<->Change Day Month ‘ Save Settrigs... Legend
DBAPlanning Calendar Action Pad
System .0 2014/11 2014/ Offlrie Complete D6 8ackup + Redo Logs
WN 43 44 45 46 47 48 49 50 S Complete Onlne D6 Backup
Category DBAActions MO 20 27 3 10 17 24 1 8 1 Offline Complete D6 Backup
TU 21 28 4 11 18 25 2 9 ] Online Complete D6 Backup + Redo Logs
CalendarlD WE 22 29 5 12 19 26 3 10 ] Check Database
TH 23 30 6 13 20 27 4 11 U Clean Up Logs
FR 24 31 7 14 21 28 5 12 ] v Compress Database
< > < > Full Database Offline Backup + Redo Log v

0 Action Details “ d- v Execute & Pattern Setup n Cleanup Tapes


November 2014, Calendar Week 46
Monday, 10 Tuesday, 11 Wednesday, l'< Thursday, 13 Friday, 14 Saturday, 15 Sunday, 16
00:00
01:00
02:00
03:00
04:00 NextExtent
05:00 UpdateStats UpdateStats UpdateStats UpdateStats UpdateStats.
06:00 CheckDB CheckDB CheckDB CheckDB CheckDB CleanupLogs VerifyOB
07:00
08:00
09:00
mm

Figure io Calling Details of a Database Action

6 In the detail view, you can directly go to the A ction log tab. You can
also check the action logs o f the database jo b separately using Transac­
tion DB14 (see Section 2).

At least once a day (preferably every m orning), check w hether the data­
base actions, which are usually scheduled for nighttim e, have been suc­
cessfully executed.

15
C h e c k in g D a ta b a s e A c t io n s | 2

3, The files that have been backed up are listed in the action log (see Figure
13). Click Back © to exit the view.

& List Edit Goto System Help

o v «BI © Q © S t i l t nn © *
BRBACKUP Action Log for Database V14
^ Detail Loo A ► i ? Y @

BRBACKUP Action Log for Database V14


From: 01/26/2015 00:10:03
LogFile: bepsgsrz.and
Return Code: 0000 Success
Database Host: v14

Tape Position 8ackup Time Compressn CF ID Back. IDRedo No. Tabfespace TS Stat. DF Stat. He Name
0 01/26/2015 00:10:20 469.58 4 7,668 PSAPSAUX ONLINE ONLINE /orade/V14/sapdatal/saux_l/saux.data1
0 01/26/2015 00:15:34 6.04 5 7,668 PSAPSR3 ONLINE ONLINE /orade/V14/sapdata3/sr3_l/sr3.datal
0 01/26/2015 00:21:47 5.32 6 7,668 PSAPSR3 ONLINE ONLINE /orade/V14/sapdata3/sr3_2/sr3.data2
0 01/26/2015 00:26:47 7.04 7 7,668 PSAPSR3 ONLINE ONLINE /orade/V14/sapdata3/sr3_3/sr3.data3
0 01/26/2015 00:33:05 6.94 8 7,668 PSAPSR3 ONLINE ONLINE /orade/V14/sapdata3/sr3_4/sr3.data4
0 01/26/2015 00:38:32 6.06 9 7,668 PSAPSR3 ONLINE ONLINE /orade/V14/sapdata3/sr3_5/sr3.data5
0 01/26/2015 00:58:21 6.47 10 7,669 PSAPSR3740X ONLINE ONLINE /orade/V14/sapdata2/sr3740x_l/sr3740x.datal
0 01/26/2015 01:01:14 2.93 11 7,669 PSAPSR3740X ONLINE ONLINE /orade/V14/sapdata2/sr3740x_2/sr3740x.data2
0 01/26/2015 01:12:16 1.52 17 7,669 PSAPSR306 ONLINE ONLINE /orade/Vl4/sapdata4/sr3db_l/sr3db.datal
0 01/26/2015 01:19:00 1.53 18 7,669 PSAPSR308 ONLINE ONLINE /orade/V14/sapdata4/sr3db_2/sr3db.data2
0 01/26/2015 01:24:27 1.73 19 7,669 PSAPSR306 ONLINE ONLINE /orade/V14/sapdata4/sr3db_3/sr3db.data3
0 01/26/2015 01:24:30 5.58 16 7,669 PSAPSR3USR ONLINE ONLINE /orade/V14/sapdata4/sr3usr_l/sr3usr.data1
0 01/26/2015 01:31:51 3.48 2 7,669 PSAPUNDO ONLINE ONLINE /orade/V14/sapdatal/undo_l/undo.data1
0 01/26/2015 01:32:15 7.44 3 7,669 SYSAUX ONLINE ONLINE /orade/Vl4/sapdatal/sysaux_l/sysaux.datal
0 01/26/2015 01:32:58 5.61 1 7,669 SYSTEM ONLINE SYSTEM /orade/Vl4/sapdatal/system_i/system.datal
0 01/26/2015 01:33:01 65.86 0 7,668 /orade/V14/sapbackup/cntrfV14.dbf

Figure 13 Displaying the Backup Log

4 On the Backup Logs : O verview for Database V I4 screen (see Figure


12), choose List of Logs to navigate to the list o f all database actions
th at have been perform ed.
5 The individual database backups are listed in descending order by date
(see Figure 14). The Function column specifies w hat has been backed
up (e.g., all), how the backup was done (e.g., online / offline), and to
w hich m edium it was saved (e.g., disk). Double-click on a backup to go
to the corresponding action log. Click on Back © to return to the initial
screen.

18
P e r f o r m in g a D a t a b a s e A n a ly s is 3

& Logs System Help

© v « !■ © q © Q Q Q Q

Backup Logs: Database Backups for Database V14


] *?] Refresh

Backup Logs
^ r
DB tome V14 ^Started • 01/25/2015
DB Server I v!4 0 06:18:24
DB Release 11.2.0.3.0

m ' [ ^ H S E S D T T ] 11> -n: - 1 m k m - -


Function Operation Start Operation End RC Action ID/Log
all, online, dsk 01/26/2015 00:10:03 01/26/2015 01:33:07 0000 bepsgsrz.and
all, onlne, disk 01/19/2015 00:10:04 01/19/2015 01:18:47 0000 bepqyiam.and
all, online, disk 01/12/2015 00:10:07 01/12/2015 01:23:03 0000 bepppxjb.and
all, onlne, dsk 01/05/2015 00:10:08 01/05/2015 01:50:02 0000 bepohmro.and
all, onlne, disk 12/29/2014 00:10:05 12/29/2014 02:12:28 0000 bepmzbzx.and
all, onlne, disk 12/22/2014 00:10:10 12/22/2014 03:00:23 0000 beplqrio.and
all, onlne, disk 12/15/2014 00:10:09 12/15/2014 02:35:58 0000 bepkigqz.and
all, onlne, disk 12/08/2014 00:10:05 12/08/2014 01:34:17 0000 bepizvzh.and
all, onlne, dsk 12/01/2014 00:10:23 12/01/2014 01:40:33 0000 bephrlil.and
all, onlne, dsk 11/25/2014 10:26:35 11/25/2014 11:20:23 0000 bepgqbdz.and
all, offline, dsk 11/10/2014 00:12:26 11/10/2014 01:52:29 0000 bepdsfmo.afd
all, offline, dsk 11/03/2014 00:12:16 11/03/2014 01:52:05 0000 bepcjuuq.afd
all, offline, dsk 10/27/2014 00:11:53 10/27/2014 01:32:40 0000 bepbbkcf.afd
all, offline, dsk 10/20/2014 00:11:52 10/20/2014 01:20:06 0000 beozsuce.afd

Figure 14 List of Database Backups Implemented

You can view the backup logs o f the database using Transaction DB12.

3 P erfo rm in g a D a ta b a se Analysis

Here, you can use Transaction DB02 (Tables/Indexes) to perform exten­


sive checks on y o u r database system. The results are stored as statistics
that can be used for analysis purposes. As an SAP adm inistrator, you can
use this data to m onitor and analyze the system and to identify potential
database problem s. The following aspects can be examined:

19
P e r f o r m in g a D a ta b a s e A n a ly s is 3

» Database size and database fill level


» G row th rates
» Tables and indexes
» Objects that occupy a critical am ount o f storage space
» Consistency o f the database, objects, and so on

To perform an analysis, follow these steps:

1 Enter Transaction DB02 in the com m and field and press the I enter | key
(or select the m enu option T ools • A dministration • M onitor • P er­
formance • D atabase • D B 0 2 - T abi.es/I ndexes ).

2 On the Space O verview initial screen, the system displays an overview of


the m ost im portant information for about the database (in Figure 15):

Space Overview
DBName ~ V14 Started ~ 01/2S/201S
DBServer 0 vl4 (T; 06:18:24
DBRetease 11.2.0.3.0

Database
Name: DEFAULT Last analysis: 01/27/2015 07:11:31
DBsystem: <YourDatabase> Filling degree: ^ ■1
Size: 85.97 GB Total size: 180.66 GB
Free Space: 32.43 GB Total free space: 127.13 GB
Used: 62 % Total used: 30 %

Users
A Total number: 13
Maximum size: 36,784.63 MB (SAPSR3)
Maximum # segments: 46,919 (SAPSR3)

Tabtespaces
c£k Total number: 9
Maximum size: 33,000.00 MB (PSAPSR3740X)
Minimum free space: 9,282.75 MB (SYSTEM)

Segments
gs Tables Indexes Others Total

Nimber 20,998 27,256 5,299 53,553


Size (MB) 16,971.00 17,353.19 20,493.01 54,817.20
More 100 ext. 8 7 5 20

Figure 15 Space Overview o f a Database

20
P e r f o r m in g a D a ta b a s e A n a ly s is | 3

4 If y o u select Space • Segments • D etailed A nalysis, the system takes


y o u to the initial screen o f the individual analysis for specific database
objects. In the Segments Specific Selection W indow dialog box, enter
the nam e o f a table in the Segment/O bject field, for example (see Fig­
ure 17), and press I Fnt.erl.

____ A
X
& Segments Specific Selection Window
Select Data

Owner
Segment / Object lUSR02
Partition
Type ______ 1
Tablespace -* ■
m
Size [MB]
Extents -*■
Next Extent [MB]
Buffer Pool *

E lS

Figure 17 Specifying the Database Object to Be Analyzed

5, In the detail view, you can use the corresponding tabs to retrieve data
about the general properties, columns, indexes, statistics, and grow th
rate o f the table (see bottom o f screen; Figure 18).

Main Data Tat4e + Indexes Partitions Extents Table columns Storage history

- [I - - - -
Table + Indexes (Last analysis: 27.01.2015 18:34:05)
Owner Segment Partition Type Tablespace Size(M6) #Extent$ #Bkxks Init.Extent Next Extent Mn.Extents Max.Extents Pct.Increase 8uffer Pool
SAPSR3 USR02 TABLE PSAPSR3 0.125 2 16 0.016 1.000 1 2,147,483,645 0 DEFAULT
SAPSR3 USR02~0 INDEX PSAPSR3 0.063 1 8 0.016 1.000 1 2,147,483,645 0 DEFAULT
SAPSR3 USR02~001 INDEX PSAPSR3 0.063 1 8 0.016 1.000 1 2,147,483,645 0 DEFAULT
SAPSR3 USR02~002 INDEX PSAPSR3 0.063 1 8 0.016 1.000 1 2,147,483,645 0 DEFAULT

Figure 18 Detail Analysis of a Database Object

6 Use the A lerts • Database Check function to exam ine the results o f the
database check (see Figure 19).

22
P e r f o r m in g a D a t a b a s e A n a ly s is

S ’ Check Qoto Settings System fcfeb

q [ £ !« « o o o h h *4 o q q q ' n n e *
D atabase Check: O verview o f Messages fo r S ystem V14

Start ^ Standard (E3 Hstory ConAgue I ? 08A Operations

^ 55 ' j System Conlgt ► Check Resdts Settings


1 System V14 •OO Errors 0 view: The Last | 10 Days
CUO Warnings 5 Refresh Every 10 Seconds inactive
OOO Exce... 0 Defete Cider Than 100 Days active
> to System Landscape Z Total 5
> to Performance
> to Space
> to Jobs - ft T - - © . u d ib o o h
v «i Alerts Standard: Al open messages
• Database Check le Date Tme Oays Type Name Object fJcm Description
• Check Condnons w 01/27/2 06:00: 8 C8A CR1TICAL_TAELESPACE 1 Tablespace: PSAPSR3 9 Tablespace ffes autoextend can ca
• Alert Meritor w 01/27/2 06:00: 8 PROF C8_F1L£S 1 value: 200 (< 254) » Maxmun rurber of database fees
> to Qaerosocs w 01/27/2 06:00: 8 PROF LOG.BLFFER 1 Value: 14245888 (set In parameter fee) 9 Sue of redo log t
w 01/27/2 06:00: 8 PROF MM_DUMP_FILE_S12E 1 Value: UNLIMITED (>< 40000,10000) 9 Maxmum see (Ucx
w 01/27/2 06:00: 8 PROF CPTW£Z3t_!ND€X_COST_ADJ 1 Vabe: 100 (>< 40,10) 9 Cptmber index cost adjustment

Figure 19 Viewing the Results of the Database Check

7 U nder A lerts • A lert MoNiTORyou can find fu rth er inform ation on the
database's state of health (see Figure 20).
Cr System yelp

G - «g| GOO 7]7) Q *


A lerts: A le rt M o nitor

03 $
55 55 ' j System Ccnflg. » Last Refresh > 01/27/2015 18:36:1$
I System v ia
i Name ~ vi4 ce Server B vi4 started 01/25/2015 (4 06:18:24
re Release 11.2.0.3.0
System Landscape
Perfomvrce

3cbs
Alerts
Database Check AlertTree__________________________ Message
Check Conations v l¥OQ SOL
Alert Monitor v # Space management
Cwgnostcs > ■ Tablespaces
v’# Segments
• ■ Segments w. tco few alocatabie extents ¥?- 01/27/2015 18:06:13
• ■ Fewest alocatabie extents for a segment ¥5 01/27/2015 18:08:13
• ■ Segmentsapproachngmax.extents ¥? 01/27/2015 18:08:13
• ■ Fewest extents left before max.extents 32759 > 5 ¥5 01/27/2015 18.08:13
• # Most alocateC extents n any segment 351 >200 351 > 200: mmber of extents > tbreshdd ¥C 01/27/2015 18:08:13
• ■ Segments with non-zero petnerease *fl 01/27/2015 18:08:13
- ■ Segments h wrong tablespace ¥$
v ■Performance
> ■C p t r n t t *
> I Buffers
> ■ LOCkS
> ■Checkponts
v ▲ Badap/restore
v A Archmng
• ■ Lastsux.archrvelogbachp ¥- 01/27/2015 17:37:09
• A Lastbrarchrverun Ren 2015-01-27 17:30:03 aepspevfe.swJ termnated with warn... ¥? 01/27/2015 17:37:09
• O A/chverdestnabonful ¥9 / / ::
• O A/chmng off « // ::
> I Backupstatus
v ■ SAP consistency
>■ SAP consistency check
> ■ Objectsmssng n thecatabase

Figure 20 A le rt M o n ito r

23
P e r f o r m in g a D a ta b a s e A n a ly s is | 3

8 U nder the D iagnostics folder, double-click on M issing Tables and


,

Indexes (see Figure 21). On the next detail screen, check the entries
relating to incorrect database objects.

Analysis Edit Goto System Help

o H 3 « bi o o o a o c io n n © *
Diagnostics: Missing Tables and Indexes

j System Configuration ► Last Check ^ 01/27/2015 0 07:10:31


;i System V14 ,
06 Name § V14 DBServer S vl4 Started S& 01/25/2015j © 06:18:24
DBRelease 11.2.0.3.0
> to System Landscape
> ft Performance Results of Consistency Check Summary Info Action
> h Space > |L Objects missing in the database <✓ UJ
> to Jobs > to Urknown objects in ABAP Dictionary V HI
> IB Alerts > to Inccnsistent objects V UJ
v » Diagnostics > to Other checks V Ul
• Audit Log v m Optional indexes UJ
• Missing Tables and Indexes v m Indexes not created I 189
• EXPLAIN • V ACO_ROLE-HMC
• V ACO.ROLE-HPG
■ V ACOJUSER-HMC
• V ACOJJSER-HPG
■ V ACO_USER_GROUP-HMC
• V ACO_USER_GROUP-HPG
• V ADCP-I01
• V ADCP-I02
• V ADCP-I03
• V ADCP-I04

Figure 21 Missing Tables and Indexes

Use the database analysis if y o u w ant to exam ine the database w ith regard
to space occupied and consistency.

24
M o n ito r in g D a ta b a s e P e rfo rm a n c e | 4

4 M o n ito rin g D ata b a se P erfo rm an ce

The database performance monitor (Transaction ST04) is a database-inde­


pen d en t tool for analyzing and m onitoring th e perform ance-relevant
param eters o f a database m anagem ent system, such as the following:

» Storage use and buffer use


» Storage space occupancy
» CPU usage
» In p u t/output
» SQL requests
» SQL cache
» Detailed SQL com ponents
» Locks and deadlocks
» Connected applications

The perform ance m onitor is the main entry point for m onitoring the data­
base w ithin the SAP system. Performance statistics can be used to optimize
the database. For example, you can also retrieve the database error log
w ithout having to explicitly log on to the database.

To use the perform ance m onitor, follow these steps:

1 Enter Transaction ST04 in the com m and field and press the I Enter | key
(or select the m enu option Tools • A dministration • M onitor • Per­
formance • Database • S T 0 4 - Activity).

2 The initial screen provides an overview o f various database perfor­


m ance key figures (see Figure 22).

25
M o n ito r in g D a ta b a s e P e rfo rm a n c e | 4

Cr Performance Overview £drt Soto System Hep

o « « o o o n n ©**
Performance Overview
=] •§) cfi Reset t Since Reset ££ Since DBStart <§]
^ System Configuration ► Performance Overview
: System V14 < DB Name ~ V14 Started ~ 01/25/2015
DB Server i vl4 06:18:24
Database Administration DB Release 11.2.0.3.0
> f t System Landscape
v n Performance
• Performance Overview General information
> m Wait Event Analysis
> M SQL Statement Analysis DB instance V14 Day, Time 01/27/2015 18:38:22
> f t Statistical Information DB node vl4 Start up at 01/25/2015 06:18:24
> f t Feature Monitoring DB release 11.2.0.3.0 \? Bunde Patches Sec. since start 217,197
> f t Addtonal Functions
> f t Space Data Buffer
> f t Jobs
> | | Alerts See [KB] 786,432 Logical reads 41,728,212
> f t Diagnostics Quality [%] 99.0 Physical reads 497,271
Size default pool [KB] 786,432 Physical writes 226,226
See keep pool [KB] 0 Buffer busy waits 717
See others [KB] 0 Buffer wait time [s] 7

Shared pool Log buffer


Size [KB] 786,432 Size [KB] 23,336
DO-cache Quakty [%] 99.5 Entries 1,549,413
SQL area getratio [%] 98.1 Alocation retries 9
SQL area pnratio [%] 99.5 Aloe fault rate [%] 0.00
SQLA.Reioads/pns [%] 0.0203 Recto log wait [s] 5
Log files [n use] 8 [ 8)

Cals
User cals 4,670,745 Recursive cals 2,899,074
User ccmmits 171,729 Parse count 441,544
User rolbacks 18,481 User/recursive cals 1.6

Figure 22 Initial Screen of the Database Performance Monitor

3, Use the navigation frame on the left side to perform a detailed analysis.
Choose the path P erformance • W ait Event A nalysis • Session M o n i ­
tor to display all queries that are currently active in the database (see
Figure 23). W ith this function, you can determ ine w hether a process o f
the SAP system is still active in the database and which actions it cur­
rently performs.

26
M o n ito r in g D a ta b a s e P e rfo r m a n c e 4

& ArufysR System yr*i

0 [ 3« GOO t OOOO E E 0 *
Analyze DB Performance
[0 Refresh It Set Selection Criteria...
C; i Srstem Con6guaticn ► Session Monitor
1 system vm OB Name T vi4 Started ~ 01/2S/201S
OB Server 9 V14 0 06:18:24
Database Adranetrabcn OB Release 11.2.0.3.0
> to System Landscape
v k Performance
• Performance Overview
v » Wat Event Anayas - - H " . > - - * - .. - • ■ EXPLAIN ABAPSotrce ■ Reset pont _ Since reset SnceCC-stat
• S©S5«n Moritor Active SESSIONS. Analyze snee 06 stat.
• Buffer Busy Wat
• System Event “ S Op.sys Cftent system dent Status Event SQL Statement LoqcaIR Phys. Re Block Cha Conslsten
• System Event Hstory 22 264CO vl4 26396 ACTIVE CPU SELECT T1.1MSTJD. Tl.SID. T1PADCR. Tl.USERNAME, T 1676435 7807 86010 200
• Timed Events 130 21852 vl4 LGWR ACTIVE log fte paral 0 16 0 0
• Ftesystem Requests
• Enqueue stat
• Lock McntCr
• Latch ftontor
• Actw« Session Hstcry
• Workload Retortno
• Recto Log Switches
> ■ SQL Statement Anayas
> I t Statistical Information
> fc Foatuo Monrtomg
> 1 Addhorvi Factions
>i Space
> to Jobs
> U Alerts
> Kl OaoriostKS

Figure 23 Displaying Active Database Sessions

4 U nder Performance • SQL Statement Analysis • Shared Cursor Cache,


y o u can evaluate the behavior o f the database cache (see Figure 24).

Figure 24 Evaluating the Shared Cursor Cache

27
M o n ito r in g D a ta b a s e P e rfo r m a n c e 4

5 You can access various bits o f tim e-dependent inform ation via the Sta­
tistical Information entry. For example, double-click on System Sta­
tistics, and go to the Key Figures tab to identify the times w ith partic­
ularly high database usage (see Figure 25).
Cr e ^ rt Metres gctt Goto Systom

O GOO HU
S y s t e m S t a t is t i c s

X S ‘j System Ccnfgisjeon ► System Statstts


System VM re Nam® ~ vie Started 01/25/201 s
C6Ser.ec B vie 06:16:24
Database AdnrBtnton C6 Keteaso 11.2.0.3.0
> to System landscape
v t_ PerfamMrre GQLWaVarMS StatJ5«v*jePcrAWR] DAReads FidTaWeGcans W /7 Natwafc ParaleCxecvtttns Parsrg Redovmtes CPU rev.* < D,
• Performance Oervww
> to Wet Event Anatyse
Ptmetect data pod
> l l SQL Statement AnatySS
v a Statistical Intomatwi OOTWJJtcr Dy SNAPSHOT v BegnTme 01/19/2015 23:00:09 £J Avd. tine*are
• SGAMXItCr $ load data End Tme 01/27/2015 18:01:00
• undb Statistics
• Performance Database
• System Statedcs
[W ]i[£ l[» ][H ]fF T . •I I l f * ! ® "Tllfe .11 ■HflSIilun
Consistent Gets
• System Strmary Metrics eegnTrre SECONDS ACT.SESS CPUSJJSEO TJtSJWSERCREACS_US8tCXTRAT10 LOG_R£AOS_SDIS»:_R£AOS_SUS6R_CAALS_SCCMM1TS_S R£0O_BUS_S
• He Metres BEGIN TIME: 2001.2015 0000:46 A
• Wat Cbts Mecnct &O TIME: 2701.2015 1800:45 *
• Too. Segment Stattrtcs WSTANCE: 1
• WfSMonWr
> Bi Ftoto« Monrtomg AGtWiATICtaBY: SNAPSHOT
EiatCED NO
> liStoac®
> to Jcbs 201501-27 1700:37 3600 002 002 0.79 505 99.40 14523 087 28 78 0.70 430
> Bi AfotS 2015-01-27 1600:26 3611 002 OOl 1.08 6.52 99.98 113.68 003 17.44 072 569
> fei Clunostcs 201501-27 1500:23 3603 002 OOl 1.14 678 99 64 147,18 054 21.70 107 7.90
2015-01-27 1400:25 3698 002 OOl 0.99 576 99.45 114.90 064 19.94 1.00 6.38
201501-27 1300:33 3592 002 OOl 1.00 654 99.97 114.78 004 17.56 072 583
201501-27 1200:32 3601 002 OOl 1.01 6.06 99.97 105.20 004 17.35 073 468
201501-27 1100:39 3593 003 OOl 1.65 7.31 99.94 134.96 023 18.44 074 568
201501-27 1000:32 3607 002 OOl 1.08 6.60 99.94 113.97 2.20 17.26 071 461
201501-27 09.00:36 3596 002 OOl 1.00 620 99.97 107.49 003 17.35 072 576

Figure 25 Displaying System Statistics and Key Figures

6 If y o u expand the Feature M onitoring node, you can, for example,


check the ASSM settings o f the various tablespaces and tables under
A utomatic Segment Space M anagement (ASSM) (see Figure 26).
U nder Additional Functions , you can display the database param eters
(see Figure 27) or read the alert log, among other things.

Use the perform ance m onitor to analyze and resolve perform ance prob­
lems in the database. If in doubt, consult w ith an expert before y o u make
a change.

28
M o n ito r in g D a ta b a s e P e rfo rm a n c e | 4

& AgSM £dt Goto System Help

© - «i o © o 5 in © ^
A utom atic S egm en t Space M anagem ent
03 ft, 3
] System Configuration • D6 Connections Automate Segment Space Management
i System V14 D6 Name • j/14 ^Started 01/25/2015
D6 Server . vl4 06:18:24
Database Administration DGRelease 11.2.0.3.0
> M System Landscape
v to Performance
• Performance Overview
> to Wait Event Analysis
> fei SQL Statement Anatysrs - -
> to Statistical Information Al Tablespaces
v to Feature Monitoring Name Block See Status Contents Extent Management Alocaton Type Segment Space Mngt 1
• Automatic Segment Space Management SYSTEM 8,192 ONLINE PERMANENT LOCAL SYSTEM MANUAL
• Resumabte Space Alocation
• Paratel Query PSAPUNDO 8,192 ONLINE UNX> LOCAL SYSTEM MANUAL
• Segments with Activated Paraletem SYSAUX 8,192 ONLINE PERMANENT LOCAL SYSTEM AUTO
> to Ackitiond Functions PSAPTEMP 8,192 ONLINE TEMPORARY LOCAL UNIFORM MANUAL
> 1 Space PSAPSAUX 8,192 ONLINE PERMANENT LOCAL SYSTEM MANUAL
> toJobs j PSAPSR3 8,192 ONLINE PERMANENT LOCAL SYSTEM AUTO
> to Alerts PSAPSR3USR 8,192 ONLINE PERMANENT LOCAL SYSTEM AUTO
>| Dagnostcs PSAPSR306 8,192 ONLINE PERMANENT LOCAL SYSTEM AUTO
PSAPSR3740X 8,192 ONLINE PERMANENT LOCAL SYSTEM AUTO
________________________________________________________________________________ 1

Figure 26 Checking the ASSM Settings

Dr Parameters conftg Ed* Sato System yen

O v « o o o QQ Tin Gfr
Database Parameters
m
X X J System CorAj/aren ► Database Parameters
• System V14 D8 Name ~ V14 Started 01/25/2015
D8 Server 3 vl4 05:18:24
Datable AdmrBtraoon D8 Release 1120.30
> to System Landscape
v «i Performance Parameters Nstorr SPFXE
• Performance Overview
> to Wat Event Analyss
> to SQL Statement Analysis [ I M ® tt " r "T~jlfrx~jifft1# rJ jra in ifiS K i o
> l l StatoWd Information Actwe Parameters
> to FMtuaMjntcrng
Instance Id S Parameter Parameter value
v « Addtcnal Fuxtfons
1 • coffpatfcte 11.2.0
• SQL Command EdKcr
• Ctspiay GV$-vews 1 • ccntrd_fte_iacord_keep_tme 30
• Ctsday OBAVews 1 * contrdjtos toade/vi4/ongtoga/cnW/cntrlvi4.flbf, /oracte/vm/onatoce/cntrl/cntitvi4.dbf, /orad#/vi4/sapdaui/cntrl/c
• Ctspioy USSi-vwws 1 • ccntrd.Hcs /orado/Vl4/ongtooA/cntri/cntrtvi4.Cbf, /orado/Vi4/on5fo50icntrVcnWvi4.dM, /crade/VH/sapdatal/cntri/c
• Database Parameters 1 • contrdjles fcxade/Vl4/onol3oft/cnW/cntrfvl4.(Jbf, /oracte/Vl4/oncfo0B/cntrVcntrrvi4.dM, /orade/VH/sapdatal/cn&Vc
• Alert Loo 1 * ccntrd_management_pack_access D1AQMUST1C+TLMNG
• Ovedrponts
• Oracle Net 1 * core_A/np_d9St /orade^/14/saptrace/dao/rdtms/vl4/Vl4/cduro
• Bsxxio Patches 1 * cpu.ctxnt 2
> to Space 1 • oeate_dtmao_area_soe 8389606
> M fobs 1 * ooate_stcred_outlne5
> >i Alerts 1 * oxsor_bnd_captrxe_d«tr'a6on memory+dsk
> t o Oegrc'stxs 1 • cuscrjharrg EXACT
l • cvsor_joaco_for_tmo FALSE
1 * cb_16k_cachej8e 0
1 * cfo_2k_cache_sue 0
1 * cfo_33<_cache_jBe 0
1 • db_4k_cache_sBe 0
1 * cb_8k_cache_stte 0
1 • Cb_btock_buffcrs 0
h lv t /tw U v i CAI c c
<> <>

Figure 27 Displaying the Database Parameters

29
U s in g S Q L S e r v e r M a n a g e m e n t S t u d io 5

5 Using SQL Server M a n a g e m e n t S tu d io

You use SQL Server M anagem ent Studio to manage the M icrosoft SQL
Server on a daily basis. This is the successor to Enterprise M anager. Even
though SQL Server M anagem ent Studio is comparably easy to use, you
must, thanks to the large num ber o f possible options available, pay partic­
ular attention to its m any possibilities and procedures.

To use SQL Server M anagem ent Studio, follow these steps:

1 Generally, you d o n 't have to start SQL Server M anagem ent Studio
directly on the server. Instead, it can be installed on the adm inistrator's
w orkstation PC, which means that an interactive logon to the database
server isn’t required (see Figure 28).

Apps
F SQL Server
’X ] Management..

|p| SQL Server


Configuration...

SQL Server
Installation Cente...

SQL Server
% Installation Cente...

Download
1 Microsoft SQL..

SQL Server
< 2 > Documentation

SQL Server Error


1 and Usage...

SQL Server Profiler


El

Figure 28 Starting SQL Server M anagem ent Studio

30
U s in g S Q L S e r v e r M a n a g e m e n t S t u d io 5

2, After you've started SQL Server M anagem ent Studio, y o u 're prom pted
to specify the server to which you w ant to establish a connection. There
are three configuration options (see Figure 29):
S erver type: In our example, you connect to the database module. In
addition to the database module, there are other possible server types
such as A nalysis Services or Reporting Services.
S erver nam e : Here, you enter the name o f the server to which you
w ant to establish a connection. M ost adm inistration tasks also work
via the network, which means that, for the usual adm inistration tasks,
there's no need to log on directly to the server.
M icrosoft SQL Server knows several database instances on a database
server. If you w ant to address a particular instance (not the standard
instance), insert the instance name as the server name (e.g., server-
name\sapdbl).
A uthentication : If you select W indow s A uthentication , y o u ’ll be
connected using y our current logon inform ation (the identity you used
to log on to the W indows PC or server). Alternatively, you can log on
using SQL Server authentication. SQL Server-specific accounts are used
here (i.e., no active directory logon information). The authentication
type used in your environm ent depends on the individual system con­
figuration. M icrosoft recommends using W indows authentication.

Figure 29 Establishing a Connection to the Database

3, Choose Connect to start SQL Server M anagem ent Studio.

31
S ta r t in g a n d S to p p in g th e D a ta b a s e 6

6 S ta rtin g and S to p p in g th e D a ta b a s e

To start the M icrosoft SQL Server, follow these steps (see Figure 31):

1 Right-click on to call the context m enu for the database instance dis­
played.
2 Select the Start m enu option.
3 Confirm the m andatory question in the dialog box (Are You Sure ...).
The database instance should run a short tim e later.

File Edit View Debug Tools Window Help

I r .J A <4 A New Query L& £& 3 R j j U -2 -li

Object Explorer - ? X
Connect- & » / D J
B ld | V14W14
_ (SQL Server 11.0.3339- V14\Administrator)
S C2 Databases
3 u J Security
a L_2 Server Objects
S Lj I Replication
♦ __| AlwaysOn High Availability
♦ Lil Management
a i__J Integration Services Catalogs
ffi L2) SQL Server Agent

Figure 31 Starting the Database

You stop a database instance in a similar way. Here, you m ust only select
the Stop m enu option.

In our example, you see that the standard database instance o f the server
V I4 (you recognize the standard instance by the fact that no other instance
nam e is appended to it) is stopped, w hich is indicated by the red stop

33
U s in g S Q L S e r v e r M a n a g e m e n t S t u d io 5

Connecting to Several SQL Servers


With SQL Server Management Studio, you can connect to multiple SQL serv­
ers simultaneously.

After you've started SQL Server M anagem ent Studio, y ou also get the tree
view from the "old" SQL Enterprise M anager (see Figure 30).

Figure 30 Tree Structure of the Database

For example, you see that, under Security, the databases on the server can
m anage the logons (and much more). Here, you also see advanced config­
uration options such as replication, backup, or perform ance analysis.

32
S ta r t in g a n d S to p p in g th e D a ta b a s e 6

icon th at precedes the database name. If the database/database instance


is stopped, it can't provide any data for clients, nor can it perform any
adm inistration tasks.

S tarting and Stopping the Database


Essentially, the SQL Server service (i.e., the Windows service) is started or
stopped when you start or stop a database instance. However, you shouldn't
simply start or stop the service. Instead, you should always follow the SQL
Server-specific procedure.

After y o u 'v e started the database instance, y ou should take a quick look at
the status o f the SQL Server Agent. The fact that th e actual database is run­
ning d o esn 't necessarily mean that the agent is running. Because the
agent is required for all autom ation tasks, you should check that it's also
running (see Figure 32).

Figure 32 Starting the SQL Server Agent

34
S ta r t in g a n d S to p p in g th e D a ta b a s e | 6

Each database instance has its ow n SQL Server Agent, so greater care is
required here. If the SQL Server Agent isn 't running, the m aintenance
plans, data backup processes, or similar, which are to be called in a time-
controlled m anner, a re n 't executed.

The SQL Server Agent is im plem ented as a separate W indow s service. If it


isn't started automatically, you can configure this in the services adm inis­
tration area o f the operating system. This service is called SQL Server
A gent , followed by the name o f the database instance in parentheses (see
Figure 33).

Computer Management
File Action View Help

+ +I i H 0 ® &l H II li
Computer Management (local
Services
a fjjJ System Tools
SQl Server Agent (V14) Description Status Startup Type Log C *
0 1 Task Scheduler
P (di Event Viewer
.Sfll .Seivei(V14 Provides sto... Running Automatic Local
Start the service SQL Server Agent (V1J) Executes jo... Automatic Local
p £31 Shared Folders
SQl Server Browser Provides SQ... Running Automatic Local
t> Jk- local Users and Croups
p (£>) Performance Descnption: SQL Server VSS Writer Provides th... Running Automatic Local
^ Device Manager Executes jobs, monitors SQL Server,
fires alerts, and allows automation of
SQL Server A gent (V14) Properties (Local Computer) LZ1 Local
a Storage Local
some administrative tasks.
P & Windows Server Backup General Log On | Recovery | Dependencies Local
Disk Management Local
Service name: S QLAgentJVI4 Local
a £$j Services and Applications
l> § ) Routing and Remote A< Display name: S QL Server Agent (V14) Local
. Services Local
Description: Executes jobs, monitors SQL Server, fires alerts, and
£ $ WMI Control allows automation ol some adrmrtstrative tasks. Netw
> u i SQL Server Configurate Local
Path to executable: Local
"C:\Program Files\Microscft SQL ServeAMSSQLI I.V14\MSSQL\Binn\SQl
Local
Startup type: Automatic Local
Automatic IDeiaved Start) Local
Local
Manual
Disabled Local
Service status: Moppeo
Local
Slat Stop Pause Resume Local g
Local
You can specify the start parameters that apply when you start the service Local
from here
Local
Start parameters: Local
Local
Local v
OK | Cancel Apply >
\ Extended Standard /

Figure 33 Windows Service of the SQL Server Agent

If a server has several instances, several SQL Server Agent services are cre­
ated, w hich you can then configure to start automatically.

35
S to r in g D a ta o n th e H a r d D is k 7

7 S to rin g D a ta on th e H ard D isk

This section provides some detailed inform ation about how the SQL
Server stores data on the hard disk. This inform ation isn 't only im portant
for preparing to plan and im plem ent a data backup but also to create disk
space areas to achieve m axim um perform ance.

7.1 Pages an d Blocks

The largest SQL Server database file is also organized into pages and
blocks. The following principles apply:

» A page is approxim ately 8KB in size, that is, 8,192 bytes.


» A block comprises 8 pages and is therefore 64I<B in size, that is, 65,536
bytes.

The following example has a size o f 5,976,883,200 bytes (see Figure 34).
W ith this knowledge of pages and blocks, you can calculate how many
blocks and pages are contained in this database file:

5,976,883,200 -r 8,192 = 729,600 pages = 91,200 blocks

Figure 34 Size o f the Database File

36
S to r in g D a ta o n th e H a r d D is k 7

W hen the SQL Server accesses disk storage, it w orks in blocks (i.e., in
64KB units). For this reason, it makes sense to also set the physical block
sizes for the RAID sets used by the SQL Server to this value.

Block Sizes
Here, w e 're ta lk in g a b o u t th e b lo c k sizes th a t th e RAID c o n tro lle r uses to
fo rm a t th e disk areas and n o t th e NTFS blocks. If th e disk areas used by th e
SQL Server a re n 't fo rm a tte d w ith th is b lo c k size, th is w o n 't im p a ir th e fu n c ­
tio n in itia lly . H o w e ver, yo u w o n 't g e t th e best p e rfo rm a n c e o u t o f y o u r
h a rd w a re later.

Let's take a look at the structure o f a page (see Figure 35), which begins
w ith a 96 byte page header. This is followed by one or m ore data rows.
The row offset, which contains inform ation about the distance betw een
the first byte in the data row and the start o f the page, is stored at the end
o f the file.

Row O ffsets

You see that a page may contain several data rows. If data rows are larger
than one page, they are distributed across several pages.

37
S to r in g D a ta o n th e H a r d D is k | 7

7.2 File C ro u p s an d Files

An SQL Server database requires at least tw o files. One file stores the
actual database, and one stores the transaction log. In Figure 36, y o u see
a corresponding dialog box that contains the properties o f a database.
Here, you define, for example, a file type, path, or behavior for autoex-
tend for each file.

Figure 36 Overview of Database Files

You can create several files for both the actual database and the logs. For
larger databases, this makes sense for the following reasons:

X The size o f the individual file can be kept to a reasonable level, thus
making it easier to manage and reducing the storage space needed. For
perform ance reasons, it may make sense to distribute the files across
several physical RAID sets.

38
S to r in g D a ta o n th e H a rd D is k 7

» However, this is only possible if the database is distributed across sev­


eral files.
» If only one of the files in a database is damaged (e.g., as a result o f disk prob­
lems on a special RAID set), you only need to restore this one database.
If you w ant to im prove adm inistration and m anagem ent, you can create
file groups. Note that a database has one prim ary file and any num ber o f
secondary files (0 to n files). The following file nam e extensions are used
by default:

» * .m df for prim ary database files


» *.ndf for secondary database files
» *.ldf for log files

7.3 T ra n s a c tio n Logs (Logs)

Transaction logs, also know n as logs or logfiles, play an extrem ely im port­
ant role in all database servers. Transaction logs are particularly im portant
w hen backing up and restoring databases. In the SQL Server, a transaction
log is w ritten for each database (as is the case for every other server-based
database system). Initially, a transaction log is sim ply one file. The data­
base m odule then divides this file into multiple virtual log files. The sys­
tem determ ines the num ber and size o f the virtual log files that it creates
and extends. You as the adm inistrator can't influence this process.

Let’s take a closer look at the log file (see Figure 37):

» At the start, you have tw o virtual log files w ith free storage space, which
w ere created by truncating older entries in the transaction log.
» The logical log starts in the third virtual log file. Here, y o u find, among
o th er things, a position known as the M inim um Recovery Log Sequence
Number (Mini LSN). This identifies the log entry required for a cross­
database rollback. W hen you truncate the log, all o f the virtual log files
th at precede the M ini LSN position are deleted.
» The fifth virtual log file isn 't used at present.

39
S to r in g D a ta o n th e H a r d D is k 7

i i \ i \ Ji
V. j
V V
Truncated M ini Not
LSN Used
Last
Checkpoint
Start of End of
Logical Log Logical Log

Figure 37 Transport Logs (I)

The following situation arises some time later (after a few transactions):

>5 The log is initially expanded to the fifth virtual log file. The end o f the
physical file may then be reached.
» If the end o f the physical file is reached, the system returns to the start
o f the file (see Figure 38).

Virtual Log File 1

y \ Virtual Log File 2


r / 1
1 1
___ 1

i1 i{ ii i

M ini
v,__ LSN
V Second-Last Last
Truncated Checkpoint Checkpoint

End of Start of
Logical Log Logical Log

Figure 3 8 Transport Logs (II)

40
I n it ia t in g a B a c k u p P ro c e s s 8

Ideally, the transactions are continuously w ritten to this one physical


transaction log file. A prerequisite here is that the logical log is truncated
often enough to ensure that there is always enough free storage space
(i.e., em pty virtual log files). If there isn ’t enough free storage space in the
physical file (as a result o f a high transaction volum e, a log file that is too
small, or a transaction log that isn 't truncated often enough), the follow­
ing situation may arise:

» If autoextend is configured for the file, the database m odule extends the
file.
» If it isn't possible to extend the file because th ere isn’t enough space on
the data carrier, the w rite processes are term inated (error 9002).
» If additional log files have been created, the data are w ritten to these
files.
» If autoextend isn't configured, and no additional log files are available,
the w rite processes are term inated (error 9002).

8 In itia tin g a Backup Process

Next, w e'll use SQL Server M anagem ent Studio to dem onstrate how to
perform a backup so that it’s possible to w ork w ith the com m and line
(i.e., w ith SQL commands). Because m any adm inistrators prefer to work
w ith the graphical interface, w e've chosen this display here.

SQL Commands
M u c h o f th e w o rk to be executed can o n ly be p e rfo rm e d using SQL c o m ­
m a n d s —e ith e r because th e y c a n 't be in itia te d in th e GUI o r because n o t all
param e te rs can be tra n sfe rre d via th e SQL Server M a n a g e m e n t S tud io .

F o rtu n a te ly, you can d isplay th e SQL co m m a nd s fo r m o st o f th e tasks in iti­


ated via th e SQL Server M a n a g e m e n t S tud io . M o s t o f th e d ia lo g boxes have
th e S c r ip t b u tto n fo r th is purpose.

41
I n it ia t in g a B a c k u p P ro c e s s 8

To start a database backup, follow these steps:

1 In the context m enu for the database, choose the m enu path Tasks •
Back U p (see Figure 39). The system displays a two-screen dialog box in
w hich you can configure the backup.

Figure 39 Calling the Backup Dialog

42
I n it ia t in g a B a c k u p P ro c e s s 8

2, On the first screen (G eneral), you make the basic configuration for the
backup (e.g., w hether it concerns a database backup or file backup, or
w hich backup type is to be used, see Figure 40). You either specify the
file to which you w ant to back up the data directly (as in this example),
or y o u save the backup to a previously defined backup medium, which
y o u select and assign by using the A dd button. If the server has a local
tape drive, the backup can be w ritten directly to this drive. In real life,
how ever, this is unusual because media m anagem ent on the M icrosoft
SQL Server is very rudim entary, and, on the o th er hand, a m ore central
solution for w riting data to the tape drive is favored.

Figure 4 0 General Backup Settings

43
I n it ia t in g a B a c k u p P ro c e s s 8

3, The second screen in the dialog box (O ptions ) provides various differ­
ent options that are largely self-explanatory (see Figure 41).
The O ptions fields that affect the transaction log are only available if
you've selected T ransaction Log as the Backup type on the first screen.

Figure 41 Advanced Configuration Options

4 Confirm y o u r settings w ith OK. If you w ant to use SQL com m ands to
start this backup process, you have to use the following code. If you
a re n 't (yet) proficient enough to use these com m and lines to w rite this
code, y ou can simply generate the code using the Script button.

44
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p 9

are also used for other tasks. As an SQL Server adm inistrator, you m ust
always deal w ith this issue.

To create a m aintenance plan, follow these steps:

1 The easiest way to create a new m aintenance plan is to use the M ainte­
nance Plan Wizard, which you can call via the m enu path M anagement •
M aintenance P lans • M aintenance P lan W izard (see Figure 42).
2 The M aintenance Plan W izard (see Figure 43) initially guides you
through the process o f creating a schedule during which the m ainte­
nance plan is to be executed. You can m ore or less store any individual
plan, which may also include recurrence intervals. Click on N ext.

File Edit View Project Debug Tools W indow Help

I .jpw ~lJ A A A N ewQuery L u nl Bi I h -J 3 I -9


Object Explorer - ¥ X

C o n n e c t- j * ! 3 * r. / _ |] <*5

S3 L J Databases
E B __ I Security
B L J Server Objects
E L J Replication
H U J AlwaysOn High Availability
B C J Management
S3 ^ Policy Management
® 53 Collection
SI [§3 Resource Governor
S |t£j Extended Events

j r
® □ SQL Server Logs New Maintenance Plan...
T j Database Mail Maintenance Plan Wizard
Distributed Transai
View History
ffi L J Legacy
H L J Integration Services C Reports ►
S3 [^ ) SQL Server Agent
Refresh

Figure 42 Calling th e M aintenance Plan Wizard

46
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p | 9

BACKUP DATABASE [V 14 ] TO DISK = N*C: \ . . . \V 1 4 . b a k '


WITH NOFORMAT, NOINIT, NAME = N' V14- F u l1 Database Backup’ , SKIP,
NOREWIND, NOUNLOAD, STATS - 10
GO

This is an online backup. In other words, there's no need to interrupt sys­


tem operation. From a user perspective, how ever, an extensive backup
can im pair perform ance.

9 S e ttin g Up M a in te n a n c e Plans fo r a Backup

Because starting each backup manually is tedious, you can handle this
w ithin a m aintenance plan. For an SQL Server, y o u can set up any num ­
ber o f m aintenance plans that start at a certain tim e and then execute var­
ious actions on one or m ore databases. You can also perform backups.

Ify o u ’re running several servers, you can configure and perform backups on
every single server. You must bear the following tw o key aspects in mind:

X Monitoring
If y o u execute the data backup mechanisms locally on each server, you
also have to m onitor each machine separately to determ ine w hether the
data backup is actually perform ed.
» Backup devices
In a production environm ent, backups are m ostly saved to tape. O f
course, you could give each SQL Server its ow n tape drive, but this
w ould require a lot of adm inistration and m onitoring effort. A central
solution is much more elegant here. As m entioned previously, the
m edia m anagem ent on the SQL Server is very rudim entary (i.e., you as
the adm inistrator have to store tapes, overw rite the data, and do m any
other things manually).

Despite these limitations, the use o f a m aintenance plan isn ’t entirely


unsuitable. It works perfectly, is easy to handle, and you d o n ’t have to
deal w ith the idiosyncrasies o f other backup software. M aintenance plans

45
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p 9

Figure 43 Initial Screen of the Maintenance Plan Wizard

3, The next dialog box contains the m ost im portant point, namely select­
ing the m aintenance task (i.e., the task to be executed, see Figure 44).
Here, you can choose from alm ost a dozen options, including the com­
plete, differential, and transaction log backup. Click on N ext.

Figure 44 Selecting the Maintenance Task

47
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p 9

4 If y o u 'v e selected several m aintenance tasks to be executed, the execu­


tion sequence will be essential. This can also be configured but not until
y o u access the next dialog box (see Figure 45).

Figure 45 Defining the Sequence for the Tasks Selected

Using the options displayed, you determ ine the sequence in which the
m aintenance tasks in this m aintenance plan are processed. Click on
N ext.

5, M ost m aintenance tasks require additional inform ation about the con­
figuration (see Figure 46). The wizard will display the required dialog
boxes. In this example, only a complete backup is perform ed. The con­
figuration options in the dialog box are sim ilar to those for a backup
that is triggered manually. One difference here is the option to create
each new backup in a new file that is automatically created (see the Cre­
ate A SUB-DIRECTORY FOR EACH DATABASE checkbox). Click on NEXT.

48
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p 9

Figure 46 Detail Configuration of the Task Selected

After y o u 'v e closed the wizard, the m aintenance plan is activated.

Executing a M ain ten ance Plan


To ensure th a t th e m a in ten an ce plan is a c tu a lly e xe cu te d , th e SQL Server
A g e n t m u st be ru n n in g . Because th is is n 't necessarily th e case by d e fa u lt,
you sh o u ld check w h e th e r it's a c tu a lly active in th e SQL Server M a n a g e m e n t
S tu d io . Specify th a t th e SQL Server A g e n t is a u to m a tic a lly started a fte r a
server restart.

49
S e tt in g U p M a in t e n a n c e P la n s f o r a B a c k u p | 9

You can modify any m aintenance plan that is created by following these
steps:

1 In the context m enu for the m aintenance plan, choose M odify to dis­
play the view show n in Figure 47.
'4? V14 Backup (Dmgn]‘ ■ Microsoft SQL M,trvvje*nfmStiK*o(ActaiinistTatoO I ° I__x__I
M* (ck Vtr» Proj«t Ortoj Tot* W*%dow Help
! J * -J- - T d it J.M«-Qwnr lic iiA ia . /. j A "»•<*• --. v a i J c .3 - .

Figure 47 Editor for Maintenance Plans

2, If y o u 'v e already w orked w ith SQL Server Integration Services (SSIS),


y o u 'll im m ediately recognize this view and feel at hom e here. For all
other cases, it's w orth m entioning that m aintenance plan task elem ents
can be positioned and configured from the T oolbox . You define the
execution sequence by connecting the elem ents in the required
sequence. This editor gives you full control over y o u r m aintenance
plans. As you can see from the com prehensive P roperties w indow , you
can configure the m aintenance plan tasks in great detail.
3. Ify o u w ant to execute the m aintenance plan im m ediately, y o u can start
it directly. You can do this in two places because the m aintenance plan
is displayed below the M anagement • M aintenance Plans and below
the SQL Server A gent • J obs node (see Figure 48).

50
B a c k in g U p S y s te m D a ta b a s e s | 10

'-fc
File Edit View Project Debug Tools Window Help
! Cp * * Jf A S J.. NewQuery L j Uii C& -J

Figure 48 Starting the Maintenance Job Directly

An SQL Server Agent jo b is created for the m aintenance plan. This is the
reason w hy the SQL Server Agent m ust be started to execute the m ainte­
nance plans.

10 B acking Up System D atab ases

In addition to the databases that you create and fill with user data, there
are som e system databases the SQL Server uses for internal purposes (e.g.f

51
B a c k in g U p S y s te m D a ta b a s e s | 10

to save the configuration). The m a s te r database, in particular, is extremely


im portant and m ust be backed up. Table 1 shows the system databases
from a backup perspective.

D ata­ Description Backup Description


bases Required?
m a ster A ll o f th e system Yes This database is e x tre m e ly
settin g s fo r th e SQL im p o rta n t. It s h o u ld /m u s t be
Server are saved in backed up on a re gular basis. The
th e m aster d a ta ­ o n ly w a y to back up th e m aster
base. database is by means o f a c o m ­
p le te b acku p . The SQL Server
c a n 't w o rk w ith o u t th e m aster
database. If it's dam aged o r lost,
yo u can create a n e w m aster
database. H o w e ver, you th e n
lose all o f th e logon in fo rm a tio n ,
fo r e xam ple .

msdb The SQL Server Yes Even th o u g h losing th is database


A g e n t uses th is w o u ld n o t be as d ra m a tic as lo s­
database. Jobs, p ro ­ in g th e m aster database, a re g u ­
gression logs, and lar b a cku p is necessary because it
so on are stored also c o n ta in s im p o rta n t in fo rm a ­
here. tio n fo r system o p e ra tio n .

model This is th e te m p la te Yes Even th o u g h losing th is database


used fo r n e w d ata - w o u ld n o t be as d ra m a tic as los-
bases. ing th e m aster database, w e n ev­
ertheless re co m m e n d th a t you
back u p th is database a fte r every
change.

tempdb This database is No You c a n 't back up th is database


used to cache te rn - because it o n ly c o nta in s te m p o -
p o ra ry re su lt sets. rary data.
W h e n yo u sh u t
d o w n th e instance,
any data stored
th e re is d e le te d .

Table 1 System Databases - Backup

52
B a c k in g U p S y s te m D a ta b a s e s | 10

10.1 m a s te r D a ta b a s e

As previously m entioned in Table 1, you m ust back up the master data­


base on a regular basis. The following processes bring about a change in
the database and therefore make a backup necessary:

» Creating or deleting a user database. If a user database is extended to


include new data, this doesn 't affect the master database.
» A dding or rem oving files or file groups.
» A dding logon names or other processes that relate to logon security.
Database backup processes such as adding a user to a database d o n 't
affect the master database.
» Changing server-wide configuration options o r database configuration
options.
» Creating or rem oving logical backup media.
» Configuring the server for distributed queries and Remote Procedure
Calls (RPCs) such as adding connection servers or rem ote logon names.

However, it has proven beneficial to include the database in a backup jo b


to be executed on a daily basis, for example. The only way to back up the
master database is by means o f a complete database backup. O ther proce­
dures a re n 't supported. Because the master database isn 't too large, this
isn't a problem .

10.2 m sdb and m o d e l D a ta b a s e s

As previously m entioned in Table 1, the msdb database contains inform a­


tion for and about the execution o f SQL Server Agent jobs. The database
changes in the following cases:

» Planning tasks
» Saving integration services packages that w ere created using the
im port/export wizard in an instance o f the SQL Server
X M anaging an online backup and restore run
» Replication

53
Accessing the SQL Server Logs | 11

» setup.exe resetting the restore model to Simple


» A dditions or changes to guidelines or conditions for guideline-based
adm inistration

Even though you w ould only need to back up th e msdb database in the
event o f changes, the easiest option is to back up this database on a regu­
lar basis (e.g., daily), in the same way as you back up the master database.

The model database only changes if an adm inistrator makes adjustm ents
(this rarely happens). W e recom m end that you back up the model data­
base as part o f the regular backup o f the master and msdb databases. Even
though this is too often in principle, it's m uch m ore complicated to m an­
age a separate backup record for this extrem ely small database than to
sim ply back it up as part o f the regular backup.

11 Accessing th e SQL Server Logs

W hen a server is running, you m ust view its logs. The SQL server logs are
available below the M anagement node for this purpose (see Figure 49).

P* Edit project Qebug lode Window fcjelp


i J J ’ -J A * A NewQuery Llj & s it
Object Explorer - 0 X
Connect- 3* 3; ' D J

VU.VU (SOI Server 11.0.3330• VI i Administrator)


♦ _ l Databases
» J Security
♦ J Server Objects
♦: Ld Replication
♦ AtwavsOn High Availability
a LJ Management
♦ 'l*1Policy Management
® S i Data Collection
♦ -3 Governor
» |j*J E«ten<led Events
♦ Maintenance Plans
- SCt Serve* Logs
yQSZS m m
y A rchive * I
y Archive *2
y Archive *3
y Archive *4 • 7/24/2014 12:04*
y Archive =S - 7/24/2014 l2^i:<VPM
y Archive =0- 7/24/2014 12X13:00PM
Database Mail
Distributed Transaction Coordinator
S uJ
. _ J Integration Services Catalogs
Server Agent

Figure 49 Displaying the SQL Server Logs

54
W h a t 's N e x t? | 12

You can open current or archived logs. You call the Log File Viewer to
"read" the logs (see Figure 50).

Log File Viewer - V14W14


Select logs £7 Load Log yijJ Export 171 Refresh ^ Filter.. '■* Search... 'Stop fc^Help

[ ✓ Cure* • 874/2014 5:18:00 PM Log fie summary: No liter op-pled


□Archive HI -8/4/2014 514 00 FM Dale T Source Message
□Archive B2 • 7/29/2014 1234:00Ah u 8/4/2014 7 58:57 PM sptd54 Conliguiahon option 'Agent XP:' changed from0 to 1. Run the RECONFIGURE statement to hstal
□Archive B3 ■ 7/28/2014 10.54:00Ah u 8/4/2014 7:58:57 PM sp»d54 Configuration option 'show advanced options' changed from1 to 1. Ren the RECONFIGURE stalemr
□Archive 84 7/24/2014 1204:00 Ph UJ 8/4/2014 7:57:44 PM spxJ54 Configuration option 'show advanced options' changed from 1 to 1 Ren the RECONFIGURE staiemt
□Archive B5 - 7/24/2014 1204:00 Ph
□Archive B6 - 7/24/2014 1203:00 Ph y 8/4/2014 7:57:11 PM spxJ54 Configuration option 'show advanced options' changed from1 to 1. Run the RECONFIGURE staler™ “
3E QSQL Server Agent u 8/4/2014 5 40:03 PM spd52 Using 'xplog70<jr version *2011.11021Offto execute extended stored procedure 'xp_msver' This is
8B □ DatabaseMal u 8/4/2014 5:40:03 PM spid52 Attempting to load library 'xpfc>g70.dir nto memoiy. This is an nfcrmatonal message only No user acti
BB□ Window NT y 8/4/2014 5:20:37 PM spid51 Using 'xpstar <M version *2011.110.3000* to execute extended stored procedure 'xp_sdagent_enum_
■J 8/4/2014 5:20:37 PM spd51 Attempting to load Ifcrary 'xpstar df into memory. This is an informational message only No user actior
y 8/4/2014 5:17:03 PM spid8s Recovery is complete. This is an iriormational message only. No user action is requred
y 8/4/2014 5:17:02 PM sp*d1S$ Service Broker manager has started
y 8/4/2014 5:17:01 PM spidlSs The Database Mrtomg endpomt rs n disabled or stopped state.
y 8/4/2014 517:01 PM spd19* The Service Broker endpomt is in disabled « stopped state
y 8/4/2014 5:17:01 PM $p*d9s Starting up database Terrpdb'.
y 8/4/2014 5:17:01 PM :pd9: Clearing tempdb database.
<| ■ ’ > y 8/4/2014 5:17:00 PM spid9s Starling up database Yrroder.
y 8/4/2014 516:59 PM sp<d9s The resouce database buld version is 11.00.3339. This is an informational message oHy. No user a<
y 8/4/2014 5:16:59 PM sp«J18s Starting up database VI4'
y 8/4/2014 5:16:59 PM $prd17s Starling up database 'rrssdb'.
8/4/2014 8:18:01 PM y 8/4/2014 5:16:59 PM sprd9s Starting up database 'mssqlsystemresource'
Filer: None y 8/4/2014 5:16:59 PM Servei Common language runtime (CLR)functionaHy initialized using CLR version v4.0.30319 fromC:\Wndr v
<p - ill 1
Selected row detafc:
Progress Date 8/4/2014 7:5857 PM
Log SQL Server (Current - 8/4/2014 5:16 00 PM)
Done (58 records). 5
Socrce sgrd54
Message V

1 J

Figure 50 Log File Viewer

The log file entries are displayed in the Log File Viewer .

12 W h a t's N e x t?

The jo b o f a system adm inistrator goes beyond ju s t database m anage­


m ent. Now that you have a deeper understanding o f the general and M ic­
rosoft SQL Server-specific database tasks you will need to perform , it's
tim e to take y o u r skills to the next level. From system m onitoring w ith
SAP Solution M anager to troubleshooting and disaster recovery, learn

55
W h a t 's N e x t? 12

how to handle everything from the routine to the occasional hiccup in


y o u r SAP system.

Recom m endation from O ur Editors

L o o kin g to learn m ore a b o u t system a d m in is tra tio n


in SAP? V is it w w w .s a p -p re s s .c o m /3 6 3 9 and check
o u t th is E -B ite's source b o o k , SAP A d m in is tra tio n —
P ractical G uide!

Buy now and save! Purchase SAP A d m in is tra tio n —


P ractical Guide, and receive a $ 1 0 d is c o u n t w ith y o u r
personal c o u p o n code!

In addition to this book, our editors picked a few other SAP PRESS pub­
lications that you m ight also be interested in. Check out the next page to
learn more!

56
M o r e fro m SAP PRESS

Learn the m ajor tasks for


SAP ASE 1 6 /S y b a s e ASE A d m in is tra tio n :
adm inistering SAP ASE 16! Start with an introduction to the database and
an installation overview, and then move to the inform ation you need to
define database storage areas, create database elem ents, and more.

720 pages, pub. 01/2015


E-book: S59.99 | Print: $69.95 | Bundle: S79.99
www.sap-press.com/3722

This book is y o u r com pan­


SAP D a ta b a s e A d m in is tra tio n w ith IBAA DB2:
ion for y o u r daily tasks in IBM DB2, from setup to decom missioning.
Learn how SAP and DB2 work together, see all adm inistration tools in
action, discover strategies for troubleshooting, and more.

753 b 06/2013
+ E-book:S79.99 | Print: S89.95 | Bundle: $99.99
www.sap-press.com/3272

This guide
SAP B W — A d m in is tra tio n and Perform ance O p tim iz a tio n :
offers the daily, weekly, m onthly, quarterly, and yearly tasks that will
make y o u r SAP BW system shine. Walk through system setup and config­
uration to lay a sound foundation for effective data storage, and then
em ploy tuning techniques to optimize system perform ance.

652 pages, pub. 07/2014


E-book: $69.99 | Print: $79.95 | Bundle: $89.99
www.sap-press.com/3341
S A P PR ESS E -B ite s

SAP PRESS E-Bites provide you w ith a high-quality response to your specific project
need. If you're looking fo r detailed instructions on a specific task; or if you need to
become fam iliar w ith a small, but crucial sub-com ponent o f an SAP product; o r if you
w ant to understand all the hype around product xyz: SAP PRESS E-Bites have you cov­
ered. A uthored by the top professionals in the SAP universe, E-Bites provide the excel­
lence you know from SAP PRESS, in a digestible electronic form at, delivered (and con­
sumed) in a fraction of the tim e!

Sebastian Schreckenbach
SAP Database A d m in is tra tio n fo r Oracle
ISBN 9 7 8 -1 -4 9 3 2 -1 3 9 0 -0 | S9.99 | 100 pages

A bani Pattanayak, W illia m s Ruter


Sm art Data Access: Data V irtu a liz a tio n in SAP H A N A
ISBN 9 7 8 -1 -4 9 3 2 -1 3 7 2 -6 | $ 1 9 .9 9 | 98 pages

Hanck, M a llo ry , M e d a ille


Data P ro visio nin g and Cleansing w ith SAP H A N A SDI and SAP H A N A SDQ
ISBN 9 7 8 -1 -4 9 3 2 -1 3 8 3 -2 | $ 1 4 .9 9 | 97 pages

The A u th o r o f th is E -B ite

Sebastian Schreckenbach has worked as an SAP Basis consultant at


Steria M um m ert Consulting GmbH since 2012, assuming respon­
sibility for various customers in different projects. Prior to that, he
worked as an SAP system adm inistrator for the city administration of
Dresden, Germany. Learn more about Sebastian at https://w w w .sap-
press.com /sap-database-adm inistration-for-m icrosoft-sql-server_
4 1 4 2 /a u th o r/.
Im print

This E-Bite is a publication many contributed to, specifically:

Editor Sarah Frazier


Acquisitions Editor Kelly Grace Weaver
Copyeditor Julie McNamee
Cover Design Graham Geary
Layout Design Graham Geary
Production Kelly O'Callaghan
Typesetting Ill-Satz, Husby (Germany)

ISBN 978- 1-4932- 1396-2


© 2016 by Rheinwerk Publishing, Inc., Boston (MA)
1st edition 2016

A ll righ ts reserved. N eithe r this publication nor any SAP, the SAP logo, ABAP, Ariba, ASAP, Duet, hybris,
part o f it may be copied or reproduced in any form or SAP A daptive Server Enterprise, SAP Advantage Data­
by any means or translated in to another language, base Server, SAP Afaria, SAP A rchiveLink, SAP Busi­
w ith o u t th e p rio r consent o f Rheinwerk Publishing, ness ByDesign, SAP Business Explorer (SAP BEx). SAP
2 Heritage Drive, Suite 305, Quincy, M A 02171. BusinessObjects, SAP BusinessObjects W eb In te lli­
gence, SAP Business One, SAP BusinessObjects
R heinwerk Publishing makes no w arranties or repre­ Explorer, SAP Business W o rkflo w , SAP Crystal Reports,
sentations w ith respect to th e con te n t hereof and spe­ SAP d-code, SAP EarlyWatch, SAP Fiori, SAP Ganges,
cifically disclaim s any im plied w arranties o f m er­ SAP Global Trade Services (SAP GTS), SAP GoingLive,
ch a n ta b ility o r fitness fo r any particular purpose. SAP HANA, SAP Jam, SAP Lumira, SAP M a xA tte n tio n ,
R heinwerk Publishing assumes no responsibility fo r SAP MaxDB, SAP NetWeaver, SAP PartnerEdge, SAP­
any errors th a t may appear in this publication. PHIRE NOW, SAP PowerBuilder, SAP PowerDesigner,
SAP R/2, SAP R/3, SAP Replication Server, SAP SI, SAP
"R heinw erk Publishing" and the Rheinwerk Publishing
SQL A nyw here, SAP Strategic Enterprise M anagem ent
logo are registered tradem arks o f Rheinwerk Verlag
(SAP SEM), SAP StreamW ork, SuccessFactors, Sybase,
GmbH, Bonn, Germany. SAP PRESS is an im p rin t o f
Tw oGo by SAP, and The Best-Run Businesses Run SAP
R heinwerk Verlag GmbH and Rheinwerk Publishing,
are registered o r unregistered tradem arks o f SAP SE,
Inc.
W alldorf, Germany.
A ll o f th e screenshots and graphics reproduced in this
A ll o th e r products m entioned in this book are regis­
book are subject to cop yright © SAP SE, D ietm ar-
tered or unregistered tradem arks o f th e ir respective
H opp-A llee 16, 69 190 W alldorf, Germany.

Vous aimerez peut-être aussi