Skip to content

Instantly share code, notes, and snippets.

@shaheerxt
Created April 6, 2021 19:58
Show Gist options
  • Save shaheerxt/ba39a0a725061f8fe7f6f46eeccfbbbb to your computer and use it in GitHub Desktop.
Save shaheerxt/ba39a0a725061f8fe7f6f46eeccfbbbb to your computer and use it in GitHub Desktop.
HANA backup scheduling via XS job table
-- query using below command
select * from _SYS_XS.JOB_SCHEDULES;
--Generate insert command from Studio as mentioned in above screenshot.
-- You will have to enter something like below for the FULL backup- happening every saturday 09:21 PM UTC for the database ABC
insert
into "_SYS_XS"."JOB_SCHEDULES" values(3,
'Scheduled_Backup::DataBackup',
'* * * sat 21 19 0',
'SCHEDULE-FULL-BACKUP-ABC',
'{"meta":{"DEVICE_TYPE":{},"TOOL_OPTION":{},"DATA_BACKUP_PATH":{},"DATA_BACKUP_PREFIX":{},"BACKUP_TYPE":{},"COMMENT":{},"START_OF_SERIES":{},"DATABASE":{}},"values":{"DEVICE_TYPE":"file","TOOL_OPTION":"","DATA_BACKUP_PATH":"/hana/backup/ABC/data/DB_ABC/","DATA_BACKUP_PREFIX":"[date]_[time]_full_ABC","BACKUP_TYPE":"complete","COMMENT":"Scheduled backup","START_OF_SERIES":"2021-04-06 19:23:49","DATABASE":""}}',
'RUNTIME',
'ACTIVE',
'SYSTEM',
now())
;
--check the changes with same sql as specified in line#2
--commit the changes
commit;
--for the differential backups, you can use the same commands, note that you need to specify the type as below
--you can just compare with above code to see the difference)
insert
into "_SYS_XS"."JOB_SCHEDULES" values(4,
'Scheduled_Backup::DataBackup',
'* * * mon,tue,wed,thu,fri,sun 23 22 0',
'SCHEDULE-DIFFERENTIAL-BACKUP-ABC',
'{"meta":{"DEVICE_TYPE":{},"TOOL_OPTION":{},"DATA_BACKUP_PATH":{},"DATA_BACKUP_PREFIX":{},"BACKUP_TYPE":{},"COMMENT":{},"START_OF_SERIES":{},"DATABASE":{}},"values":{"DEVICE_TYPE":"file","TOOL_OPTION":"","DATA_BACKUP_PATH":"/hana/backup/ABC/data/DB_ABC/","DATA_BACKUP_PREFIX":"[date]_[time]_diff_ABC","BACKUP_TYPE":"differential","COMMENT":"Scheduled backup","START_OF_SERIES":"2021-04-10 00:00:00","DATABASE":""}}',
'RUNTIME',
'ACTIVE',
'SYSTEM',
now())
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment