0LFURVRIW64/6HUYHU
&RQWHQWV
Overview ................................................................................................................13–2
Starting and Stopping the Database ...................................................................13–2
Database Performance .........................................................................................13–4
Scheduling Database Tasks (DB13)....................................................................13–9
Checking the Database Backup (DB12)............................................................13–15
Initializing Backup Tapes ...................................................................................13–18
Database Backups with Microsoft Tools..........................................................13–19
Database Error Logs...........................................................................................13–28
Verify Database Consistency.............................................................................13–29
Run Update Statistics .........................................................................................13–29
System passwords .............................................................................................13–30
2YHUYLHZ
Microsoft SQL Server is a low maintenance database that is increasingly popular with smaller R/3
installations. This chapter will review the database administrative tasks that can be accomplished within
the R/3 System with associated tasks utilizing the Microsoft administrative tools.
6WDUWLQJDQG6WRSSLQJWKH'DWDEDVH
6WDUWLQJWKH'DWDEDVH
1. From the NT desktop, choose Start → Programs → MS SQL Server 7.0 → Service Manager.
2. Choose Start/Continue.
Release 4.6A/B
13–2
Chapter 13: Database Administration – Microsoft SQL Server
Starting and Stopping the Database
6WRSSLQJWKH'DWDEDVH
1. Verify that R/3 has been stopped.
If R/3 has not been stopped, stop R/3 now.
2. From the NT desktop, choose Start→ Programs→ MS SQL Server 7.0 →Service Manager.
3. Choose Stop.
4. Choose Yes.
'DWDEDVH3HUIRUPDQFH
2YHUYLHZ
The CCMS System has tools available for R/3 Administrators to monitor the database for
growth, capacity, I/O statistics, and alerts. This section will discuss the initial transactions
that can help the database administrator.
'DWDEDVH$FWLYLW\67
:KDW
:K\
To manage your system performance, the database must be monitored. One of the
important items is the ability to view the database error log from within R/3. This view
saves the extra effort of logging into the database to view this log.
Release 4.6A/B
13–4
Chapter 13: Database Administration – Microsoft SQL Server
Database Performance
+RZ
*XLGHG7RXU
a. Memory Usage
Procedure cache and Data cache hit
ratio can reflect memory problems.
These values should be greater than 2b
95 percent for optimal memory usage.
b. Server Engine/Elapsed 2c 2c
Shows how hard the CPU has been
working on Microsoft SQL Server
processes. You are interested in the
ratio of busy : idle time.
c. SQL Requests
Allows for snapshots of how SQL
queries are utilizing table access
pertaining to full table or index scans.
A high ratio of full table scans vs. index
scans can indicate performance
bottlenecks.
d. Detail analysis menu
3b
Release 4.6A/B
13–6
Chapter 13: Database Administration – Microsoft SQL Server
Database Performance
'DWDEDVH$OORFDWLRQ'%
:KDW
:K\
One critical reason is to monitor database growth. Using the growth rate you could project
the growth to determine when you may need to get additional disk storage for the database.
+RZ
*XLGHG7RXU
Release 4.6A/B
13–8
Chapter 13: Database Administration – Microsoft SQL Server
Scheduling Database Tasks (DB13)
6FKHGXOLQJ'DWDEDVH7DVNV'%
:KDW
The DBA Planning Calendar (DB13) is the scheduling tool for DBA tasks in R/3. Using the
Calendar, the DBA can schedule many of the DBA tasks that need to be performed, such as:
< Database and transaction log backup
< Update statistics
< Check table and database consistency
:K\
These tasks can be conveniently managed and scheduled without going to the database. The
DBA Planning Calendar works with transaction DB12 (Backup logs). For more information on
transaction DB12, see page 13–15.
+RZ
To schedule a backup task using the DBA Planning Calendar, the backup must be able to
run “unattended,” which means that you must have one of the following options:
< A single tape drive with sufficient capacity to back up the database without changing
tapes.
< Multiple tape drives with sufficient total capacity to back up the database without
changing tapes.
*XLGHG7RXU
Release 4.6A/B
13–10
Chapter 13: Database Administration – Microsoft SQL Server
Scheduling Database Tasks (DB13)
8
9. Select the backup device.
(Select R3DUMP0 if you only have
a single tape drive attached.)
9
10. Choose OK.
10
a. Unload tape
To eject the tape after the 11b
backup is completed.
b. Initialize tape
To overwrite existing data, 11c
rather than appending to last
backup.
11d
c. Verify backup
To verify the backup after it has
run.
If you are doing an online 12
backup when transactions are
being performed, selecting this
option is not useful because the
database changes during this 13
time will cause this test to fail.
d. Format tape
To erase the entire tape and
write a new tape label.
This option is selected when
using a brand new tape, or a
tape that was previously used
with a different application.
12. In Expiration period for backup
volumes, enter the number of days
to protect the tape.
The backup tape is protected from
overwriting by the backup
program for this number of days.
13. Choose OK.
Release 4.6A/B
13–12
Chapter 13: Database Administration – Microsoft SQL Server
Scheduling Database Tasks (DB13)
14
'HOHWLQJDQ(QWU\IURPWKH3ODQQLQJ&DOHQGDU'%
1. On the DBA Planning Calendar,
double-click on the date.
Release 4.6A/B
13–14
Chapter 13: Database Administration – Microsoft SQL Server
Checking the Database Backup (DB12)
3a 3
4. Choose Yes.
&KHFNLQJWKH'DWDEDVH%DFNXS'%
:KDW
The Backup Logs transaction (DB12) provides backup and restore information, such as:
< Log file size and free space in the log file
< Date and time of last successful restore for:
R/3 database
Transaction log
Master database
Msdb database
< Backup history
< Restoration history
< Backup device list
:K\
Do not rely on the “tapes needed for restore” feature. You must have a method that does
not rely on R/3 being available to tell you what tapes you will need to do a restore of the
R/3 system.
If there is a severe disaster, and the R/3 system is lost, R/3 is not available for you to look
at this report.
The only missing information is the run time (duration) of the backup job. This is a problem
indicator, when compared to the expected duration of the backup.
+RZ
*XLGHG7RXU
a. Backup history 4c
A spreadsheet summary of
2 4d
each backup is listed. Each
backup type can be reviewed 4e
with detailed log information
available using History info. 3
(see the SAP R/3 screen below).
b. Restoration history
A spreadsheet of detailed
restoration information is
listed.
Release 4.6A/B
13–16
Chapter 13: Database Administration – Microsoft SQL Server
Checking the Database Backup (DB12)
4e
,QLWLDOL]LQJ%DFNXS7DSHV
:KDW
Initializing the tape writes a label on the tape header. This label is the same as the physical
label of the tape (for example, CD26S).
:K\
The tape label and the expiration date are additional safety levels to prevent backing up to
the wrong tape, and possibly, destroying needed data. When using the DBA Planning
Calendar (DB13) for backups, the tape must be properly labeled to execute a backup to tape,
because the transaction expects a specific tape to be in the drive. If the tape label does not
match the required label, the backup will fail.
+RZ
Initializing and labeling is an option when executing the backup using DB13, SQL Server
Enterprise Manager, or NT Backup. (For SQL Server, see SAP note 141118 for a description
of the tape label naming convention used by DB13).
Release 4.6A/B
13–18
Chapter 13: Database Administration – Microsoft SQL Server
Database Backups with Microsoft Tools
'DWDEDVH%DFNXSVZLWK0LFURVRIW7RROV
Backing up R/3 on SQL Server involves backing up the following SAP-specific and
database-related directories:
< \usr\sap
< \usr\sap\trans
< <homedirectory> of <sid>adm
< \<sid>data
The R/3 database files
< \<sid>log
The R/3 log file
If the log is allowed to grow to capacity and use all available filespace on the drive, SQL
Server will stop. This event is critical, because when R/3 stops, so does the business
processes that require R/3 to be running.
< \tempdb
Also backup the following Microsoft SQL Server databases:
< Master
In case of failures or hardware or software disasters, the Master database contains the
data necessary to recover the database.
< MSDB
The MSDB database contains the data for the SQL Server job scheduler and the database
backup history.
To make the backup process easier, and open to fewer errors, we recommend that you
backup the entire server and not just specific directories and files.
2QOLQH%DFNXS²8VLQJ64/VHUYHU(QWHUSULVH0DQDJHU
:KDW
The SQL 7.0 Enterprise manager is Microsoft SQL Server’s “general tool.” Here it is used to
backup the following while R/3 is running:
< The R/3 database
< The R/3 log
To clear the log, the log backup must periodically be done in the initialization mode.
If the log is allowed to grow to capacity and use all available filespace on the drive, SQL
Server will stop. This event is critical, because when R/3 stops, so does the business
processes that require R/3 to be running.
< \tempdb
You must also backup the following SQL Server databases:
< Master
If there is a hardware or software disaster, the master database contains the data
necessary to recover the database.
< MSDB
The MSDB database contains the data for the SQL Server job scheduler and the database
backup history.
:K\
An online backup allows you to backup the database(s) when R/3 and the database is
running, so that system users are not impacted.
+RZ
Release 4.6A/B
13–20
Chapter 13: Database Administration – Microsoft SQL Server
Database Backups with Microsoft Tools
2. Choose OK.
The backup will now begin.
2
Release 4.6A/B
13–22
Chapter 13: Database Administration – Microsoft SQL Server
Database Backups with Microsoft Tools
2IIOLQH%DFNXS²8VLQJ17%DFNXS
:KDW
The offline backup is done when R/3 and the database are down. Here, we also use the
offline backup to also backup other files which are needed to restore R/3. Since high
capacity tape drives are now more common, it is simpler and safer to backup the entire
server. This full server backup eliminates the possibility of not backing up an important file.
For smaller customers, the entire server could be backed up to a single DLT cartridge.
At a minimum, backing up R/3 on SQL Server involves backing up the following SAP-
specific and database-related directories:
< \usr\sap
< \usr\sap\trans
< <homedirectory> of <sid>adm
< \<sid>data (the R/3 database files)
< \<sid>log (the R/3 log file)
< \tempdb
In addition to these directories, you must back up any directories and files for third-party
products, interfaces, etc. that store their data outside the R/3 database. Getting all the
required files and directories can be difficult, which is why we recommend that you backup
the entire server.
:K\
The data in the database does not change while the backup is being made, which means that
you have a static “picture” of the database and do not have to deal with the issue of data
changing while the backup is being run. With some third party applications, you cannot
back up the files unless they are closed, and this is not possible unless R/3 and the
application are shut down. Therefore, an offline backup needs to be done. A “full server”
offline backup also gives you the most complete backup in the event of a catastrophic
disaster. On one tape, you have everything on the server.
+RZ
Due to system limitations on the documentation system, the location of the files in this
example are presented differently from the recommendations in the SAP installation
manual.
Release 4.6A/B
13–24
Chapter 13: Database Administration – Microsoft SQL Server
Database Backups with Microsoft Tools
*XLGHG7RXU
13
16
17
Release 4.6A/B
13–26
Chapter 13: Database Administration – Microsoft SQL Server
Database Backups with Microsoft Tools
'DWDEDVH(UURU/RJV
5²67
You can view the database error logs from within R/3 using transaction ST04. For more
information on database error logs, see the Database Performance Analysis (ST04) section
earlier in this chapter.
0LFURVRIW64/6HUYHU(QWHUSULVH0DQDJHU
*XLGHG7RXU
1. From the NT desktop, choose Start → Programs → Microsoft SQL Server 7.0 → Enterprise Manager.
In the Enterprise Manager:
2. Expand the SQL Server Group
under which your server is
located.
3. Expand the server where the R/3
system is installed. 2
3
4. Expand Management.
4
5. Expand the SQL Server Logs.
Release 4.6A/B
13–28
Chapter 13: Database Administration – Microsoft SQL Server
Verify Database Consistency
9HULI\'DWDEDVH&RQVLVWHQF\
:KDW
In a database management system, consistency can be represented from the logical and
physical levels. R/3 must insure a logical consistency when communicating with the SQL
Server engine, and SQL Server must insure a physical consistency for the database.
:K\
Sometimes a physical inconsistency can occur in the database’s internal structures. This
problem occurs when R/3 “thinks” the data is, and where the data actually is, in the
database are different.
+RZ
SQL Server uses the DBCC CHECKDB command to correct and repair the database to a
consistent state. This is executed using:
< CCMS Scheduling calendar (DB13)
< The SQL Server Enterprise Manager
The consistency checks should be done during non-peak hours or when R/3 users are
offline. For those coming from SQL Server 6.5 environments, SQL Server 7.0 executes the
DBCC CHECKDB job much faster than SQL Server 6.5.
5XQ8SGDWH6WDWLVWLFV
:KDW
:K\
The optimizer of the database engine will perform better if the table index’s statistical
information is current. This information helps R/3 find an item in the database faster.
+RZ
By default, SQL Server 7.0 has automatic statistics turned on. The possibility of manually
scheduling update statistics using the CCMS scheduling calendar still exists. Examples of
when this scheduling might be necessary after large data inserts or deletes from a given
table (for example, client copy, BDC sessions, and archiving).
6\VWHPSDVVZRUGV
64/VHUYHU
For additional information, see SAP note 28893.
User IDs to change:
< sa
< sapr3
+RZ
*XLGHG7RXU
1. From the NT desktop, choose Start → Programs → Microsoft SQL Server 7.0 → Enterprise Manager.
In the SQL server Enterprise Manager:
2. Expand the SQL Server Group.
3. Expand the server.
4. Expand Security.
5. Choose Logins.
2
3
4
5
Release 4.6A/B
13–30
Chapter 13: Database Administration – Microsoft SQL Server
System passwords
11
12
Release 4.6A/B
13–32
Chapter 13: Database Administration – Microsoft SQL Server
System passwords
Release 4.6A/B
13–34