dbserver_backup.sh脚本在老版本的exadata中,它存放在/opt/oracle.SupportTools目录中,主要用于/根文件系统和/boot分区的备份。dbserver_backup.sh脚本是将/根文件的内容复制至另外一个大小与根分区完全一样的其它分区中。

随着Exadata软件版本的不断更新,dbserver_backup.sh脚本同时也包含在计算节点的升级工具中,通常计算节点升级前的检查阶段,会自动地调用dbserver_backup.sh脚本完成操作系统的备份工作。

 

dbserver_backup.sh脚本进行系统备份的前提条件:

1、计算节点的文件系统使用基于LVM的管理方式,除了/boot分区。

2、操作系统系统中应该存在一个大小与/ 根分区完全一致的其它分区,如果不存在这样一个分区,则vg中必须还有足够的剩余空间来创建这样的一个分区。

 

下面,我们来看看dbserver_backup.sh脚本的参数说明:

[root@ggdb01 11.2.3.2.1]# ./dbserver_backup.sh -h

 

Usage: ./dbserver_backup.sh [--backup-to-partition <1|2>] [-help], where options

 

no options - create backup of active /dev/mapper/VGExaDb-LVDbSys1 partition

on /dev/mapper/VGExaDb-LVDbSys2 partition

 

--backup-to-partition - either 1 or 2 (default). Overwrite default behavior. Create backup of active partition on the provided backup partition.

 

-help - print this info

 

[root@ggdb01 11.2.3.2.1]#

从以上的脚本参数说明,基本上也可以看出dbserver_backup.sh脚本的主要作用是将/dev/mapper/VGExaDb-LVDbSys1分区的数据备份至/dev/mapper/VGExaDb-LVDbSys2分区。

 

说明:

1、如果使用dbserver_backup.sh脚本进行系统备份,则必须先检查是否存在非本地文件系统,也即是否存在NFS文件系统,如果存在,则必须先umount掉NFS文件系统。否则备份会失败。

2、检查是否存在LVDbSys1和LVDbSys2两个分区,如果不存在LVDbSys2分区,则必须检查VG中是否有足够的剩余空间来备份操作系统。

3、操作系统中的LV命名,只允许存在两个以"LVDBSys "开头的LV,也即LVDBSys1和LVDBSys2。

 

(1)、手动直接调用dbserver_backup.sh脚本:

[root@dw01db01 ~]# chmod +x /u01/patches/linux_patches/p13741363_112321_Linux-x86-64/13741363/11.2.3.2.1/dbserver_backup.sh

[root@dw01db01 ~]# sh /u01/patches/linux_patches/p13741363_112321_Linux-x86-64/13741363/11.2.3.2.1/dbserver_backup.sh

以下信息是dbserver_backup.sh脚本备份生成的日志:

[INFO] Start to backup root /dev/VGExaDb/LVDbSys1 and boot partitions

[INFO] Check for Volume Group "VGExaDb"

[INFO] Check for the LVM root partition "VGExaDb/LVDbSys1"

[INFO] The active root partition /dev/VGExaDb/LVDbSys1 has proper label DBSYS

[INFO] The backup partition /dev/VGExaDb/LVDbSys2 has no label

[INFO] Root file system is mounted to /dev/mapper/VGExaDb-LVDbSys1

[INFO] LVM root partition size: 30.00G (62914560S)

[INFO] Total amount of free space: 202.80G (425304064S)

[INFO] Create spare root partition in Volume Group "VGExaDb"

Logical volume "LVDbSys2" created

[INFO] Create ext3 file system on spare root partition /dev/VGExaDb/LVDbSys2

[INFO] Mount spare root partition /dev/VGExaDb/LVDbSys2 to /mnt_spare

[INFO] Create LVM snapshot with 1Gb size of the root partition /dev/VGExaDb/LVDbSys1

Logical volume "LVDbSys1Snap" created

[INFO] Mount snapshot partition /dev/VGExaDb/LVDbSys1Snap to /mnt_snap

[INFO] Clone data from the snapshot to the spare root partition

………(略)

[INFO] Unmount snapshot partition /mnt_snap

[INFO] Remove snapshot partition /dev/VGExaDb/LVDbSys1Snap

Logical volume "LVDbSys1Snap" successfully removed

[INFO] Save partition table of /dev/sda in /mnt_spare/part_table_backup.txt

[INFO] Save lvm info in /mnt_spare/lvm_info.txt

[INFO] Unmount spare root partition /mnt_spare

[INFO] Backup of root /dev/VGExaDb/LVDbSys1 and boot partitions is done successfully

[INFO] Backup partition is /dev/VGExaDb/LVDbSys2

[INFO] /boot area back up named boot_backup.tbz (tar.bz2 format) is on the /dev/VGExaDb/LVDbSys2 partition.

[INFO] No other partitions were backed up. You may manually prepare back up for other partitions.

[root@dw01db02 oracle.SupportTools]#

从以上的日志我们可以看出,dbserver_backup.sh脚本其实也是利用Linux操作系统的LVM snapshot技术进行的/ 根文件系统备份,最后再将/boot文件系统中的数据备份成boot_backup.tbz文件放在LVDbSys2中。

 

(2)、升级工具调用dbserver_backup.sh脚本:

在计算节点升级工具的不断演变过程中,dbserver_backup.sh脚本也融合到计算节点的升级工具内,可以直接执行升级工具来调用dbserver_backup.sh脚本。

下面,我们以计算节点最新的升级工具patchmgr为例,展示计算节点的升级工具对dbserver_backup.sh脚本的调用。

[root@ggdb01 dbserver_patch_5.170123]# ./patchmgr -h

Usage:

./patchmgr -dbnodes <database_node_list_file>

-backup (yum_repo <baseurl> | -iso_repo <zipped_iso_file>) [-target_version version] [-rolling] [-unkey] |

-precheck (yum_repo <baseurl> | -iso_repo <zipped_iso_file>) [-target_version version] [-unkey] |

-upgrade (yum_repo <baseurl> | -iso_repo <zipped_iso_file>) [-target_version version] [-rolling] [-unkey] |

-rollback [-rolling] [-unkey]

-cleanup [-unkey]

 

MANDATORY PARAMETER

 

-dbnodes db_nodes_list_file

Specifies the name of the database node(s) list file. The file has one

hostname or ip per line.

 

ACTIONS

 

-backup

Perform backup only the database node(s) specified in the host list.

Runs backup in non-rolling fashion unless -rolling option is specified.

而查看patchmgr工具脚本,可以看出,真正进行升级工作的还是dbnodeupdate.sh升级工具,patchmgr工具脚本只是做了一些封装而已,继续查看dbnodeupdate.sh升级工具的代码。

#------------------------------------------------------------------------------

# PROCEDURE : PrepBackup

# INPUT :

# DESCRIPTION :

#------------------------------------------------------------------------------

PrepBackup()

{

local v_record_timings="No"

local v_func_call=${FUNCNAME}

DiaryEntry "${v_func_call}" "Enter" "${v_record_timings}" ${FUNCNAME}

 

v_to_release_maj=`echo ${v_to_release} 2>/dev/null | cut -d \. -f1-5`

# 24784563

# 24826294

 

# When image -ge 121233 we assume we can run dbserver_backup.sh from /opt/oracle.SupportTools

if [ ${v_current_image_id_maj} -ge 121233 ]

then

v_dbserver_backup_sh="/opt/oracle.SupportTools/dbserver_backup.sh"

if ! [ -f "${v_dbserver_backup_sh}" ]

then

# If the file is removed - then just grab the latest one shipping with the helpers

v_dbserver_backup_sh="${v_dbupdate_helpers_loc}/12.1.2.3.2/dbserver_backup.sh"

fi

else

# 24826294 - Images older than 121233 and newer or equal to 112310 can use the one shipping with helpers

if [ ${v_current_image_id_maj} -lt 121233 ] && [ ${v_current_image_id_maj} -ge 112310 ]

then

local v_current_image_version_maj=$(echo ${v_current_image_version} | cut -d \. -f1-5)

v_dbserver_backup_sh="${v_dbupdate_helpers_loc}/${v_current_image_version_maj}/dbserver_backup.sh"

else

if [ ${v_current_image_id_maj} -lt 112310 ]

then

# On 11.2.2.4.2 this script seems missing by default - this may happen on other older images.

# For those cases where this script is missing : just use the one from a release later

v_dbserver_backup_sh="${v_dbupdate_helpers_loc}/11.2.3.1.0/dbserver_backup.sh"

fi

fi

fi

从这部分代码可以看出,所有的计算节点升级工具,在升级前的操作系统备份工作都是调用的dbserver_backup.sh脚本。

Exadata中的dbserver_backup.sh脚本的更多相关文章

  1. sh脚本实战

    做了什么东西还是要尽快移动到博客上,不然回头看自己写的东西已经看不懂了... 凭着回忆+搜资料,把当初写sh脚本的过程写上来. 首先新建一个.sh文件,用vim就可以 在sh的第一行,写上 #!/bi ...

  2. Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。

    在Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...

  3. 在Linux中执行.sh脚本,异常

    在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...

  4. ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作。那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别是fork、source和exec。 1. fork 即通过sh 脚本名进行执行脚本的方式。下面通过一个简单的例子来讲解下它的特性。 创建father.sh,内容如下: #!/bin/bas

    ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作.那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别 ...

  5. ubuntu中写sh脚本

    批量执行命令 https://jingyan.baidu.com/article/3052f5a121c8ac97f21f8661.html 批量执行脚本也是可行的! 如,main.sh内写   sh ...

  6. 在Linux中执行.sh脚本,异常/bin/sh^M

    在Linux中执行.sh脚本,异常/bin/sh^M 在linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分 ...

  7. 使用shell程序备份crontab中的.sh脚本文件

    需求 线上环境有一些定时脚本(用crontab -l可查看当前用户的),有时我们可能会改这些定时任务的脚本内容.为避免改错无后悔药,需用shell实现一个程序,定时备份crontab中的.sh脚本文件 ...

  8. ps -ef |grep -v 在shell sh 脚本中貌似无效?

    想通过ps -ef |grep erdp_ |awk '{print $2}' 获取 erdp_ 开头的进程id, 执行在终端环境下执行是ok的,但是在 sh 脚本里面竟然多出了 两个 root 11 ...

  9. Exadata中Infiniband交换机升级

    Infiniband交换机的软件补丁包,随着软件版本的不同,其发布方式也有所变化,从如下图表可以看出,1.3.3-2这个版本是一个分水岭,这个版本及以前的版本,补丁包是单独下载的,而之后的版本,inf ...

随机推荐

  1. yarn 官方配置推荐

    http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.4/bk_installing_manually_book/content/rpm-chap ...

  2. ACM学习历程—HDU 5512 Pagodas(数学)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5512 学习菊苣的博客,只粘链接,不粘题目描述了. 题目大意就是给了初始的集合{a, b},然后取集合里 ...

  3. 【Google】非下降数组

    转自九章算法公众号 题目描述 给出包含n个整数的数组,你的任务是检查它是否可以通过修改至多一个元素变成非下降的.一个非下降的数组array对于所有的i(1<=i<n)满足array[i-1 ...

  4. bzoj 1711 Dining吃饭 —— 最大流

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1711 食物一列,牛拆点,饮料一列. 代码如下: #include<cstdio> ...

  5. Java常见设计模式之工厂模式

    工厂模式在我们日常的应用中应当算是比较广泛的一种设计模式了.今天让我们一起来学习一下,工厂的设计模式. 工厂模式在<Java与模式>中分为三类:     1)简单工厂模式(Simple F ...

  6. ss3

    1)执行如下命令,进行安装shadowsocks(命令需要一条条的输入,然后回车,执行完一条,在执行下一条命令),过程中可能会让你选择确认的地方,直接输入"y"回车即可: yum ...

  7. js插件库+bootstrap

    1.Chart.js 官网地址:http://chartjs.cn/ 2.优秀的bootstrap模板推荐 官网地址:http://bootswatch.com 3.wow+animate+js插件库 ...

  8. 通信端口Com口被占用的原因分析

    目前在调试地磅读取程序,近一段时间无法读取,排查原因发现是com1端口被占用. 从网上找了无数个文章,最终得到一条有价值的消息, 原因如下: com1端口不能读取电子地磅的数据了,重启之后发现 有一个 ...

  9. HTML5-A*寻路算法

    设置起点 设置终点 设置障碍 清除障碍 允许斜向跨越

  10. HTMLParser使用详解(2)- Node内容

    HTMLParser使用详解(2)- Node内容  2010-03-18 13:41 HTMLParser将解析过的信息留存为一个树的结构.Node是信息留存的数据类型基础.请看Node的界说:pu ...