MaxDB Database Backup and Recovery White Paper

10
VERITAS Software Page 1 of 44 MaxDB Database Backup and Recovery White Paper Creating Backup Environment Variable and Configuration Files ..................................... 2 Environment Variable ................................................................................................................. 2 Backint Configuration File ......................................................................................................... 4 Backint Parameter File................................................................................................................ 5 NetBackup MaxDB Configuration File ...................................................................................... 6 Defining Backup Medium in MaxDB ................................................................................ 6 Creating Medium from the Command Line................................................................................ 6 Creating Medium from the MaxDB GUI.................................................................................... 7 Creating a MaxDB Backup Policy ................................................................................. 12 Performing a Backup of a MaxDB Database ................................................................. 12 Running Backups from the Command Prompt ......................................................................... 12 Running Backups from the NetBackup Administrative Console ............................................. 12 Script information ................................................................................................................. 12 Automating Backups via NetBackup Scheduling ................................................................. 13 Manually Initiating Backups from the NetBackup Administrative Console ........................ 14 Performing a Restore of a MaxDB Database ................................................................ 14 Restoring a database from the command prompt ..................................................................... 15 Collecting Media IDs ............................................................................................................ 15 Executing Database Restore ................................................................................................. 15 Restoring a Database From the MaxDB GUI ........................................................................... 17 Restoring Databases to a New Database Name and/or Database Server .................... 17 Configure NetBackup Security for Alternate Client Restores .................................................. 17 No.Restrictions...................................................................................................................... 17 Peername ............................................................................................................................... 18 Create MaxDB database for recovery ....................................................................................... 18 Move MaxDB Backup History Files to New Database Directory............................................ 28 Execute Restore ........................................................................................................................ 28 Troubleshooting ............................................................................................................ 34 Error if BSI_ENV does not point to the right file or file is missing ......................................... 34 Error if Backint config file does not point to the right parameter file ...................................... 34 Error if Backint config file points to wrong backint.exe (the NBU backint) ........................... 35 Error if backint parameter file points to the wrong NetBackup configuration file................... 37 Error if the backint parameter file points to the wrong backint.exe file ................................... 37 Error if wrong backup medium name is used. .......................................................................... 38 Error if staging area is omitted from parameter file ................................................................. 38 Errors if restore is attempted with an expired NetBackup image ............................................. 39 Script errors............................................................................................................................... 40 Synchronizing Expired NetBackup Images with the MaxDB Backup History ........................ 40 Switching the Operating System ................................................................................... 43 Web Database Interface................................................................................................ 43

Transcript of MaxDB Database Backup and Recovery White Paper

VERITAS Software Page 1 of 44

MaxDB Database Backup and Recovery White Paper

Creating Backup Environment Variable and Configuration Files..................................... 2

Environment Variable................................................................................................................. 2

Backint Configuration File ......................................................................................................... 4

Backint Parameter File................................................................................................................ 5

NetBackup MaxDB Configuration File ...................................................................................... 6

Defining Backup Medium in MaxDB................................................................................ 6

Creating Medium from the Command Line................................................................................ 6

Creating Medium from the MaxDB GUI.................................................................................... 7

Creating a MaxDB Backup Policy ................................................................................. 12

Performing a Backup of a MaxDB Database................................................................. 12

Running Backups from the Command Prompt......................................................................... 12

Running Backups from the NetBackup Administrative Console ............................................. 12

Script information ................................................................................................................. 12

Automating Backups via NetBackup Scheduling................................................................. 13

Manually Initiating Backups from the NetBackup Administrative Console ........................ 14

Performing a Restore of a MaxDB Database ................................................................ 14

Restoring a database from the command prompt ..................................................................... 15

Collecting Media IDs............................................................................................................ 15

Executing Database Restore ................................................................................................. 15

Restoring a Database From the MaxDB GUI ........................................................................... 17

Restoring Databases to a New Database Name and/or Database Server .................... 17

Configure NetBackup Security for Alternate Client Restores.................................................. 17

No.Restrictions...................................................................................................................... 17

Peername............................................................................................................................... 18

Create MaxDB database for recovery....................................................................................... 18

Move MaxDB Backup History Files to New Database Directory............................................ 28

Execute Restore ........................................................................................................................ 28

Troubleshooting ............................................................................................................ 34

Error if BSI_ENV does not point to the right file or file is missing......................................... 34

Error if Backint config file does not point to the right parameter file ...................................... 34

Error if Backint config file points to wrong backint.exe (the NBU backint) ........................... 35

Error if backint parameter file points to the wrong NetBackup configuration file................... 37

Error if the backint parameter file points to the wrong backint.exe file ................................... 37

Error if wrong backup medium name is used. .......................................................................... 38

Error if staging area is omitted from parameter file ................................................................. 38

Errors if restore is attempted with an expired NetBackup image ............................................. 39

Script errors............................................................................................................................... 40

Synchronizing Expired NetBackup Images with the MaxDB Backup History........................ 40

Switching the Operating System ................................................................................... 43

Web Database Interface................................................................................................ 43

VERITAS Software Page 2 of 44

Creating Backup Environment Variable and Configuration Files After installing MaxDB (originally SAPDB) and the NetBackup for MaxDB Database

Extension, there are three files to create, and an environment variable to set.

Environment Variable

Create the environment variable in Windows by right-clicking on My Computer and selecting

Properties.

From the Advanced tab, click on the Environment Variables button.

VERITAS Software Page 3 of 44

Create a new System variable called “BSI_ENV”. The value of this variable is the location and

name of the Backint configuration file.

VERITAS Software Page 4 of 44

Backint Configuration File

The backint configuration file may have any name, and may be placed in any directory. Its name

and location, however, must be exactly as specified in the BSI_ENV variable. The file is

composedof a combination of variables and their associated values, separated by a space.

Possible variables in the backint configuration file are:

Parameter Description BACKINT <absolute_path>\<file_name> Absolute path and name of the backint

program that is installed with MaxDB

INPUT <absolute_path>\<file_name> Absolute path and name of the standard input

file

OUTPUT <absolute_path>\<file_name> Absolute path and name of the standard output

file

ERROROUTPUT

<absolute_path>\<file_name>

Absolute path and name of the standard error

output file

PARAMETERFILE

<absolute_path>\<file_name>

Absolute path and name of the configuration

file of the backint for MaxDB program

TIMEOUT_SUCCESS <number> Time in seconds that the Database Manager

waits for the end of the started Backint for

MaxDB if action is successful

TIMEOUT_FAILURE <number> Time in seconds that the Database Manager

waits for the end of the started backint for

MaxDB if errors occur

ORIGINAL_RUNDIRECTORY

<absolute_path>

Absolute path of the run directory of the source

database

For a detailed description of these parameters, see the MaxDB documentation, available at

http://www.mysql.com/products/maxdb/.

The backint configuration file must contain the variables BACKINT, INPUT, OUTPUT,

ERROROUTPUT, and PARAMETERFILE.

The following is an example of a file with the minimum configuration specified:

BACKINT c:\sdb\7500\bin\backint.exe INPUT c:\veritas\netbackup\dbext\sap\backint.input OUTPUT c:\veritas\netbackup\dbext\sap\backint.output ERROROUTPUT c:\veritas\netbackup\dbext\sap\backint.error PARAMETERFILE c:\veritas\netbackup\dbext\sap\backint_parameter.txt

Please be aware, the backint information is the absolute path and name of the backint executable

which is installed by MaxDB, NOT the one installed by Veritas.

VERITAS Software Page 5 of 44

Backint Parameter File

Like the backint configuration file, the backint parameter file may have any name, and may be

placed in any directory. Its name and location is defined in the backint configuration file with

the PARAMETERFILE variable. Using the above example of a backint configuration file, the

backint parameter file is called “backint_parameter.txt” and is located in the c:\

veritas\netbackup\dbext\sap directory.

Similar to the backint configuration file, the backint parameter file consists of a series of

variables and their values. The difference is these variables are separated from their values with

a colon. The possible variables for the backint parameter file are as follows:

Parameter Description STAGING AREA:

<absolute_path>\<file_name>

<size>[KB|MB|GB]

Absolute path and size of a temporary file

FILES PER BACKINT CALL: <number> Maximum number of temporary files that are

to be processed by backint

BACKINT: <absolute_path>\<file_name> Absolute path and name of the backint

executable installed by NetBackup

PARAMETERFILE OF

BACKINT:<absolute_path>\<file_name>

Absolute path and name of the configuration

file for the backint

HISTORY FILE:

<absolute_path>\<file_name>

Absolute path and name of the backup history

INPUTFILE FOR BACKINT:

<absolute_path>\<file_name>

Absolute path and name of the standard input

file

OUTPUT FILE FOR

BACKINT:<absolute_path>\<file_name>

Absolute path and name of the standard output

file

ERRORFILE FOR BACKINT:

<absolute_path>\<file_name>

Absolute path and name of the standard error

output file

MAXIMAL DELAY OF BACKINT CALL:

<number>

Maximum waiting time in seconds between

creating a temporary file and starting to save it

by using backint

OMIT LAST DIRECTORY DELIMITER ON

RESTORE: <YES | NO>

Specifies whether the SAPDB adapter program

ignores the closing slash (\) of an absolute

directory name for backint.

BI_CALLER_VALUE: <value> Value of the environment variable

BI_CALLER

For a detailed description of these parameters, see the MaxDB documentation, available at

http://www.mysql.com/products/maxdb/.

The backint parameter file must contain the variables BACKINT, PARAMETERFILE OF

BACKINT, HISTORY FILE, INPUTFILE FOR BACKINT, OUTPUTFILE FOR BACKINT,

ERRORFILE FOR BACKINT.

VERITAS Software Page 6 of 44

The following is an example of a file with the minimum configuration specified:

BACKINT: c:\veritas\netbackup\bin\backint.exe PARAMETERFILE OF BACKINT: C:\VERITAS\NetBackup\DbExt\SAP\initDEMO.utl HISTORY FILE: c:\veritas\netbackup\dbext\sap\backinthistory.log INPUTFILE FOR BACKINT: c:\veritas\netbackup\dbext\sap\backintoracle.in OUTPUTFILE FOR BACKINT: c:\veritas\netbackup\dbext\sap\backintoracle.out ERRORFILE FOR BACKINT: c:\veritas\netbackup\dbext\sap\backintoracle.err STAGING AREA: C:\VERITAS\NetBackup\DbExt\SAP\stage1 100 MB

REMEMBER – The variables and their values must be separated with a colon (:).

NetBackup MaxDB Configuration File

Like the previous files, the NetBackup configuration file may have any name, and may be placed

in any directory. Its name and location is defined with the PARAMETERFILE OF BACKINT

variable in the Backint parameter file. Following the above sample file as an example, the file in

this case is called “initDEMO.utl”, and is located in the C:\VERITAS\NetBackup\DbExt\SAP\

directory.

It must contain the variables “switch_list”, “switch_sem”, “switch_log”, and may require

“policy”.

A sample configuration file is included with NetBackup, and is found in the

<install_path>\VERITAS\NetBackup\DbExt\SAP\samples directory, and is named

“initSAP.utl”.

The following is an example of a file with the minimum configuration specified:

switch_list C:\sdb\data\wrk\DEMO\switch.list switch_sem C:\sdb\data\wrk\DEMO\switch.sem switch_log C:\sdb\data\wrk\DEMO\switch.log policy maxdb_hot_backup

Defining Backup Medium in MaxDB In order to run backups, at least one backup medium per backup type (complete, incremental)

must be created. The backup medium type must be “PIPE” and the backup medium name must

begin with the word “BACK”. Backup medium can be created either from the command line or

from within the MaxDB Database Manager GUI.

Creating Medium from the Command Line

From a command prompt, change to the directory containing the dbmcli.exe binary, and execute

the following command to connect to the database:

dbmcli -d <database> -u <user_id>,<password>

By default, the user ID and password are set to “dbm”. So for a database called “DEMO”, the

command is:

dbmcli -d DEMO -u dbm,dbm

VERITAS Software Page 7 of 44

This establishes a connection to the database, and opens the “dbmcli on <database>“ command

prompt. From this prompt, run the command:

medium_put <medium_name> \\.\pipe\<database> PIPE <backup_type> <size> <block_size>

For example, to create a medium called BACKDEMO for full backups in a database called

DEMO, the command is:

medium_put BACKDEMO \\.\pipe\DEMO PIPE DATA 0 8

To create a medium called BACKDEMOINCR for incremental backups in a database called

DEMO, the command is:

medium_put BACKDEMOINCR \\.\pipe\DEMO PIPE PAGES 0 8

For more information on the medium_put command and creating backup medium, see the

MaxDB documentation, available at http://www.mysql.com/products/maxdb/

Creating Medium from the MaxDB GUI

To create medium for NetBackup using the MaxDB GUI, start by opening the interface, and

selecting Backup under database options, and then Backup Medium.

VERITAS Software Page 8 of 44

In the Backup Medium window, right click on an empty part of the window, and select “New

Medium”.

VERITAS Software Page 9 of 44

In the resulting dialog box, specify a backup type of “Complete” for full backups, or

“Incremental” for incremental backups.

Please note the only valid media type for log backups are files, and as such, cannot be performed

with NetBackup.

Under “Device Type”, be sure to select “Pipe”, or the backup medium cannot be used by

NetBackup.

VERITAS Software Page 10 of 44

Finally, the name must begin with the word “BACK”

On the Extended tab, you can specify

• Size: Specify the size of the backup medium (It is unknown if this applies to a device

type of PIPE.)

• Overwrite: Allows the backup to overwrite the medium. (It is unknown if this applies to a

device type of PIPE.)

• Blocksize: Select the “Blocksize” option to allow the backup to write in blocks of up to

eight pages. (This may allow for performance enhancement.)

• Autoloader: Specify this option to use a tape device with an autoloader feature. (This

does not appear to be relevant to NetBackup.)

• OS Command: Allows operating system commands to be run when running backups to

tape. (This does not appear to be relevant to NetBackup.)

For detailed information on these options, contact MaxDB support or review the MaxDB web

page at http://www.mysql.com/products/maxdb/