2017-02-19

Dump devices

To create the backup you work with a dump database command. When such a command is executed manually by administrator it is quite common just to use int the backup command just a file, where the backup should be stored:

DUMP DATABASE master TO '/home/dumps/master_2017_02_19.dmp'

However, when the backups should be created always in the same location, always with the same script and metodology, than it is quite convenient to use backup devices. Backup device is a definition that points to some location on the system. This can be a file but this can also be a tape device. The easiest way to create a device is using following sp_addumpdevice command:

EXECUTE  sp_addumpdevice 'disk', 'dumpsdev','/home/dumps/sap01.dmp'

The first parameter designates the device as a file on disk or a tape device. The second parameter is  called a logical name, and it will be used in commands performing the dump. The last one is the physical name of a device, in case of file this is just the name of a file.

Having such a device following command can be executed:

DUMP DATABASE master TO dumpsdev

This dump of master database will be saved in the dumpsdev this is in the file /home/dumps/sap01.dmp. Should you forget the connections between logical names and physical names, always a procedure sp_helpdevice can be used to display, how the device has been defined:

sp_helpdevice dumpsdev


The location of the dump file can be generally any file on filesystem. There are some conditions that need to be met for this. One of them is, that the backup server needs to have access to the file. If such an access is not granted than following error can be recorded:

WARNING: In order to LOAD the master database, the ASE must run in single-user mode. If the master database dump uses multiple volumes, you must execute sp_volchanged on another ASE at LOAD time in order to signal volume changes.
Backup Server: 4.172.1.4: The value of 'allocated pages threshold' has been set to 40%.
Backup Server session id is: 24. Use this value when executing the 'sp_volchanged' system stored procedure after fulfilling any volume change request from the Backup Server.
Backup Server: 4.41.1.1: Creating new disk file /home/dumps/sap01.dmp.
Backup Server: 4.141.2.40: [11] The 'open' call failed for database/archive device while working on stripe device '/home/dumps/sap01.dmp' with error number 13 (Permission denied). Refer to your operating system documentation for further details.

Indeed. When the backup device is created, permissions are not verified. First, when performing the backups, the operation can fail due to insufficient permissions. This is easy to repair! First check which account is used by SAP Sybase. Such information is displayed by showserver command. Next change permissions. Here for example we are changing ownership of the catalog:

chown sap /home/dumps/

After that the backup command should succeed. If some problems should still be present, it is always a good idea to look into the backup server error log. You can use tail -f command for this. Tail displays a couple of last lines from the log, and -f causes the command to wait for next error or information messages to be sent to the file:

 tail -f /opt/sap/ASE-16_0/install/SAP01_BS.log

This command can be started in separate window and all the messages will be displayed in real time as they are sent to the log.

1 comment:

SAP Adaprive Server Enterprise

SAP Adaprive Server Enterprise
SAP Adaprive Server Enterprise