SAP HANA数据库备份方式与工具

备份的类型

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).

备份的工具

  1. SAP HANA studio

    HANA studio - 右键SID - Backup and Recovery - Back Up system 备份完整数据库或者打开Open Backup Console选择备份类型 

    这里的备份文件命名自动生成,如果是同样的备份路径,上一次备份将会被覆盖


  2. SAP HANA cockpit

    从studio进入或者打开链接

    https://eccqas:4300/sap/hana/admin/cockpit/

    http://eccqas:8000/sap/hana/admin/cockpit/

    SAP HANA Backup - Create Backup创建一个backup马上备份

    wKioL1g1KvTSyz1BAACJoDNtgBo197.jpg

    或者创建一个schedule周期调度,注意Backup Prefix,调度名字,周期

    wKioL1g1KyHBJ9geAAEpPqGpriE808.jpg

        如果看不到SAP HANA Backup磁贴,那么需要给登录的HANA数据库用户授权

        sap.hana.backup.roles::Administrator

        如果看不到Create Schedule,那么需要给登录的HANA数据库用户授权

        sap.hana.backup.roles::Scheduler

        与之相关的操作角色是sap.hana.backup.roles::Operator

         wKiom1g1KzOBFG4rAAEghqqoXUU662.jpg

    注意:调度器默认是不激活的状态,创建调度计划后会提示

    Backups cannot be scheduled, because the XS Job Scheduler is not active. For more information, see SAP HANA Administration Guide


       wKiom1g1K0GiZv2qAAEEbVElg9M399.jpg

    则需要到URL激活 enable:http://eccqas:8000/sap/hana/xs/admin/jobs/#

    并且需要角色sap.hana.xs.admin.roles::JobSchedulerAdministrator,否则是灰的无法激活

    作业管理角色:sap.hana.xs.admin.roles::JobAdministrator

             wKioL1g1K0_yMvYIAAErK7GXjiI683.jpg


    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 <instance number>

                -n <host>[:<port>]

                -d <database name>

                -u <user_name>

                -p <password>

                -U <user_store_key>

                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 <Backup User Name> password "<Password>";
alter user <Backup User Name> DISABLE PASSWORD LIFETIME;
grant backup operator to <Backup User Name>;

hdbuserstore set USER4BACKUP localhost:3<Instance Number>15 <Backup User Name> <Password>

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,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值