Maxdb Database Backup and Recovery White Paper
Maxdb Database Backup and Recovery White Paper
Environment Variable
Create the environment variable in Windows by right-clicking on My Computer and selecting
Properties.
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 and name of the standard error
<absolute_path>\<file_name> output file
PARAMETERFILE Absolute path and name of the configuration
<absolute_path>\<file_name> 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 of the run directory of the source
<absolute_path> 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.
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.
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 and size of a temporary file
<absolute_path>\<file_name>
<size>[KB|MB|GB]
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 Absolute path and name of the configuration
BACKINT:<absolute_path>\<file_name> file for the backint
HISTORY FILE: Absolute path and name of the backup history
<absolute_path>\<file_name>
INPUTFILE FOR BACKINT: Absolute path and name of the standard input
<absolute_path>\<file_name> file
OUTPUT FILE FOR Absolute path and name of the standard output
BACKINT:<absolute_path>\<file_name> file
ERRORFILE FOR BACKINT: Absolute path and name of the standard error
<absolute_path>\<file_name> output file
MAXIMAL DELAY OF BACKINT CALL: Maximum waiting time in seconds between
<number> creating a temporary file and starting to save it
by using backint
OMIT LAST DIRECTORY DELIMITER ON Specifies whether the SAPDB adapter program
RESTORE: <YES | NO> 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.
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 (:).
It must contain the variables “switch_list”, “switch_sem”, “switch_log”, and may require
“policy”.
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
By default, the user ID and password are set to “dbm”. So for a database called “DEMO”, the
command is:
For example, to create a medium called BACKDEMO for full backups in a database called
DEMO, the command is:
For more information on the medium_put command and creating backup medium, see the
MaxDB documentation, available at http://www.mysql.com/products/maxdb/
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.
After creating the backup medium, the window looks like the following:
Please refer to this guide for the setup of the MaxDB policy. Please note the script information
is different, and is outlined later in this guide.
This is the only line required in the backup script. By entering this information into a file with a
.cmd extension, the file may be used in a NetBackup policy.
For more information on MaxDB scripting options, contact MaxDB support or review the
MaxDB web page at http://www.mysql.com/products/maxdb/
The Application Backup schedule is created by default when a MaxDB policy is created, and is
open 24 hours a day, seven days a week. This schedule creates a window in which backups can
run, not when the backup will actually run. Veritas support recommends leaving this schedule
alone, and not modifying it. Changes to this schedule can cause the backups to fail with a status
199, Operation not allowed during this time period.
The other type of backup schedule is the Automatic Backup schedule, which is the schedule
which actually initiates the automatic backup. So, for example, to have the backup run once a
week on Monday nights between 6 and 8 PM, the Automatic Backup schedule should be open
from 6 to 8 PM on Monday.
NOTE: To change the retention level of the MaxDB backup, change the retention of the
Application Backup schedule.
NOTE: Per the MaxDB documentation, when recovering a database, it must be in the operational
state ADMIN.
The restore command is “recover_start”, and requires the backup medium name, the type of
backup which was performed, and the backup media ID. The sequence is as follows:
Using the above listing, and the backup medium name “BACKDEMO”, the command issued is:
NOTE: Since the media ID name contains a space, the ID string needs to be enclosed in quotation
marks.
Overview:
Configure NetBackup security for alternate client restores. (No.Restrictions or peername)
Create instance for recovery
Create backup medium that matches original backup medium
Start instance in ADMIN state
Copy over dbm.ebf, dbm.knl, dbm.mdf files from source db to new instance
Start recovery wizard
Select initialize instance
Select backup set to restore
Start restore
When successful, start instance
Recovery successful.
No.Restrictions
Use of the No.Restrictions file allows any client to perform an alternate client restore of any
clients’ data. To allow this, create an empty file called “No.Restrictions” in the directory path
<install_path>\NetBackup\db\altnames\ on the master server (in the
/usr/openv/netbackup/db/altnames directory on a Unix master server).
NOTE: Do not add a suffix to the files created in the altnames directory.
For example, if the administrator wanted the client Freddie to restore files which were backed up
by another client Oscar, then it would be necessary to create the following file on the master
server: <install_path>\NetBackup\db\altnames\freddie
Additionally, in the recovery database, a backup medium must be created which has the same
name as the source database. If the backup medium for the original database was BACKDEMO,
be sure to create a backup medium, of a type PIPE called BACKDEMO in the new database.
The following series of screen captures shows the step-by-step procedure to create a database for
recovery, using the wizard in the MaxDB GUI. By default, this procedure places the database
into an ADMIN state, ready for recovery.
3. Select the template desired for creation of the database. This example uses the “Blank”
template. Click “Next” to continue.
5. If there is more than one version of MaxDB installed, select the version to use, and click
on “Next”.
7. Create the database manager user name and password. The default is dbm, dbm,
however, on this screen, it is possible to change that option. In this example, the default
was accepted. Click “Next” to continue.
9. This screen allows the user to specify the instance type. The default is OLTP. Click
“Next” to continue.
Execute Restore
Once the database instance is created for recovery and in an ADMIN status, and the backup
history files are moved to the appropriate directory, the database is ready for restore and
recovery. The following screen captures show the step-by-step procedure to restore and recover
the database using the MaxDB GUI.
4. Select the option to restore a specified backup from history. Click on “Next” to continue.
6. MaxDB requests confirmation the correct medium was selected. Confirm this is correct,
and click on “Start” to begin the restore.
10. MaxDB confirms the database was successfully restarted. Click “Close” to finish the
recovery.
Additionally, it should be observed nearly all MaxDB database backups fail with a Status 29. As
such, it is generally necessary to collect log files in order to properly assess the problem and
recommend an appropriate solution.
Error if BSI_ENV does not point to the right file or file is missing
NetBackup Error: Status 29 - failed trying to exec a command. A command could not be
executed. This can occur because the permissions of the command do not allow it to be executed,
or there is lack of system resources such as memory and swap space.
If the BSI_ENV environment variable is not pointing to the correct file, there is no Veritas
backint log directory, and the dbm.ebp log file shows the following:
2004-07-07 09:40:06
Using environment variable 'TEMP' with value 'C:\DOCUME~1\user\LOCALS~1\Temp'
as directory for temporary files and pipes.
Using connection to Backint for MaxDB Interface.
2004-07-07 09:40:06
Checking existence and configuration of Backint for MaxDB.
Using environment variable 'BSI_ENV' with value
'C:\VERITAS\NetBackup\DbExt\SAP\backint_config.txt' as path of the
configuration file of Backint for MaxDB.
Have encountered error -24927:
The file C:\VERITAS\NetBackup\DbExt\SAP\backint_config.txt is missing
or unreadable.
Constructed the following reply:
ERR
-24927,ERR_TOOLCHK: external backup tool not found
The file C:\VERITAS\NetBackup\DbExt\SAP\backint_config.txt is missing
or unreadable.
Can not read the Backint for MaxDB configuration file.
Check failed.
Error if Backint config file does not point to the right parameter file
NetBackup Error: Status 29 - failed trying to exec a command. A command could not be
executed. This can occur because the permissions of the command do not allow it to be executed,
or there is lack of system resources such as memory and swap space.
If the backint configuration file points to the incorrect backint.exe file (the NetBackup backint
versus the MaxDB backint), there is both a backint log (for Veritas), and a dbm.ebp log file. In
the Veritas backint log file, the following lines appear:
2004-07-07 09:53:48
2004-07-07 09:53:48 Cleaning up.
2004-07-07 09:53:48 Copying output of Backint for MaxDB to this file.
2004-07-07 09:53:48 ---------- Begin of output of Backint for MaxDB
(c:\veritas\netbackup\dbext\sap\backint.output)----------
2004-07-07 09:53:48 WARNING: unknown parameter: BACKINT:
c:\veritas\netbackup\bin\backint.exe
2004-07-07 09:53:48
2004-07-07 09:53:48 WARNING: unknown parameter: PARAMETERFILE OF
BACKINT: C:\VERITAS\NetBackup\DbExt\SAP\initDEMO.utl
2004-07-07 09:53:48
2004-07-07 09:53:48 WARNING: unknown parameter: HISTORY FILE:
c:\veritas\netbackup\dbext\sap\backinthistory.log
2004-07-07 09:53:48
2004-07-07 09:53:48 WARNING: unknown parameter: INPUTFILE FOR BACKINT:
c:\veritas\netbackup\dbext\sap\backintoracle.in
2004-07-07 09:53:48
2004-07-07 09:53:48 WARNING: unknown parameter: OUTPUTFILE FOR
BACKINT: c:\veritas\netbackup\dbext\sap\backintoracle.out
2004-07-07 09:53:48
2004-07-07 09:53:48 WARNING: unknown parameter: ERRORFILE FOR BACKINT:
c:\veritas\netbackup\dbext\sap\backintoracle.err
2004-07-07 09:53:48
2004-07-07 09:53:49 WARNING: unknown parameter: STAGING AREA:
C:\VERITAS\NetBackup\DbExt\SAP\stage1 100 MB
2004-07-07 09:53:49
2004-07-07 09:53:49 WARNING: unknown parameter: STAGING AREA:
C:\VERITAS\NetBackup\DbExt\SAP\stage2 100 MB
2004-07-07 09:53:49 WARNING: drives value missing from parameter file
c:\veritas\netbackup\dbext\sap\backint_parameter.txt
2004-07-07 09:53:49 default drives value = 1
The key to this series of error messages is the “Unknown parameter” error messages. This
indicates the wrong backint is in use, as the NetBackup backint file does not recognize these
parameters.
There is both a backint log (for Veritas), and a dbm.ebp log file. In the Veritas backint log file,
the following lines appear:
The key to this error message is the inability of the backint process to open the parameter file
(ERROR: couldn't open param_file). This indicates the parameter file is specified
incorrectly.
Error if the backint parameter file points to the wrong backint.exe file
NetBackup Error: Status 29 - failed trying to exec a command. A command could not be
executed. This can occur because the permissions of the command do not allow it to be executed,
or there is lack of system resources such as memory and swap space.
This indicates either the path for the Veritas backint is not defined, or defined incorrectly.
In this case, neither the Veritas backint nor the dbm.ebp log files are generated. In the dbm.prt
file, however, (found in same location as the dbm.ebp file), there is the following message:
In this case, there is no Veritas backint log file generated. In the dbm.ebp log file, the following
error is observed:
A review of the MaxDB website indicates this error message occurs when the backup failed due
to a problem with the database or the backup tool. While this error message appears to be
somewhat generic, checking the staging area is a good first step in the troubleshooting process,
as that eliminates one known cause of the error message.
The job does not display in the NetBackup Administration Console in the Activity Monitor
The job shows the following error in the MaxDB Database Manager GUI:
2004-08-23 09:32:54
2004-08-23 09:32:54 Filling reply buffer.
2004-08-23 09:32:54 Have encountered error -24920:
2004-08-23 09:32:54 The backup tool failed with 2 as sum of exit
codes. The database request
was canceled and ended with error -903.2004-08-23 09:32:54
2004-08-23 09:32:54 Constructed the following reply:
2004-08-23 09:32:54 ERR
2004-08-23 09:32:54 -24920,ERR_BACKUPOP: backup operation was
unsuccessful
2004-08-23 09:32:54 The backup tool failed with 2 as sum of exit
codes. The database request
was canceled and ended with error -903.
In the Veritas backint log file, a series of message similar to the following appear:
To correct this, use the NetBackup Backup, Archive, and Restore GUI to determine what backup
sets are available, and rerun the restore. Then see the “Synchronizing Expired NetBackup
Images with the MaxDB Backup History “section of this documentation for assistance in
correcting the mismatched information.
In general, support recommends breaking down the script, and confirming each section of the
script can be executed successfully from the command line.
The only backup set NetBackup has in its catalog is a backup from 17 August 2004.
In this example, six backup jobs show as available for restore, while the NetBackup GUI shows
only one. To correct this, the dbm.knl file must be manually edited.
Note in the fourth section, the date and time of the backup are clearly indicated. Compare the
information in the NetBackup GUI to the information in the file, and remove any lines from the
dbm.knl file which do not have a corresponding backup set in the NetBackup GUI. In the above
examples, lines in the dbm.knl file above would need to be removed EXCEPT the last line,
which contains the backup information from the 17 August 2004 backup.
After downloading and installing WebDBM software on MaxDB server, start the web server
service (SAP DB WWW)
• To start the Web Server at the command prompt, enter the following command: net
start sapdbwww
• To stop the Web Server at the command prompt, enter the following command: net
stop sapdbwww
Information about the configuration of the web server portion of MaxDB is found in the registry
path HKEY_LOCAL_MACHINE\ SOFTWARE\SAP\SAP DBTech\WebAgent75\HTTP, and contains the
following entries:
Browsable=0
DefaultDocument=index.html
DocumentRoot=<independent_program_path>\web\Documents
LogDirectory=<independent_program_path>\web\Log
LogRequests=1
MaxThreads=10
MimeTypeFile=<independent_program_path>\web\config\mime.types
Port=9999
Browsable: Determines if the contents of the directories under DocumentRoot are visible using
a browser.
0: The contents are not visible
1: The contents are visible
DefaultDocument: Used to change the start page of the web server, if desired.
LogDirectory: If LogRequest is set so that HTTP accesses are logged, accesses to the MaxDB
Web Server are logged in the files httperr.log and httpreq.log. These log files are written in the
directory specified in LogDirectory.
MaxThreads: Determines the maximum number of threads which can be used to process access
to the Web Server. When the Web Server is started, the threads are also started as a thread pool.
Port: Allows the administrator to change the port address for the Web Server, if desired.