DBA-SQ~1

34
7/31/2019 DBA-SQ~1 http://slidepdf.com/reader/full/dba-sq1 1/34  System Administration Made Easy 13  –1 &KDSWHU 'DWDEDVH$GPLQLVWUDWLRQ² 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

Transcript of DBA-SQ~1

Page 1: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 1/34

 

System Administration Made Easy 13 –1

&KDSWHU'DWDEDVH$GPLQLVWUDWLRQ²

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

Page 2: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 2/34

Chapter 13: Database Administration – Microsoft SQL Server

Overview

Release 4.6A/B 

13–2 

2YHUYLHZ

Microsoft SQL Server is a low m aintenance da tabase that is increasingly popu lar with sm aller R/ 3

installations. This chapter w ill review the d atabase ad ministrative tasks that can be accomp lished within

the R/ 3 System w ith associated tasks u tilizing th e Microsoft adm inistrative tools.

6WDUWLQJDQG6WRSSLQJWKH'DWDEDVH

6WDUWLQJWKH'DWDEDVH

1. From the NT desktop, choose Start → Programs → MS SQL Server 7.0→  Service Manager .

2. Choose Start/Continue.

3. Check tha t Microsoft SQL Server

is started by checking th e color

and shap e of the status icon (the

green arrow), and the status

message at the bottom of the

window. 

2

3

3

Page 3: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 3/34

Chapter 13: Database Administration – Microsoft SQL Serve

Starting and Stopping the Database

System Administration Made Easy13–3 

6WRSSLQJWKH'DWDEDVH

1. Verify that R/ 3 has been stopped .

If R/ 3 has not been stopped, stop R/ 3 now.

Follow the p roper procedure to stop R/ 3.

2. From the NT desktop, choose Start → Programs→   MS SQL Server 7.0 → Service Manager .

3. Choose Stop. 

4. Choose Yes. 

5. Check that Microsoft SQL Server

is stopp ed by checking th e color

and shape of the status icon (a red

square), and the status m essage at

the bottom.

For more information on stopp ing the d atabase, see chapter 9.

4

3

5

5

Page 4: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 4/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Performance

Release 4.6A/B 

13–4 

'DWDEDVH3HUIRUPDQFH

2YHUYLHZ

The CCMS System has tools available for R/ 3 Adm inistrators to mon itor the da tabase forgrowth, capacity, I/ O statistics, and alerts. This section will discuss the initial transactions

that can help the database adm inistrator.

'DWDEDVH$FWLYLW\67

:KDW

The Database Performance Monitor (ST04) provides a database-ind epend ent tool to analyze

and tu ne the following compon ents:

< Memory and buffer usage

<

Space u sage< CPU usage

< SQL requ ests

< Detailed SQL items

:K\

To manage your system p erformance, the database m ust be monitored. One of the

importan t items is the ability to view the d atabase error log from w ithin R/ 3. This view

saves the extra effort of logging into the d atabase to view this log.

Page 5: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 5/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Performance

System Administration Made Easy13–5 

+RZ

 

*XLGHG7RXU

1. In the Command field, enter transaction ST04 and choose Enter  (or from th e SA P standard menu, choose Tools →   Administration →   Monitor  →  Performance →   Database→

ST04 - Activity). 

2. An initial overv iew of database activity is

provided which pertains to database,

operating system, CPU, and mem ory.

Microsoft SQL Server allows th e ana lysis

of specific attribu tes perta ining to

mem ory, space, I/ O, and qu ality of table

reads and wr ites. This information can

signal adjustm ents necessary to imp rove

performan ce of the database.

In the screen to the right, some importan t

areas are highlighted :

a.  Memory Usage

Procedure cache and Data cache hit 

ratio can reflect memory p roblems.

These values shou ld be greater than

95 percent for optimal mem ory u sage.

b. Server Engine/Elapsed 

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 snap shots of how SQL

queries are utilizing table access

pertaining to full table or ind ex scans.

A high ratio of  full table scans vs. index

scans can indicate performance

bottlenecks.

d .  Detail analysis menu  

2c

2b

2a

2d

2a

2c

Page 6: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 6/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Performance

Release 4.6A/B 

13–6 

3. This screen is the  Detailed analysis menu 

(option 2D).

c. This screen is comp osed of the

following three sections:

< Analyze d atabase activity

< Analyze exceptional cond itions

< Add itional functions

d. Areas of common interest are:

< Server details

< SQL processes

<  Error logs (see the following screen )

c.  Additional functions are links to

transactions that w ill be d iscussed in

later sections. 

This screen shows th e Database Error Log.

3a

3a

3a

3b 3b

3b

3b

3c

Page 7: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 7/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Performance

System Administration Made Easy13–7 

'DWDEDVH$OORFDWLRQ'%

:KDW

The Database Allocation transaction is used to ana lyze:

< Database growth

< Database ind ex, consistency, etc.

< Tables

:K\

One critical reason is to mon itor database grow th. Using the grow th rate you could p roject

the growth to d etermine wh en you may need to get add itional disk storage for the database

+RZ

 

*XLGHG7RXU

1. In the Command field, enter transaction DB02 and choose Enter  

(or from th e SA P standard menu, choose Tools →   Administration →   Monitor  →  Performance →   Database→  

 DB02-Tables/Indexes).

2. An initial review wou ld identify

the typ e of database, name, size,

file systems, and totals for

database objects.

The following describes some of the features of the screen to th e

right:

a.  Database information ind icates

space used for data and log

information.

b.  DB space history takes you to

th e View database history screen.

c.  DB analysis takes you to an

analysis menu screen.

d. To determ ine attributes for aspecific da tabase object, use

 Detail analysis to make

decisions for an individu al

object.

2b2a

2c

2d

Page 8: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 8/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Performance

Release 4.6A/B 

13–8 

This screen is the DB space history 

display.

A spread sheet allowing an alysis

based on calenda r scenarios exists

with th e ability to sort on columninformation.

1. To view by file, choose Files.

Here you can analyze the physical

file information. 

This screen is the DB analysis 

display.

From here, the adm inistrator can:

< Analyze the d atabase for

missing indexes, conflicts

between ABAP Dictionary and

database, an d  R/ 3 Kernel

integrity. 

< Perform a database

consistency check. 

Analysis can be d one for table

specific objects to determine the

largest tables, and tables that aremodified. 

1

Page 9: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 9/34

Chapter 13: Database Administration – Microsoft SQL Serve

Scheduling Database Tasks (DB13

System Administration Made Easy13–9 

6FKHGXOLQJ'DWDEDVH7DVNV'%

:KDW

The DBA Planning Calendar ( DB13) is the sched uling tool for DBA tasks in R/ 3. Using theCalendar , the DBA can schedu le many of the DBA tasks that need to be performed , such as:

< Database and transaction log backup

< Upd ate statistics

< Check table and da tabase consistency

:K\

These tasks can be conveniently man aged an d schedu led withou t going to the database. The

 DBA Planning Calendar works with transaction DB12 (Backup logs). For more informat ion on

transaction DB12, see page 13–15.

+RZ

 

To schedu le a backup task using the  DBA Planning Calendar , the backup mu st be able to

ru n “un attend ed,” which means that you mu st have one of the following options:

< A single tape d rive with sufficient capacity to back up the d atabase without chan ging

tapes.

< Multiple tape d rives with sufficient total capacity to back up the d atabase w ithout

changing tapes.

Page 10: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 10/34

Chapter 13: Database Administration – Microsoft SQL Server

Scheduling Database Tasks (DB13)

Release 4.6A/B 

13–10 

*XLGHG7RXU

 

1. Enter tran saction DB13 and choose Enter .

(or from th e SAP standard menu, choose Tools → CCMS → DB Administration → DB13-DBA PlanningCalendar). 

2. Double-click on the date.

If a task exists for that d ay, this

window appears.

3. Choose Insert to add a n ew task.

3

2

Page 11: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 11/34

Chapter 13: Database Administration – Microsoft SQL Serve

Scheduling Database Tasks (DB13

System Administration Made Easy13–11 

4. In StartTime, enter the time to begin

the backup .

The start time is the time on the

database server.

5. Under Action, select a task (for

example, Full Database Backup).

6. Choose Continue.

7. Select all the da tabases.

8. Choose OK .

9. Select the backup dev ice.

(Select R3DUM P0 if you on ly have

a single tape d rive attached .)

10. Choose OK .

8

7

4

5

6

9

10

Page 12: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 12/34

Chapter 13: Database Administration – Microsoft SQL Server

Scheduling Database Tasks (DB13)

Release 4.6A/B 

13–12 

11. In the Log backup tape options pop-

up wind ow, select the following

options as appropriate:

a. Unload tape 

To eject the tap e after the

backup is completed.

b.  Init ialize tape

To overwrite existing d ata,

rather than ap pend ing to last

backup.

c. Verify backup 

To verify the backup after it has

run.

If you are d oing an online

backup when transactions are

being p erformed, selecting thisoption is not useful because the

database chang es du ring this

time w ill cause th is test to fail.

d . Format tape 

To erase the entire tape an d

write a new tape label.

This option is selected w hen

using a brand new tape, or a

tape that was previously used

with a different ap plication.

12. In  Expiration period for backup

volumes, enter the nu mber of days

to protect the tape.

The backup tap e is protected from

overwr iting by the backup

program for this nu mber of days.

13. Choose OK .

11a

13

12

11b

11c

11d

Page 13: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 13/34

Chapter 13: Database Administration – Microsoft SQL Serve

Scheduling Database Tasks (DB13

System Administration Made Easy13–13 

14. The task will be listed in the d ay.

'HWHUPLQLQJWKH7DSH/DEHO1HFHVVDU\IRUD%DFNXS

1. Double-click on the day.

1

14

Page 14: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 14/34

Chapter 13: Database Administration – Microsoft SQL Server

Scheduling Database Tasks (DB13)

Release 4.6A/B 

13–14 

2. If there is more than one entry,

select the backup en try.

3. Choose Volumes needed to  see what

tape (label nam e) is required for

that backup.

Using the correct tape is

importan t. If the wrong tap e is

used , the backup will fail. For

further information on tape

labeling, see chap ter 3.

4. The required tape is displayed (for

example, CD27S).

'HOHWLQJDQ(QWU\IURPWKH3ODQQLQJ&DOHQGDU'%

1. On the DBA Planning Calendar ,

dou ble-click on the d ate.

3

2

4

1

Page 15: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 15/34

Chapter 13: Database Administration – Microsoft SQL Serve

Checking the Database Backup (DB12

System Administration Made Easy13–15 

2. Select the item to delete.

3. Choose Delete.

a. Here you can also choose Change 

to change the options you

originally selected for the job.

4. Choose Yes.

5. The item has been deleted.

6. Choose .

&KHFNLQJWKH'DWDEDVH%DFNXS'%

:KDW

The Backup Logs transaction ( DB12) provides backup an d r estore information, such as:

< Log file size and free space in the log file

< Date an d tim e of last successful restore for:

R/ 3 database

Transaction log

Master database

Msdb d atabase

< Backup history

< Restoration history

< Backup dev ice list

2

3

4

5

6

3a

Page 16: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 16/34

Chapter 13: Database Administration – Microsoft SQL Server

Checking the Database Backup (DB12)

Release 4.6A/B 

13–16 

< SQL Server jobs

< Tapes needed for restore

:K\

It is a convenient “one stop” point for backup information.Some of the importan t backup information su ch as tape label nam e is passed to DB12 from

 DB13. The “tap es needed for restore” option is important.

Do not rely on the “tap es needed for restore” feature. You m ust have a m ethod th at does

not rely on R/ 3 being available to tell you w hat tap es you w ill need to d o a restore of the

R/ 3 system.

If there is a severe disaster, and th e R/ 3 system is lost, R/ 3 is not available for you to look 

at this report.

The only missing informa tion is the ru n time (duration) of the backup job. This is a problem

indicator, wh en compared to the expected du ration of the backup.

+RZ 

*XLGHG7RXU

1. In the Command field, enter transaction DB12 and choose Enter  

(or from th e SAP standard menu, choose Tools → CCMS → DB Administration → DB12-Backup logs). 

2. Review log space information to

analyze growth.

3. Review backup informa tion and

notice the d ate and time of success

or failures.

4. The following is a list of the

available buttons an d th eir

functions:

a.  Backup history 

A spreadsheet sum mary of 

each backu p is listed. Each

backup typ e can be reviewed

with d etailed log informationavailable using History info. 

(see the SAP R/3 screen below).

b.  Restoration history 

A spread sheet of detailed

restoration information is

listed.

2

3

4b4a

4c

4d

4e

Page 17: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 17/34

Chapter 13: Database Administration – Microsoft SQL Serve

Checking the Database Backup (DB12

System Administration Made Easy13–17 

c.  Backup device list  

Each logical dev ice nam e is

listed with the appropriate

ph ysical device name (see the

 Backup Device List screen

below).

d. SQL Server jobs 

A sp readsh eet listing of all

scheduled jobs with options

for CCMS, Database and History

 Info is listed . History Info lists

the specifics of the job, that

pertain to success or failure of 

the job.

e. Tapes needed For restore

A listing of the tapes tha t are

needed to restore the various

databases. Scroll to the bottom 

of the screen, for the

instructions to r estore the

da tabase (see the Tapes Needed 

For Restore screen below).

4a

4c

Page 18: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 18/34

Chapter 13: Database Administration – Microsoft SQL Server

Initializing Backup Tapes

Release 4.6A/B 

13–18 

,QLWLDOL]LQJ%DFNXS7DSHV

:KDW

Initializing the tap e writes a label on the tap e head er. This label is the sam e as the ph ysical

label of the tape (for exam ple, CD26S).

:K\

The tape label and the expiration date are ad ditional safety levels to prevent backing up to

the wron g tape, and p ossibly, destroying needed d ata. When u sing the  DBA Planning

Calendar ( DB13) for backup s, the tape mu st be properly labeled to execute a backup to tap e,

because the tran saction expects a specific tape to be in the d rive. If the tap e label does not

match th e required label, the backup will fail.

+RZ

Initializing and labeling is an option when executing the backup u sing DB13, SQL Server

Enterp rise Manager, or NT Backup . (For SQL Server, see SAP note 141118 for a d escription

of the tape label nam ing convention used by  DB13).

4e

Page 19: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 19/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Backups with Microsoft Tools

System Administration Made Easy13–19 

'DWDEDVH%DFNXSVZLWK0LFURVRIW7RROV

Backing up R/ 3 on SQL Server inv olves backing up the following SAP-specific and

database-related directories:

<  \ usr\ sap

<  \ usr\ sap\ tran s

< <homedirectory> of <sid>adm

<  \ <sid>d ata

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 dr ive, SQL

Server w ill stop. This event is critical, because w hen R/ 3 stops, so does the bu sinessprocesses that require R/ 3 to be running.

<  \ tempdb

Also backup the following Microsoft SQL Server databases:

< Master

In case of failures or ha rd ware or software d isasters, the Master database contains the

da ta necessary to recover the database.

< MSDB

The MSDB database contains the data for the SQL Server job sched uler an d the d atabase

backup history.

To make the backup process easier, and open to fewer errors, we recommend that you

backup the en tire server and not just specific directories and files.

2QOLQH%DFNXS²8VLQJ64/VHUYHU(QWHUSULVH0DQDJHU

:KDW

The SQL 7.0 Enterp rise manager is Microsoft SQL Server’s “general tool.” Here it is used to

backup the following while R/ 3 is run ning:

< The R/ 3 database

< The R/ 3 log

To clear the log, the log backup mu st periodically be d one in th e initialization m ode.

If the log is allowed to grow to capacity and use all available filespace on the dr ive, SQL

Server w ill stop. This event is critical, because w hen R/ 3 stops, so does the bu siness

processes that require R/ 3 to be running.

Page 20: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 20/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Backups with Microsoft Tools

Release 4.6A/B 

13–20 

<  \ tempdb

You mu st also backup the following SQL Server d atabases:

< Master

If there is a hard ware or software disaster, the master da tabase contains the d ata

necessary to recover the d atabase.

< MSDB

The MSDB database contains the d ata for the SQL Server job sched uler an d the d atabase

backup history.

:K\

An online backup allows you to backup the database(s) when R/ 3 and the d atabase is

run ning, so that system u sers are not imp acted.

+RZ

To backup any of the databases mentioned above:

1. On the NT desktop, choose Start  → Programs →  Microsoft SQL Server 7.0 →  Enterprise Manager .

In the Enterprise Manager :

2. Expan d the SQL Server Group under

which your server is located. (You

may h ave a d ifferent group name.)

3. Expan d the server that you want to

look at. (You w ill hav e a d ifferent

server name.)

4. Choose Management  

5. Choose Backup.

6. Choose Tools →   Backup Database.

23

4

5

6

Page 21: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 21/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Backups with Microsoft Tools

System Administration Made Easy13–21 

7. In  Database, choose to select the

database to backup.

8. Und er backup, select the type of 

backup to p erform (for example,

 Database - complete).

Select Database – complete to do a full

backup of the database. Select

Transaction log to backup only the

transaction log.

9. Under Destination:

< Select the media (in th is case

Tape)

< Select the device R3DUMP0.

10. Under Overwrite select Overwrite

existing media.

11. Choose the Options tab.

12. Under Options, select:

< Verify backup upon completion 

< E ject tape after backup 

<  Backup set will expire 

13. Under Backup set will expire, select

one of the following options an dcomplete the entry field:

<  A fter (a defined n um ber of days),

then enter the num ber of days.

< On (a specific date), then enter

the date.

10

7

8

9

12

12

12

11

13

Page 22: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 22/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Backups with Microsoft Tools

Release 4.6A/B 

13–22 

On th e screens below, you have th ree options:

< Backup withou t checking the tap e label.

< Backup checking the tape label.

< Initialize the tap e and wr iting a n ew tap e label, before backing u p.

To backup w ithout checking the tapelabel:

1. Leave the following op tions

deselected:

< Check media set name and backup set 

expiration

<  Init ialize and label media

This step w ill overwrite and destroy

any d ata on the tap e. Be certain that

the correct tape is in th e dr ive.

2. Choose OK .

The backup will now begin.

2

1

1

Page 23: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 23/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Backups with Microsoft Tools

System Administration Made Easy13–23 

To check the tape label before backing

up:

1. Select Check media set name and 

backup set expiration.

2. Enter the tap e label in  Media set name (for example, RD26S). 

3. Choose OK , to begin the backup .

If the label of the tape does n ot

match the name entered in Media set 

name, the backup w ill fail.

To initialize the tape before backing

up:

1. Select Init ialize and label media.

2. Enter the tape label nam e in Media

set name (for example, RD26S). 

This step will relabel, overw rite, and

destroy any data on the tape. Be

certain th at the correct tape is in the

drive.

3. Choose OK to begin the backup .

3

3

1

2

12

Page 24: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 24/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Backups with Microsoft Tools

Release 4.6A/B 

13–24 

2IIOLQH%DFNXS²8VLQJ17%DFNXS

:KDW

The offline backup is don e when R/ 3 and the database are down . Here, we also use the

offline backup to also backup other files wh ich are needed to restore R/ 3. Since highcapacity tape d rives are now m ore common, it is simp ler and safer to backup th e entire

server. This full server backup eliminates th e possibility of not backing up an importan t file.

For smaller customers, the en tire server could be backed up to a single DLT cartridge.

At a minimu m, backing u p R/ 3 on SQL Server involves backing up the following SAP-

specific and database-related directories:

<  \ usr\ sap

<  \ usr \ sap\ tran s

< <homedirectory> of <sid>adm

<  \ <sid >d ata (th e R/ 3 database files)

<  \ <sid >log (th e R/ 3 log file)

<  \ tempdb

In add ition to these directories, you mu st back up an y directories and files for third-pa rty

prod ucts, interfaces, etc. that store their d ata ou tside th e R/ 3 database. Getting all the

required files and directories can be d ifficult, wh ich is wh y we r ecomm end that you backup

the entire server.

:K\

The data in the database does not change wh ile the backup is being made, wh ich mean s that

you hav e a static “picture” of the database and do not h ave to deal with the issue of da ta

changing wh ile the backup is being ru n. With some third par ty app lications, you cannot

back up the files un less they are closed, and this is not possible un less R/ 3 and th e

app lication are sh ut d own . Therefore, an offline backup needs to be d one. A “full server”

offline backup also gives you th e most complete backup in the event of a catastroph ic

disaster. On one tap e, you have everything on the server.

+RZ

 

Due to system limitations on the d ocumentation system, the location of the files in this

example are p resented d ifferently from the r ecommend ations in the SAP installation

manual.

Page 25: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 25/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Backups with Microsoft Tools

System Administration Made Easy13–25 

*XLGHG7RXU

To do an offline backup, we use NT Backup interactively:

1. Shut dow n R/ 3.

2. Shu t dow n the database.

3. Shu t dow n any other app lications.

4. Insert the app ropr iate tape into drive.

5. On the NT desktop, choose Start →  Programs →   Administrative Tools →   Backup.

6. Select all d rives on the server . 

7. Choose Backup. 

Enter appropriate informa tion in the

 Backup In formation dialog box.

8. In Tape Name, enter the tap e label

nam e (for example, CD26S).

9. Select Verify A fter Backup.

10. If your tape dr ive sup ports

hard ware compression, select

 Hardware Compression.

11. Under Operation , select Replace. 

12. In  Description, enter a d escription.

13. Choose OK .

9

10

11

12

13

8

6

7

Page 26: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 26/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Backups with Microsoft Tools

Release 4.6A/B 

13–26 

14. This wind ow w ill app ear to verify

that the correct tape is in the d rive.

Even if the tape name you entered

in the previous screen m atches the

tape label, this wind ow w ill

appear.

15. Choose Yes.

16. The backup will run . The w indow

displays the backup progress.

17. When the backup has successfully

completed, choose OK .

14

17

16

15

Page 27: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 27/34

Chapter 13: Database Administration – Microsoft SQL Serve

Database Backups with Microsoft Tools

System Administration Made Easy13–27 

18. From the m enu ba r, choose

Operations → Exit .

19. Remove the tape from the tape

drive and store properly.

18

Page 28: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 28/34

Chapter 13: Database Administration – Microsoft SQL Server

Database Error Logs

Release 4.6A/B 

13–28 

'DWDEDVH(UURU/RJV

5²67

You can view the d atabase error logs from within R/ 3 using tran saction ST04. For more

information on d atabase error logs, see the Database Performance Analysis (ST04) section

earlier in th is chap ter.

0LFURVRIW64/6HUYHU(QWHUSULVH0DQDJHU 

*XLGHG7RXU

1. From the NT desktop, choose Start  → Programs →  Microsoft SQL Server 7.0 →  Enterprise Manager .

In the Enterp rise Manager:

2. Expan d the SQL Server Group und er which your server is

located.

3. Expand the server where the R/ 3

system is installed.

4. Expand  Management .

5. Expan d the SQL Server Logs.

6. Select the Current log.

Here, you can also look at the six

previous error logs.

7. Read the log in the right-hand side

window. 

23

4

5

6

7

Page 29: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 29/34

Chapter 13: Database Administration – Microsoft SQL Serve

Verify Database Consistency

System Administration Made Easy13–29 

9HULI\'DWDEDVH&RQVLVWHQF\ 

:KDW

In a d atabase man agement system, consistency can be represented from th e logical andph ysical levels. R/ 3 must insure a logical consistency when commu nicating w ith the SQL

Server engine, and SQL Server m ust insu re a p hysical consistency for the da tabase.

:K\

Sometimes a physical inconsistency can occur in the database’s internal structures. This

problem occurs w hen R/ 3 “thinks” the data is, and wh ere the data actually is, in the

database are d ifferent.

+RZ

SQL Server uses th e DBCC CHECKDB comman d to correct and rep air the database to a

consistent state. This is executed using :

< CCMS Schedu ling calend ar ( DB13)

< The SQL Server Enterpr ise Manager

The consistency checks shou ld be done d uring non -peak hours or wh en R/ 3 users are

offline. For th ose coming from SQL Server 6.5 environ men ts, SQL Server 7.0 executes the

 DBCC CHECKDB job much faster than SQL Server 6.5.

5XQ8SGDWH6WDWLVWLFV

:KDW

Database objects statistics help m ake d ata access more efficient.

:K\

The optimizer of the da tabase engine w ill perform better if the table index’s statistical

informa tion is curr ent. This informa tion helps R/ 3 find an item in the d atabase faster.

+RZ

By d efault, SQL Server 7.0 has automatic statistics turned on. The possibility of manu ally

scheduling update statistics using the CCMS scheduling calendar still exists. Examples of wh en this schedu ling m ight be necessary after large data inserts or deletes from a given

table (for examp le, client copy, BDC sessions, and archiving ).

Page 30: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 30/34

Chapter 13: Database Administration – Microsoft SQL Server

System passwords

Release 4.6A/B 

13–30 

6\VWHPSDVVZRUGV

64/VHUYHU

For ad ditional informa tion, see SAP n ote 28893.

User IDs to change:

< sa

< sapr3

During the installation, by default:

< SQL server does not ask for, nor d oes it set, a password for user sa.

Once the installation is comp lete, the system ad ministrator mu st man ually create a

password.

< For user sapr3, a password is created, but it is created with a d efault password .

Therefore, you m ust chan ge the p assword . Beginning w ith release 4.5, user sapr3 is no

longer used by R/ 3.

These “looph oles” mu st be closed m anu ally.

+RZ 

*XLGHG7RXU

 

1. From the NT desktop, choose Start  → Programs →  Microsoft SQL Server 7.0 →  Enterprise Manager .

In the SQL server Enterprise Manager :2. Expan d the SQL Server Group.

3. Expan d the server.

4. Expand Security.

5. Choose Logins.

3

4

2

5

Page 31: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 31/34

Chapter 13: Database Administration – Microsoft SQL Serve

System passwords

System Administration Made Easy13–31 

6. On the right side of the screen,

double-click “sa” (or “sapr3,” if 

sapr3 was created). 

7. Choose General tab.

8. Enter new passw ord in Password .

9. Choose Apply.

10. Reenter the password in Confirm

 New Password .

11. Choose OK .

10

11

7

8

9

6

Page 32: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 32/34

Chapter 13: Database Administration – Microsoft SQL Server

System passwords

Release 4.6A/B 

13–32 

12. Choose OK .

For user sapr3, up throu gh release 4.0,

the following a lso needs to be d one:

13. In the SQL Server Enterprise

 Manager Console, choose Tools →  

SQL Query Analyzer.

12

13

Page 33: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 33/34

Chapter 13: Database Administration – Microsoft SQL Serve

System passwords

System Administration Made Easy13–33 

14. Enter the following SQL

commands:

use <SAPSID>

go

sap_change_password‘<OLD_PASSWD>’,

‘<NEW_PASSWD>’

15. Choose Execute Query (or choose

Query →   Execute Query).

15

14

Page 34: DBA-SQ~1

7/31/2019 DBA-SQ~1

http://slidepdf.com/reader/full/dba-sq1 34/34

Chapter 13: Database Administration – Microsoft SQL Server

System passwords