Vous êtes sur la page 1sur 18

Performing a Restore Using SAPDBA Overview

Chapter 94: Performing a Restore Using SAPDBA


Contents
Overview ................................................................ ................................................................................................ ................................................................ ................................................................ ................................................ ................941 941 Before you Begin ................................................................ ................................................................................................ ................................................................ ................................................................ .................................... ....941 941 Stopping the SAP and Database Instances................................ Instances................................................................ ................................................................ ............................................................... ...............................941 941 Performing the Restore................................ Restore................................................................ ................................................................ ................................................................ ............................................................ ............................945 945 Checking the Database ................................................................ ................................................................................................ ................................................................ ........................................................... ...........................949 949 Performing a Safe Check................................ Check................................................................ ................................................................ ................................................................ ....................................................... .......................9413 9413

Overview
In the unfortunate event of data loss or corruption, you will need to restore the data to your system from a backup tape or disk. This chapter describes in detail how to perform a restore using the SAP Database Administration (SAPDBA ) utility. In the example that follows, we restore the tablespace PSAPUSER1D.

In this example, after the tablespace PSAPUSER1D has been backed up, it is purposefully corrupted by renaming it in the File Manager. During the restore, the database will not find this file and, therefore, the original file will be restored from the tape.

Before you Begin


It is recommended that you use a tape drive (instead of a disk drive) for the backup. If you are using a tape drive, then follow these steps before you begin: Turn on backup tape drive before starting computer. Determine which backup tapes or disks are required and have them ready for use.

Stopping the SAP and Database Instances


1. To stop the SAP Instance, open the SAP Service Manager and click on the Stop button. You can leave this window open and proceed to the next step.
1

1996 SAP Technology, Inc.

941

Performing a Restore Using SAPDBA Stopping the SAP and Database Instances

2. To begin the database shutdown, enter sapdba at the MS-DOS Prompt.

3. Enter a to select Startup/Shutdown instance.

4. Enter b to select Shutdown

942

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Stopping the SAP and Database Instances

5. Enter a to select Shutdown normal.

6. Press Return to continue.

7. Enter q to Return to the previous screen.

1996 SAP Technology, Inc.

943

Performing a Restore Using SAPDBA Stopping the SAP and Database Instances

8. Enter q to Return to the previous screen.

9. Enter q to quit SAPDBA. 10. Enter y to confirm that you really want to quit SAPDBA.

9 10

To simulate data corruption or data loss, we rename the physical data file user1d.data1 for the tablespace PSAPUSER1D so that the database will not find PSAPUSER1D. You can do the same if you are using this chapter for testing or training:

12

11. In the File Manager, select the directory path <sapsid> sapdata4 user1d_1. 12. Select the file user1d.data1.
11

944

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Performing the Restore

13. Follow the path File Rename.

13

14. In this example, we rename the file user1d.data1.corruptedto simulate the file being corrupted or accidentally deleted by a user. 15. Click OK. The file is renamed.

15 14

Performing the Restore


1. Double-click on the MS-DOS icon in the Main program group.
1

1996 SAP Technology, Inc.

945

Performing a Restore Using SAPDBA Performing the Restore

2. Enter sapdba.
2

3. Enter k to select Restore/Recovery.

4. Enter c to select Restore one tablespace.

5. Enter the name of the tablespace you want to restore. Since it is reported that user1d.data1 cannot be found, the corresponding tablespace, PSAPUSER1D, should be restored.

946

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Performing the Restore

6. Enter the number of the BRBACKUP run from which you want to restore the tablespace.
7

It is recommended to select the most recent backup file. 7. Press Return to continue. 8. Enter q to return.

9. Enter y to continue.

1996 SAP Technology, Inc.

947

Performing a Restore Using SAPDBA Performing the Restore

10. Enter cont to continue.

10

11. Enter cont to continue.

11

12. Ensure your backup tape with the requested label (in this example, ERCB02) is inserted into the backup drive. 13. Enter cont to continue.
12

13

14. Press Return to continue.

14

948

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Checking the Database

15. Enter q to return.

15

Checking the Database


1. Enter j to select Check (and repair) database.

2. Enter a to select check database.

1996 SAP Technology, Inc.

949

Performing a Restore Using SAPDBA Checking the Database

3. Press Return to continue.

4. Press Return to continue.

5. Press Return to continue.

9410

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Checking the Database

6. Since we already selected the latest data file, answer no to the question by entering n.

7. Press Return to continue.

8. For options b - e, select the items with the Status listed as needed or not finished. 9. Since Recover database is not finished, enter f to select it.

1996 SAP Technology, Inc.

9411

Performing a Restore Using SAPDBA Checking the Database

10. Press Return to continue.

10

11. Press Return to continue.

11

12. Press Return to continue.

12

9412

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Performing a Safe Check

13. Enter a and follow the preceding steps to check the database again.

13

14. Press Return to continue 15. Press Return to continue

14

15

Performing a Safe Check


1. Enter y for a safe check.

1996 SAP Technology, Inc.

9413

Performing a Restore Using SAPDBA Performing a Safe Check

2. Enter y to shutdown the database immediately.

3. Press Return to continue.

4. Press Return to continue.

9414

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Performing a Safe Check

5. Press Return to continue.

6. Press Return to continue.

7. Enter y to start the database.

1996 SAP Technology, Inc.

9415

Performing a Restore Using SAPDBA Performing a Safe Check

8. Press Return to continue.

9. Press Return to continue.

10. You did it! This text indicates that the database is OK. 11. Press Return to continue.

10 11

9416

1996 SAP Technology, Inc.

Performing a Restore Using SAPDBA Performing a Safe Check

12. Enter q to return.

12

13. Enter q to quit. 14. Enter y to confirm that you really want to quit.

13 14

1996 SAP Technology, Inc.

9417

Performing a Restore Using SAPDBA Performing a Safe Check

For further details refer to R/3 System Administration Made Easy Initializing Tapes for Database Backup and Archiving (Ch. 90) Performing an Offline Backup Using SAPDBA (Ch. 91) Performing an Online Backup Using SAPDBA (Ch. 92) Performing an Archive Backup Using SAPDBA (Ch. 93) R/3 Basis Knowledge Products DBA Oracle CD R/3 System Online Help Basis Components Database Administration Oracle SAPDBA Database Recovery Basis Courses Database Administration ORACLE (BC505) Reference Implementation Restore/Recovery SAPDBA Database Recovery

9418

1996 SAP Technology, Inc.

Vous aimerez peut-être aussi