数据库版本:

test=# select version();
version
----------------------------------------------------------------------------------------------------------------------
KingbaseES V008R006C005B0041 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), 64-bit
(1 row)

1、数据库软件安装路径

=此版本的软件安装路径和前面的版本相比有了较大变化,通过软链接可以在一个父目录下建立多个版本的软件=

[kingbase@node1 V8R6C5_41]$ ls -lh
total 0
lrwxrwxrwx 1 kingbase kingbase 68 Mar 21 15:04 ClientTools -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/ClientTools/
lrwxrwxrwx 1 kingbase kingbase 60 Mar 21 15:04 doc -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/doc/
lrwxrwxrwx 1 kingbase kingbase 64 Mar 21 15:04 install -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/install/
lrwxrwxrwx 1 kingbase kingbase 66 Mar 21 15:04 Interface -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Interface/
drwxrwxr-x 3 kingbase kingbase 30 Mar 21 15:02 KESRealPro
lrwxrwxrwx 1 kingbase kingbase 67 Mar 21 15:04 KingbaseHA -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/KingbaseHA/
lrwxrwxrwx 1 kingbase kingbase 67 Mar 21 15:04 license.dat -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/license.dat
lrwxrwxrwx 1 kingbase kingbase 63 Mar 21 15:04 Server -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/
lrwxrwxrwx 1 kingbase kingbase 65 Mar 21 15:04 SupTools -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/SupTools/
lrwxrwxrwx 1 kingbase kingbase 66 Mar 21 15:04 Uninstall -> /opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Uninstall/

2、配置归档

[root@node1 data]# cat kingbase.conf |grep -i archive_
archive_mode = on # enables archiving; off, on, or always
archive_command='export TZ=Asia/Shanghai;/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_rman --config /home/kingbase/kbbr6_repo/sys_rman.conf --stanza=kingbase archive-push %p'

3、配置备份配置文件

[kingbase@node1 bin]$ cat sys_backup.conf
#file: sys_backup.conf
#dest dir: <cluster_dir>/kingbase/bin/sys_backup.conf
#dest dir: <cluster_dir>/kingbase/share/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="127.0.0.1"
# local repo IP, inner-REPO, means repo located in one db node
# outer repo IP, outer-REPO, means repo located in outer node
_repo_ip="127.0.0.1"
# 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="/home/kingbase/kbbr6_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
# band witdh limit, fixed in Mb/s, default 0 means no limit
_band_width=0
# OS cmd define
_os_ip_cmd="/sbin/ip"
_os_rm_cmd="/bin/rm"
_os_sed_cmd="/bin/sed"
_os_grep_cmd="/bin/grep"
# !!! these follow 4 parameter ONLY for single style
# data dir of single
_single_data_dir="/data/kingbase/v8r6c5_041/data"
# bin dir of single
_single_bin_dir="/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin"
# database user of single
_single_db_user="system"
# database port of single
_single_db_port="54321" # on means sys_securecmd, off means normal ssh
_use_scmd=on

4、执行备份的初始化

[kingbase@node1 bin]$ ./sys_backup.sh init
Please input password ...
# generate single sys_rman.conf...DONE
# update single archive_command with sys_rman.archive-push...DONE
# create stanza and check...(maybe 60+ seconds)
# create stanza and check...DONE
# initial first full backup...(maybe several minutes)
# initial first full backup...DONE
# Initial sys_rman OK.

5、查看初始化后备份目录及配置文件

[kingbase@node1 bin]$ ls -lh /home/kingbase/kbbr6_repo/
total 4.0K
drwxr-x--- 3 kingbase kingbase 21 Mar 21 15:46 archive
drwxr-x--- 3 kingbase kingbase 21 Mar 21 15:46 backup
-rw-rw-r-- 1 kingbase kingbase 539 Mar 21 15:46 sys_rman.conf #配置文件
[kingbase@node1 bin]$ cat /home/kingbase/kbbr6_repo/sys_rman.conf
# Genarate by script at 20220321154646, should not change manually
[kingbase]
kb1-path=/data/kingbase/v8r6c5_041/data
kb1-port=54321
kb1-user=system [global]
repo1-path=/home/kingbase/kbbr6_repo
repo1-retention-full=5
log-path=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/log
log-level-file=info
log-level-console=info
log-subprocess=y
process-max=4
#### default gz, support: gz none
compress-type=gz
compress-level=3
band-width=0
cmd-ssh=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_securecmd

6、查看备份日志

[kingbase@node1 log]$ cat sys_rman_stanza-create.log

2022-03-21 15:46:47.031 P00   INFO: stanza-create command begin 2.27: --cmd-ssh=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/bin/sys_securecmd --config=/home/kingbase/kbbr6_repo/sys_rman.conf --exec-id=28484-a4317ee9 --kb1-path=/data/kingbase/v8r6c5_041/data --kb1-port=54321 --kb1-user=system --log-level-console=info --log-level-file=info --log-path=/opt/Kingbase/ES/V8R6C5_41/KESRealPro/V008R006C005B0041/Server/log --log-subprocess --repo1-path=/home/kingbase/kbbr6_repo --stanza=kingbase
2022-03-21 15:46:48.196 P00 INFO: stanza-create for stanza 'kingbase' on repo1
2022-03-21 15:46:49.295 P00 INFO: stanza-create command end: completed successfully (2267ms)

7、备份故障案例分析

故障现象:

故障分析:

1)查看sys_backup.conf配置

2)检查数据库归档配置

故障原因:

8、总结

1)最新版本的软件安装目录存储方式有较大的变化
2)执行ssh跨节点访问,专门的命令:sys_securecmd
3)在备份前,需要检查下kingbase.conf中归档的配置

KingbaseES V8R6C5B041 sys_backup.sh单实例备份案例的更多相关文章

  1. 【RAC】将单实例备份集恢复为rac数据库

    [RAC]将单实例备份集恢复为rac数据库 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识, ...

  2. kingbaseES R3 集群备库转换为单实例库案例

    案例说明: 在生产环境需要将集群中架构转换为单实例环境,本案例以备库转换为单实例库为案例,介绍了两种方案,一种在数据库数据量小的环境下采用 sys_dumpall 导出导入方式建立单实例库:另外一种是 ...

  3. KingbaseES V8R6C5B041手工创建集群测试案例

    ​ 案例说明: KingbaseES V8R6C5B041版本和以前的KingbaseES R6有一定的区别,增加了"securecmdd"的工具,并且在install.conf配 ...

  4. KingbaseES V8R6C5单实例sys_backup.sh备份案例

    ​ 案例说明: KingbaseES V8R6C5版本中使用了securecmdd工具,用于主机节点间的通讯,默认端口8890.备份工具sys_backup.sh默认使用了securecmdd工具,对 ...

  5. KingbaseES V8R6单实例外部备份案例

    案例说明: 本案例采用sys_backup.sh执行物理备份,备份使用如下逻辑架构:数据库主机采用CentOS 7系统,repo采用kylin V10 Server. 单实例+外部备份服务器 备份逻辑 ...

  6. KingbaseES V8R6备份恢复案例之--删除test数据库后sys_backup.sh备份

    案例说明: KingbaseES V8R6通过sys_backup.sh执行物理备份,默认sys_backup.sh执行备份初始化时,需要连接test数据库进行身份的认证:在一些生产环境为了安全需求, ...

  7. KingbaseES R6 集群修改ssh端口执行sys_backup.sh备份案例

    数据库环境:** test=# select version(); version ---------------------------------------------------------- ...

  8. KingbaseES V8R6集群外部备份案例

    案例说明: 本案例采用sys_backup.sh执行物理备份,备份使用如下逻辑架构:集群采用CentOS 7系统,repo采用kylin V10 Server. 一主一备+外部备份 此场景为主备双机常 ...

  9. Oracle RAC备份异机单实例恢复演练

    本文只节选了操作方案的部分章节: 3.   操作步骤 3.1. 异机单实例Oracle数据库软件安装 在异机上进行单实例Oracle数据库软件安装.该步骤过程不再本文中重复描述,如果对安装过程存在疑问 ...

随机推荐

  1. vue封装手机验证码

    // 获取验证码 let endMsRes = new Date().getTime() + 45000; localStorage.setItem("myEndTime", JS ...

  2. 【Java面试】Kafka 怎么避免重复消费

    Hi,大家好,我是Mic 一个工作5年的粉丝找到我. 他说: "Mic老师,你要是能回答出这个问题,我就佩服你" 我当场就懵了,现在打赌都这么随意了吗? 我问他问题是什么,他说&q ...

  3. ArrayList和LinkedList内部是怎么实现的?他们之间的区别和优缺点?

    ArrayList 内部使用了数组形式进行了存储,利用数组的下标进行元素的访问,因此对元素的随机访问速度非常快.因为是数组,所以ArrayList在初始化的时候, 有初始大小10,插入新元素的时候,会 ...

  4. ShardingSphere-proxy-5.0.0企业级分库分表、读写分离、负载均衡、雪花算法、取模算法整合(八)

    一.简要说明 以下配置实现了: 1.分库分表 2.每一个分库的读写分离 3.读库负载均衡算法 4.雪花算法,生成唯一id 5.字段取模 二.配置项 # # Licensed to the Apache ...

  5. 「笔记」折半搜索(Meet in the Middle)

    思想 先搜索前一半的状态,再搜索后一半的状态,再记录两边状态相结合的答案. 暴力搜索的时间复杂度通常是 \(O(2^{n})\) 级别的.但折半搜索可以将时间复杂度降到 \(O(2 \times 2^ ...

  6. Graph Neural Networks:谱域图卷积

    以下学习内容参考了:1,2, 0.首先回忆CNN,卷积神经网络的结构和特点 处理的数据特征:具有规则的空间结构(Euclidean domains),都可以采用一维或者二维的矩阵描述.(Convolu ...

  7. Cisco Packet Tracer Student(思科网络模拟器)模拟集线器和嗅探攻击

    一.集线器简介 集线器是局域网内的基础设备,工作于OSI中的物理层,作用是将接收的信号进行放大再传输,集线器是纯硬件设施,集线器开发之初就没考虑过软件层面的操作,所以不具备像路由器.交换机等设备那样具 ...

  8. Static、Final关键字详解

    1.Static 详情见下面代码讲解 点击查看代码 package com.Tang.oop.demo07; public class Student { private static int age ...

  9. jdbc 09: preparedStatement实现增删改查

    jdbc连接mysql,利用preparedStatement实现增删改查 package com.examples.jdbc.o9_preparedStatement实现增删改; import ja ...

  10. NOI / 1.4编程基础之逻辑表达式与条件分支讲解-01:判断数正负

    总时间限制: 1000ms 内存限制: 65536kB 题目: 描述 给定一个整数N,判断其正负. 输入 一个整数N(-109 <= N <= 109) 输出 如果N > 0, 输出 ...