BSI_ENV and server, client, policy, schedule selection with NetBackup for SAP MAXDB?
|Article:TECH185282|||||Created: 2012-03-29|||||Updated: 2012-03-30|||||Article URL http://www.symantec.com/docs/TECH185282|
How to configure a SAP MAXDB backup so that daily and weekly backups use different schedules (and/or policies) and write the backup images to different storage units or media?
Why are the 'server', 'client', 'policy' and 'schedule' keywords in the init<SID>.utl file sometimes ignored?
Why did the policy or schedule used by a backup change after patching SAP MAXDB?
NetBackup 6.x, 7.x
The NetBackup backint program is started by the SAP processes that control the backup, and then determines the policy and schedule from either the environment variables, the keywords in the init<SID>.utl file, or the keywords in the bp.conf file and with that order of precedence.
If the backup script is initiated from the NetBackup master server, then several variables (SAP_SERVER, SAP_CLIENT, and SAP_POLICY) are set into the environment before the SAP dbmcli program is started. If the backup script is initiated from the client host, these variables are not set unless programmed into the backup script.
If the SAP dbmcli process started by the backup script creates child processes to execute backint, then the environment variables will be inherited by the child process and used in preference to the keywords in the init<SID>.utl and bp.conf files.
If the SAP dbmsrv process that starts the NetBackup backint is not a child of the SAP dbmcli process that initiates the backup, and the two SAP processes do not preserve the environment variables, then any variables that are set in the script will not be available to backint and the keywords in the init<SID>.utl or bp.conf files will be used.
In this example, the NetBackup master server started the bphdb process which then ran the backup script which started SAP dbmcli.
root 17963 1 2 15:19:31 ? 0:00 bphdb -sb -rdbms sap ...
root 17964 17963 0 15:19:31 ? 0:00 /bin/sh /maxdb/sap_maxdb_backup ...
sdb 17965 17964 1 15:19:31 ? 0:00 -sh -c SAP_POLICY=myPolicy ; export SAP_POLICY ...
sdb 17971 17965 1 15:19:32 ? 0:00 dbmcli -u dbadmin,maxdb123 -d demodb ...
But the backint process is a child of the SAP dbmsrv process which has daemonized and is not a child of dbmcli.
sdb 17973 1 18 15:19:32 ? 0:05 /opt/sdb/MaxDB/pgm/dbmsrv -sdbstarter ...
sdb 17980 17973 0 15:19:37 ? 0:00 /usr/openv/netbackup/bin/backint -u DEMODB ...
Notice also that SAP_POLICY (and SAP_SCHED and BSI_ENV) were set and exported in the shell that started dbmcli above. But when backint started, only those variables provided by the operating system and SAP were available for use.
Review the configuration and confirm that the following items are correct.
A) Does the backup script explicitly set and export the SAP_SERVER, SAP_CLIENT, SAP_POLICY, and/or SAP_SCHED environment variables with the correct values? Especially if it overrides values provided from the master server.
B) Alternatively, are the server, client, policy, and/or schedule keywords specified correctly in the init<SID>.utl file?
C) Alternatively, are the SERVER, CLIENT_NAME, BPBACKUP_POLICY, and/or BPBACKUP_SCHED keywords specified correctly in the bp.conf file?
D) If the SAP processes are not allowing the environment variables to be inherited by backint, then B and C should suffice unless there is a need to utilize more than one policy or schedule. Then the SAP BSI_ENV setting can be used to switch between two init<SID>.utl files as follows.
Although the SAP documentation refers to BSI_ENV as an environment variable, it cannot be set and utilized like other environment variables. Rather, it is an option on the dbmcli command line which is forwarded to the dbmsrv process.
1) Create two init<SID>.utl files, one for the first backup and one for the second backup. In each, specify the desired keywords for the backup
$ cat initSID-weekly.utl
$ cat initSID-daily.utl
2) Create two bsi.env files that each reference the appropriate init<SID>.utl file. E.g.
$ cat bsi-weekly.env
$ cat bsi-daily.env
3) Before executing the backup, use the dbmcli dbm_configset option to specify the appropriate BSI_ENV pathname. E.g.
$ dbmcli -d demodb -u dbadmin,maxdb123 dbm_configset -raw BSI_ENV /maxdb/wrk/DEMODB/bsi-weekly.env
$ dbmcli -d demodb -u dbadmin,maxdb123 -uUTL -c backup_start Fulldata DATA
$ dbmcli -d demodb -u dbadmin,maxdb123 dbm_configset -raw BSI_ENV /maxdb/wrk/DEMODB/bsi-daily.env
$ dbmcli -d demodb -u dbadmin,maxdb123 -uUTL -c backup_start FullLog LOG
If utilizing the NetBackup sample MAXDB backup script (sap_maxdb_backup), add the dbmcli dbm_configset command to the CMD_LINE variable just before the dbmcli backup_start command. E.g.
CMD_LINE=”$CMD_LINE dbmcli -u dbm,dbm -d SMALL dbm_configset -raw BSI_ENV /maxdb/wrk/DEMODB/bsi-daily.env ; ”
if [ $SAP_FULL -eq 1 ]; then
CMD_LINE="$CMD_LINE dbmcli -u dbm,dbm -d SMALL -uUTL dbm,dbm backup_start BACKData"
elif [ $SAP_CINC -eq 1 ]; then
CMD_LINE="$CMD_LINE dbmcli -u dbm,dbm -d SMALL -uUTL dbm,dbm backup_start BACKPage"
Article URL http://www.symantec.com/docs/TECH185282