db2 - restoring the database of the sap system

3

Click here to load reader

Upload: wei-yang

Post on 21-Apr-2015

35 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DB2 - Restoring the Database of the SAP System

DB2: Restoring the Database of the SAP System

Use

This section describes how to restore the SAP database if containers or tablespaces have becomeunusable.

Procedure

Copy log files.1.

The restore database procedure deletes all log files with an active or online retained status. Thisis why you should copy these log files to another hard disk directory before you start the restoreprocedure.

Start the Windows NT command prompt by choosing Start ® Programs ® CommandPrompt.

a.

Change to the following directory: F:\db2\<sid>\log_dirb.Enter the following command: copy *.* c:\temp\*.*c.

Restore database.2.

Open the Control Center by choosing Start ® Programs ® DB2 for Windows NT ®Administration Tools ® Control Center.

a.

Select the system (<SID>SAP), instance (DB2<SID>) and the database of the SAPSystem (<SID>). Click the right mouse button.

b.

Choose Restore ® Database.c.Choose the option Select an entry from the list. Then choose the most recent backupfrom the list by clicking it.

d.

Start the database restore procedure by clicking OK.e.

The system displays a message informing you that a restore job has been created. ClickOK.

The system also informs you that the restore procedure is active. When the procedure iscomplete, you should update the database to the latest version by restoring the log files.

Restore the log files.3.

When the database has been restored, you must restore the saved log files.

Start the Windows NT command prompt by choosing Start ® Programs ® CommandPrompt.

a.

Change to the following directory: c:\tempb.Enter the following command: copy *.log F:\db2\<sid>\log_dir\*.*c.

Roll-forward database recovery:4.

Open the Control Center by choosing Start ® Programs ® DB2 for Windows NT ®Administration Tools ® Control Center.

a.

Select the system (<SID>SAP), instance (DB2<SID>) and the database of the SAPSystem (<SID>). Click the right mouse button.

b.

DB2: Restoring the Database of the SAP System (SAP Library - DB2 ... http://help.sap.com/saphelp_wp/helpdata/en/b5/2502a7aba011d283e6...

1 of 3 2/27/2012 9:47 PM

Page 2: DB2 - Restoring the Database of the SAP System

Choose Roll-forward. On the next menu, select:c.

Roll-forward (reapply the logs)Roll-forward to the end of the logs

Start the database restore procedure by clicking OK.d.

The system informs you that a job (job number) has been created. When this job iscomplete, the system displays a job log from which you can see if the job was successful.

If you have already deleted the log files which are required for restore, however, thesystem displays an error message.

The error message contains the name of a missing log file. Make a note of this log file (forexample, S0000855.LOG).

You now have to restore (from tape) all saved log files, starting with the file contained in theerror message.

Restore log files.5.

If you have not yet deleted any log files since the previous database backup, you may skipthe next step.

Open the Control Center by choosing Start ® Programs ® DB2 for Windows NT ®Administration Tools ® Control Center.

a.

Select the system (<SID>SAP), instance (DB2<SID>) and the database of the SAPSystem (<SID>). Click the right mouse button.

b.

If you are not logged on as user db2<sid> a dialog box appears. Enter the password foruser db2<sid>.

Choose Logfile Management ® Restore. Then choose the Restore tab. You can nowchoose the log files you need to restore the database.

c.

As the First logfile choose the log file contained in the error message of step 4 (above).As the Last logfile choose the last file in the list. The Storage locations field displays thetape on which the log files are stored.

d.

Insert that tape into the tape drive for the log files. When the tape drive is ready, clickRestore.

e.

Check if the log files were successfully restored. To do this, click the Journal tab. In themenu that appears, choose Restore.

f.

If the log files were successfully restored, repeat step 4.g.

See also:

For more information, see DB2: Restoring the Admin Database.

DB2: Restoring the Database of the SAP System (SAP Library - DB2 ... http://help.sap.com/saphelp_wp/helpdata/en/b5/2502a7aba011d283e6...

2 of 3 2/27/2012 9:47 PM

Page 3: DB2 - Restoring the Database of the SAP System

DB2: Restoring the Database of the SAP System (SAP Library - DB2 ... http://help.sap.com/saphelp_wp/helpdata/en/b5/2502a7aba011d283e6...

3 of 3 2/27/2012 9:47 PM