kingbaseV8物理备份配置

本文详细介绍了如何配置Kingbase数据库的备份,包括备份目录设置、物理备份的启动与停止、定时任务的管理和恢复操作。涉及sys_backup.sh脚本和RMAN的使用方法。
摘要由CSDN通过智能技术生成

1、配置备份

cd /data/cluster/kingbase/share

vi sys_backup.conf

# target db style enum:  single/cluster

_target_db_style="single"

# one kingbase node IP

# just provide one IP, script will use 'repmgr cluster show' get other node IP

_one_db_ip="10.1.56.139"

# local repo IP, inner-REPO, must be same as one_db_ip, means repo located in one db node

# outer repo IP, outer-REPO, means repo located in outer node

_repo_ip="10.1.56.135"

# label of this cluster

_stanza_name="kingbase"

# OS user name of database

_os_user_name="kingbase"

# !!!! dir to store the backup files

# should be accessable for the OS user

_repo_path="/data/backup_rman/kbbr_repo"#备份集目录,kbbr_repo这个之前的路径随意,这个是必须存在的

# count of keep, over the count FULL-backup will be remove

_repo_retention_full_count=5

# count of days, interval to do FULL-backup

_crond_full_days=7

# count of days, interval to do DIFF-backup

_crond_diff_days=0

# count of days, interval to do INCR-backup

_crond_incr_days=1

# HOUR to do the FULL-backup

_crond_full_hour=2

# HOUR to do the DIFF-backup

_crond_diff_hour=3

# HOUR to do the INCR-backup

_crond_incr_hour=4

# OS cmd define

_os_ip_cmd="/usr/sbin/ip"

_os_rm_cmd="/usr/bin/rm"

_os_sed_cmd="/usr/bin/sed"

_os_grep_cmd="/usr/bin/grep"

# !!! these follow 4 parameter ONLY for single style

# data dir of single

_single_data_dir="/data/data" #data路径

# bin dir of single

_single_bin_dir="/home/kingbase/cluster/kingbase/bin"在使用sys_rman命令时需要

# database user of single

_single_db_user="system"

# database port of single

_single_db_port="54321"

保存退出

2初始化备份目录

cd /data/cluster/kingbase/bin

./sys_backup.sh init

3开启物理备份

sys_backup.sh start(在/etc/cron.d/KINGBASECRON定时任务中配置定时任务)

4、关闭物理备份

sys_backup.sh stop(在/etc/cron.d/KINGBASECRON定时任务中删除定时任务)

5暂时停止定时备份

sys_backup.sh pause 不影响已经在进行中的备份动作

6恢复被暂停的定时备份

sys_backup.sh unpause

0 2 */7 * * kingbase /home/kingbase/cluster/kingbase/bin/sys_rman --config=/data/backup_rman/kbbr_repo/sys_rman.conf --stanza=kingbase --archive-copy --type=full backup >> /home/kingbase/cluster/kingbase/log/sys_rman_backup_full.log 2>&1

每周第七天凌晨2点进行全被

0 4 */1 * * kingbase /home/kingbase/cluster/kingbase/bin/sys_rman --config=/data/backup_rman/kbbr_repo/sys_rman.conf --stanza=kingbase --archive-copy --type=incr backup >> /home/kingbase/cluster/kingbase/log/sys_rman_backup_incr.log 2>&1

每天凌晨4点进行增量备份

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值