• No results found

Restoring using SAP MaxDB utilities

Using this integration, it is also possible to run an integrated Data Protector restore of an SAP MaxDB Server from SAP MaxDB utilities.

To perform a restore to an existing SAP MaxDB Server instance, see“SAP MaxDB restore and recovery” (page 163).

To migrate an SAP MaxDB instance, see“SAP MaxDB migration” (page 166).

On how to find information about backup objects to restore from, see“Finding information for restore” (page 166).

SAP MaxDB restore and recovery

Follow the procedure on the next few pages to restore and recover a database using SAP MaxDB utilities from existing Data Protector SAP MaxDB backup session(s). In the procedure, the following conventions are used:

inst_nameis the name of the instance to be restored

name_of_backup_specis the name of the Data Protector backup specification used at backup.

username,passwordis the connection string for the SAP MaxDB database user created or identified as described in“Configuring SAP MaxDB users” (page 147).

locationis the location of the bsi_env file

media_group_nameis the name of the SAP MaxDB media group medium_nameis the name of the SAP MaxDB medium

pipe_nameis the name of the SAP MaxDB pipe medium_typeis the type of the SAP MaxDB medium

SessionIDis the Data Protector session ID of the session to be restored

Restore

1. Skip this step if the bsi_env file is already present and configured on the SAP MaxDB Server.

On the SAP MaxDB Server create the bsi_env file in a directory of your choice. It must contain the following lines:

Windows systems:

BACKINT Data_Protector_home\bin\sapdb_backint INPUT Data_Protector_home\tmp\inst_name.bsi_in OUTPUT Data_Protector_home\tmp\inst_name.bsi_out ERROROUTPUT Data_Protector_home\tmp\inst_name.bsi_err PARAMETERFILE name_of_backup_spec

TIMEOUT_SUCCESS 60 TIMEOUT_FAILURE 30 UNIX systems:

BACKINT /opt/omni/bin/sapdb_backint INPUT /var/opt/omni/tmp/inst_name.bsi_in OUTPUT /var/opt/omni/tmp/inst_name.bsi_out ERROROUTPUT /var/opt/omni/tmp/inst_name.bsi_err PARAMETERFILE name_of_backup_spec

TIMEOUT_SUCCESS 60 TIMEOUT_FAILURE 30

2. Login to the SAP MaxDB database manager as the SAP MaxDB database user created or identified as described in“Configuring SAP MaxDB users” (page 147). On the SAP MaxDB Server, execute the following command to login:

dbmcli -d inst_name -u username,password

3. In the SAP MaxDB database manager, switch the database to the Admin mode by executing the following command:

db_admin

4. Skip this step if the location of the bsi_env file is already registered on the SAP MaxDB Server.

Register the location of the bsi_env file as follows:

Windows systems:

dbm_configset -raw BSI_ENV location\inst_name.bsi_env UNIX systems:

dbm_configset -raw BSI_ENV location/inst_name.bsi_env

5. Skip this step if the SAP MaxDB media and pipes to be used with Data Protector are already existing on the SAP MaxDB Server.

Note that to restore a Data Protector SAP MaxDB backup session, the number of SAP MaxDB media and pipes required equals the parallelism value used during the backup session.

Create SAP MaxDB media in an SAP MaxDB media group. Execute the following command for every medium to be created, depending on the SAP MaxDB version:

• For SAP MaxDB version 7.6:

medium_put media_group_name/medium_name pipe_name media_type type backup_type [size [block_size [overwrite [autoloader [os_command [tool_type]]]]]]

• For other SAP MaxDB versions:

medium_put media_group_name/medium_name pipe_name media_type backup_type

backup_typecan be one of the following:

• DATAfor full backup

• PAGES for differential (diff) backup

• LOGfor transactional (trans) backup tool_typemust be the following:

• "BACK"for backup with Backint for SAP MaxDB

IMPORTANT: When creating SAP MaxDB media and pipes for the purpose of a Data Protector backup and restore, the media group name must begin with the "BACK" string. The commands below create two media and two pipes (parallelism = 2) in a media group:

Windows systems, SAP MaxDB version 7.6:

medium_put BACKDP-Data[2]/1 \

\\.\Pipe\inst_name.BACKDP_Data[2].1 PIPE DATA 0 8 \ NO NO \"\" "BACK"

medium_put BACKDP-Data[2]/2 \

\\.\Pipe\inst_name.BACKDP_Data[2].2 PIPE DATA 0 8 \ NO NO \"\" "BACK"

UNIX systems, SAP MaxDB version 7.6:

medium_put BACKDP-Data[2]/1 \

/var/opt/omni/tmp/inst_name.BACKDP_Data[2].1 PIPE \ DATA 0 8 NO NO \"\" "BACK"

medium_put BACKDP-Data[2]/2 \

/var/opt/omni/tmp/inst_name.BACKDP_Data[2].2 PIPE \ DATA 0 8 NO NO \"\" "BACK"

Windows systems, other SAP MaxDB versions:

medium_put BACKDP-Data[2]/1 \

\\.\Pipe\inst_name.BACKDP_Data[2].1 PIPE DATA medium_put BACKDP-Data[2]/2 \

\\.\Pipe\inst_name.BACKDP_Data[2].2 PIPE DATA UNIX systems, other SAP MaxDB versions:

medium_put BACKDP-Data[2]/1 \

/var/opt/omni/tmp/inst_name.BACKDP_Data[2].1 PIPE DATA medium_put BACKDP-Data[2]/2 \

/var/opt/omni/tmp/inst_name.BACKDP_Data[2].2 PIPE DATA 6. Start the SAP MaxDB utility session by executing the following command:

util_connect

7. Start the restore from a Data Protector backup session by executing the following command:

recover_start media_group_name backup_type EBID "inst_name SessionID:1 pipe_name1,inst_name SessionID:2 pipe_name2[, ...]"

Windows systems:

recover_start BACKDP-Data[2] DATA EBID "inst_name SessionID:1

\\.\Pipe\inst_name.BACKDP-Data[2].1,TEST SessionID:2

\\.\Pipe\inst_name.BACKDP-Data[2].2"

UNIX systems:

recover_start BACKDP-Data[2] DATA EBID "inst_name SessionID:1 /var/opt/omni/tmp/inst_name.BACKDP-Data[2].1,inst_name SessionID:2 /var/opt/omni/tmp/inst_name.BACKDP-Data[2].2"

Repeat this step for every session in the required chain of backup sessions.

8. Use one of the commands recover_start and recover_replace, based on the exit code from the previous execution of recover_start or recover_replace.

For more information, see the SAP MaxDB documentation.

9. If the command recover_start or recover_replace from the previous step returned an exit code of -8020, and you have already restored all relevant data, execute the following command:

recover_ignore

For more information, see the SAP MaxDB documentation.

10. When the restore has finished, the database can be recovered either until the last redo log or until the specified point in time.

a. To recover the database until the last redo log, execute the following command in the SAP MaxDB database manager:

db_online

b. To recover the database until the specified point in time, execute the following command in the SAP MaxDB database manager:

db_warm -f -u yyyymmdd hhmmss

Where yyyymmdd and hhmmss parameters set the time for the last redo log to be applied.

SAP MaxDB migration

When performing an SAP MaxDB migration, some additional tasks must first be done in order to prepare the SAP MaxDB Server or instance. These tasks are described in“Before you begin” (page 160).

Follow the procedure in the section“SAP MaxDB restore and recovery” (page 163)to migrate the SAP MaxDB database using SAP MaxDB utilities from existing Data Protector SAP MaxDB backup session(s). When following the mentioned procedure, before executing the recover_start command, delete the existing redo logs on the SAP MaxDB Server by executing the following command in the SAP MaxDB database manager:

util_execute clear log