Backup and Restore
This guide shows you how to backup and restore SAP ASE databases using Amazon Backint Agent for SAP ASE. You’ll learn how to install and configure the agent, create backups, restore databases, and manage logs.
Topics
Interactive SQL
Interactive SQL (isql) is a command line interactive SQL parser to the SAP ASE server.
Refer to Using interactive isql from the Command Line
Placeholders
The commands in this document use placeholders for illustration. Their values need to be set according to your environment configuration.
| Placeholder | Description | Example Value |
|---|---|---|
|
|
Name of the database |
|
|
|
Custom prefix for backup identification |
|
|
|
Complete S3 path for restore operations |
|
|
|
SAP ASE System ID |
|
|
|
Database instance hostname |
|
|
|
Number of stripes |
|
|
|
UTC timestamp of backup with format |
|
Backup Location
Your backup location depends on:
-
Agent configuration (S3 bucket and folder)
-
SAP ASE System ID (SID)
-
Database instance hostname
-
Your custom prefix
-
Number of stripes
-
UTC timestamp
If you’re performing a backup (load), Backint agent constructs the S3 location automatically. If you’re restoring a particular backup (load) created with Amazon Backint Agent, you need to specify the S3 location manually.
Database backups:
<FOLDER>/<SID>/<HOSTNAME>_<DB_NAME>_COMPLETE_<MY_PREFIX>_<STRIPES>/<TIMESTAMP>/
Transaction log backups:
<FOLDER>/<SID>/<HOSTNAME>_<DB_NAME>_TRANSACTION_<MY_PREFIX>_<STRIPES>/<TIMESTAMP>/
Finding backups via the Amazon CLI
The Amazon CLI command below allows you to list available backups in Amazon S3.
Database backups:
aws s3 ls s3://<BUCKET>/<FOLDER>/<SID>/<HOSTNAME>_<DB_NAME>_COMPLETE_<MY_PREFIX>_<STRIPES>/
Transaction log backups:
aws s3 ls s3://<BUCKET>/<FOLDER>/<SID>/<HOSTNAME>_<DB_NAME>_TRANSACTION_<MY_PREFIX>_<STRIPES>/
Example:
> aws s3 ls s3://my_s3_bucket/my_s3_folder/ABC/myhost_ABC_COMPLETE_my_daily_backup_1/ PRE 07-01-2025_120000/ PRE 07-02-2025_120000/ PRE 07-03-2025_120000/ PRE 07-04-2025_120000/
Backup Striping
Backup Striping allows adjusting the number of simultaneous backup and restore streams to and from Amazon S3. The ideal number of stripes depends mainly on the size of your database. Striping is defined by appending the following statement to your dump or load command. Striping is supported for DUMP and LOAD commands for both, database and transaction log backups.
Add the following statement (n-1) times for n stripes. The number of stripes in a load statement need to match the number of stripes when creating the backup. The maximum number of stripes is 32.
stripe on "awsbackint::<MY_PREFIX/MY_S3_LOCATION>"
Create Backup Configuration
SAP ASE provides several methods to configure backup operations.
The stored procedure sp_config_dump
Note
Using a backup configuration will not allow you to specify a custom prefix.
Instead, SAP ASE will generate a prefix with format <DB_NAME>.DB.YYYYMMDD.hhmmss.<COUNTER>.000 automatically.
Creating a dump configuration is optional and not required in case you prefer using the statements in the following section.
Amazon Backint Agent for SAP ASE supports the following parameters:
| Parameter | Description | Required |
|---|---|---|
|
|
Specifies Amazon Backint Agent as the external API. |
Yes |
|
|
Number of stripe devices used during the dump operation. The default is 1. |
No |
|
|
Block size for the dump device, overriding the default block size for the device. The value must be at least 1 database page, and an exact multiple of the database page size. For optimal performance, specify blocksize as a power of 2 (such as 65,536, 131,072, or 262,144). |
No |
|
|
Compression level for compressed dumps. By default, compression is disabled. |
No |
Example
Create database dump configuration my_custom_config, using the external API for Amazon Backint Agent for SAP ASE, three stripes, a block size of 16,384 bytes, and compression level of 100.
sp_config_dump @config_name='my_custom_config', @ext_api='awsbackint', @num_stripes='3', @blocksize='16384', @compression='100', go
Once you have created a dump configuration, initiate a dump to Amazon S3 with the following statement.
dump database ASE using config='my_custom_config' go
Database Backup
Use the following statement to create a full database dump of your database in Amazon S3.
dump database <DB_NAME> to "awsbackint::<MY_PREFIX>"
Example
Dump database ASE to S3 with prefix my_custom_prefix, using two stripes.
dump database ASE to "awsbackint::my_custom_prefix" stripe on "awsbackint::my_custom_prefix" go
Transaction Log Backup
Use the following statement to create a transaction log dump of your database in Amazon S3.
dump transaction <DB_NAME> to "awsbackint::<MY_PREFIX>"
Example
Dump transaction log of database ASE to S3 with prefix my_custom_prefix, using one stripes.
dump transaction ASE to "awsbackint::my_custom_prefix" go
Database Restore
Use the following statement to restore your database from Amazon S3.
load database <DB_NAME> from "awsbackint::<MY_S3_LOCATION>"
Example
Load database ASE from S3, using two stripes.
load database ASE from "awsbackint::sapaws_ASE_COMPLETE_my_custom_prefix_2/01-06-2025_1159/" stripe on "awsbackint::sapaws_ASE_COMPLETE_my_custom_prefix_2/01-06-2025_1159/" go
Transaction Log Restore
Use the following statement to restore your transaction logs from Amazon S3.
load transaction <DB_NAME> from "awsbackint::<MY_S3_LOCATION>"
Example
Load transaction logs for database ASE from S3, using one stripes.
load database ASE from "awsbackint::sapaws_ASE_COMPLETE_my_custom_prefix_2/01-06-2025_1159/" go
Database Restore to Different Target Database
load database <TARGET_DB_NAME> from "awsbackint::<MY_S3_LOCATION>::<SOURCE_DB_NAME>" stripe on "awsbackint::<MY_S3_LOCATION>::<SOURCE_DB_NAME>"