原文:http://blog.51cto.com/jenvid/1875760
备份的类型
Option | Description |
Complete Data Backup | A data backup includes all the data structures that are required to recover the database. |
Differential Data Backup | Differential backups store all the data changed since the last full data backup. |
Incremental Data Backup | An incremental backup stores the data changed since the last full data backup or the last
delta backup (incremental or differential). |
备份的工具
- SAP HANA studioHANA studio – 右键SID – Backup and Recovery – Back Up system 备份完整数据库或者打开Open Backup Console选择备份类型
这里的备份文件命名自动生成,如果是同样的备份路径,上一次备份将会被覆盖
- SAP HANA cockpit从studio进入或者打开链接
https://eccqas:4300/sap/hana/admin/cockpit/
http://eccqas:8000/sap/hana/admin/cockpit/
SAP HANA Backup – Create Backup创建一个backup马上备份
或者创建一个schedule周期调度,注意Backup Prefix,调度名字,周期
如果看不到SAP HANA Backup磁贴,那么需要给登录的HANA数据库用户授权
sap.hana.backup.roles::Administrator
如果看不到Create Schedule,那么需要给登录的HANA数据库用户授权
sap.hana.backup.roles::Scheduler
与之相关的操作角色是sap.hana.backup.roles::Operator
注意:调度器默认是不激活的状态,创建调度计划后会提示
Backups cannot be scheduled, because the XS Job Scheduler is not active. For more information, see SAP HANA Administration Guide
则需要到URL激活 enable:http://eccqas:8000/sap/hana/xs/admin/jobs/#
并且需要角色sap.hana.xs.admin.roles::JobSchedulerAdministrator,否则是灰的无法激活
作业管理角色:sap.hana.xs.admin.roles::JobAdministrator
3.Native SQLDBA Cockpit for SAP HANA
过程参考:http://tecadmin.net/backup-sap-hana-database-using-command-line/#
1 2 3 |
#su - sidadm hdbsql \c -i 00 -n eccqas:30015 -u system -p Bm2015## |
help:
hdbsql=> \h
\? or \h[elp] show help on internal slash commands
\q[uit] quit HDBSQL
\c[onnect] -i
-n [:]
-d
-u
-p
-U
connecting to the database
\di[sconnect] disconnecting from the database
help.sap.com:https://help.sap.com/saphelp_hanaplatform/helpdata/en/75/a06c444e9a4b3287a46a6a40b4ee69/content.htm
可以在系统下用crontab
complete 全备:hdbsql -U USER4BACKUP “backup data using file (\’complete_backup_prefix\’)”
incremental增备:hdbsql -U USER4BACKUP “backup data INCREMENTAL using file (\’incremental_backup_prefix\’)”
differential差备:hdbsql -U USER4BACKUP “backup data DIFFERENTIAL using file (\’differential_backup_prefix\’)”
异步最后加上ASYNCHRONOUS
1950261 – SAP HANA Database Backup Policy Recommendations and Regular Backup Script
create user password “”;
alter user DISABLE PASSWORD LIFETIME;
grant backup operator to ;
hdbuserstore set USER4BACKUP localhost:315
note已经有标准shell脚本
1 2 3 4 5 6 7 8 9 10 |
#!/bin/sh #/* Backup script */ source $HOME/.bashrc date="$(date "%Y-%m-%d")" time="$(date "%Y-%m-%d %H:%M:%S")" backup="backup data using file (\'$date\')" echo "daily backup :" $time "Start" >> $DIR_INSTANCE/backup.log $DIR_EXECUTABLE/hdbsql -U USER4BACKUP -x $backup time="$(date "%Y-%m-%d %H:%M:%S")" echo "daily backup :" $time "End" >> $DIR_INSTANCE/backup.log |
周日全备,周一至周六增备
1 2 3 4 5 6 7 8 9 10 |
#!/bin/sh #/* Complete Backup script_completebackup.sh*/ source $HOME/.bashrc date="$(date "%Y-%m-%d")" time="$(date "%Y-%m-%d %H:%M:%S")" backup="backup data using file (\'$date.complete\')" echo "daily backup :" $time "Start" >> $DIR_INSTANCE/backup.log $DIR_EXECUTABLE/hdbsql -U USER4BACKUP -x $backup time="$(date "%Y-%m-%d %H:%M:%S")" echo "daily backup :" $time "End" >> $DIR_INSTANCE/backup.log |
1 2 3 4 5 6 7 8 9 10 |
#!/bin/sh #/* Incremental Backup script_incrementbackup.sh */ source $HOME/.bashrc date="$(date "%Y-%m-%d")" time="$(date "%Y-%m-%d %H:%M:%S")" backup="backup data INCREMENTAL using file (\'$date\')" echo "daily backup :" $time "Start" >> $DIR_INSTANCE/backup.log $DIR_EXECUTABLE/hdbsql -U USER4BACKUP -x $backup time="$(date "%Y-%m-%d %H:%M:%S")" echo "daily backup :" $time "End" >> $DIR_INSTANCE/backup.log |
第三方备份工具将file改成backint
4.通过SAP HANA Cockpit备份HANA数据库
事务码:DBACOCKPIT 或者DB13。
本文作者: GavinDong
版权属于: GavinDong博客
文章链接: https://gavindong.com/1921.html
如果使用过程中遇到问题,可 **点击此处** 交流沟通。
版权所有,转载时必须以链接形式注明作者和原始出处及本声明。