批处理数据--db2备份数据

如果要插入数据,前提先根据主键删除记录,然后在插入。

批处理包含两个必要文件

init.bat和start.bat

文档内容如下

init.bat内容如下

@echo on
db2 connect to cashman user db2inst1 using ‘1qaz!QAZ‘
db2 set schema db2inst1
db2 [email protected] -vf update.sql>log.txt   //将执行结果输出到log.txt
db2 [email protected] -vf delete.sql>>log.txt      //注意,如果是>会覆盖上一个执行结果日志,如果是>>会在上一个日志的基础上追加
db2 [email protected] -vf insert.sql>>log.txt   
db2 import from t_user.sql of del modified by codepage=1386 insert into t_user(corpid,userid)>>log.txt   //这个定义参照db2set -all设置,可以保证插入数据全部显示

db2 terminate
pause
exit

start.bat内容如下

@echo off
db2cmd init.bat
exit

编辑的每一个语句以@结束,insert以最后一条记录为准后@结束

db2 import from t_user.sql of del modified by codepage=1386 insert into t_user(corpid,userid)>>log.txt

用到这句话时,t_user.sql用记事本打开

"武金晶","010184","901010200",5,"120108198502280023","13662003683","965EB72C92A549DD","01"
"强雅薇","012111","901010200",5,"120106199107267023","13802098032","965EB72C92A549DD","01"

无需加@,执行结果在log日志中显示

备份

http://www.infoq.com/cn/presentations/zee-system-performance-analysis

-bash-3.2# db2 backup db cashman
 SQL1092N  "ROOT" does not have the authority to perform the requested command
or operation.
-bash-3.2# db2 backup db cashman to /opt
SQL1092N  "ROOT" does not have the authority to perform the requested command
or operation.
注:在aix系统中root用户没有权限备份db2数据库
-bash-3.2# su -db2inst1
-db2inst1: 0403-010 A specified flag is not valid for this command.
-bash-3.2# su - db2inst1  
注:切换到db2数据库所在的用户
-bash-3.2$ db2 backup db cashman to /opt
SQL1035N  The database is currently in use.  SQLSTATE=57019
注:备份前先关闭数据库
-bash-3.2$ db2stop
02/17/2015 12:32:16     0   0   SQL1025N  The database manager was not stopped because databases are still active.
SQL1025N  The database manager was not stopped because databases are still active.
-bash-3.2$ db2stop force
02/17/2015 12:41:18     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
-bash-3.2$ db2start
注:然后在启动
02/17/2015 12:42:11     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
-bash-3.2$ db2 connect to cashman user db2inst1 using 1qaz!QAZ
-bash: !QAZ: event not found
-bash-3.2$ db2 connect to cashman user db2inst1 using ‘1qaz!QAZ‘
SQL0104N  An unexpected token "!" was found following "<identifier>". 
Expected tokens may include:  "NEW".  SQLSTATE=42601
-bash-3.2$ db2 connect to cashman user db2inst1 using "1qaz!QAZ"
-bash: !QAZ": event not found
-bash-3.2$ db2 connect to cashman

Database Connection Information

Database server        = DB2/AIX64 9.7.0
 SQL authorization ID   = DB2INST1
 Local database alias   = CASHMAN

-bash-3.2$ db2 backup db cashman to /opt
SQL1035N  The database is currently in use.  SQLSTATE=57019
-bash-3.2$ db2 backup db cashman online use tsm
SQL2413N  Online backup is not allowed because the database is not recoverable
or a backup pending condition is in effect.
-bash-3.2$ db2 list applications for db cashman
注:查看当前正在使用的db2连接的情况

Auth Id  Application    Appl.      Application Id                                                 DB       # of
         Name           Handle                                                                    Name    Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
DB2INST1 toad.exe       25         192.168.1.42.60927.150216044739                                CASHMAN  1   
DB2INST1 toad.exe       21         192.168.1.40.62487.150216044337                                CASHMAN  1   
DB2INST1 toad.exe       7          192.168.1.40.62486.150216044332                                CASHMAN  1

-bash-3.2$ db2stop force db2start
SQL2032N  The "db2start" parameter is not valid.  SQLSTATE=22531
-bash-3.2$ db2stop force        
02/17/2015 12:48:43     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
-bash-3.2$ db2 backup db cashman use tsm
SQL1032N  No start database manager command was issued.
-bash-3.2$ db2start
02/17/2015 12:49:07     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
-bash-3.2$ db2 backup db cashman use tsm
SQL2071N  An error occurred while accessing the shared library
"/home/db2inst1/sqllib/adsm/libtsm.a". Reason code: "1".
-bash-3.2$ db2 backup db cashman to /opt
SQL2061N  An attempt to access media "/opt" is denied.
-bash-3.2$ su - root
root‘s Password:
-bash-3.2# db2 backup db cashman to /opt
SQL1092N  "ROOT" does not have the authority to perform the requested command
or operation.
-bash-3.2# su - db2inst1
-bash-3.2$ cd /home
-bash-3.2$ ls
ASKeyLinux  chong       db2inst1    hegl        poka01      yang
TT_DB       dasusr1     esaadmin    lost+found  test
backup      db2fenc1    guest       poka        wqs
-bash-3.2$ db2 backup db cashman to /home
SQL2061N  An attempt to access media "/home" is denied.
-bash-3.2$ cd db2inst1
-bash-3.2$ ls
DB2         createsql   db2inst1    hegl        t_inst
bak         db.sql      export_sql  sqllib
-bash-3.2$ cd ..
-bash-3.2$ ls
ASKeyLinux  chong       db2inst1    hegl        poka01      yang
TT_DB       dasusr1     esaadmin    lost+found  test
backup      db2fenc1    guest       poka        wqs
-bash-3.2$ cd backup
-bash-3.2$ ls
mydata
-bash-3.2$ cd ..
-bash-3.2$ ll
-bash: ll: command not found
-bash-3.2$ ls -l
total 56
drwxr-xr-x    2 root     system         4096 Oct 25 2012  ASKeyLinux
drwxr-xr-x    2 root     system         4096 Jul 19 2012  TT_DB
drwxr-xr-x    3 root     system          256 Nov 21 09:19 backup
drwxr-xr-x    2 chong    system          256 Sep 04 2012  chong
drwxr-xr-x    3 dasusr1  dasadm1         256 Sep 15 09:50 dasusr1
drwxr-xr-x    2 214      102             256 May 14 2014  db2fenc1
drwxr-xr-x   10 db2inst1 db2iadm1       4096 Nov 21 10:36 db2inst1
drwxr-xr-x    2 esaadmin system          256 Feb 26 1970  esaadmin
drwxr-xr-x    3 guest    usr             256 Jun 16 2012  guest
drwxr-xr-x    9 hegl     system         4096 Sep 05 2013  hegl
drwx------    2 root     system          256 May 24 2007  lost+found
drwxr-xr-x   20 poka     staff          4096 Dec 02 2013  poka
drwxr-xr-x   11 root     system         4096 Apr 02 2013  poka01
drwxr-xr-x    3 test     staff           256 Sep 15 09:59 test
drwxr-xr-x    3 root     system         4096 Jun 25 2012  wqs
drwxr-xr-x    2 yang     system          256 Sep 04 2012  yang
-bash-3.2$ chmod +w backup
注:db2inst1用户不能赋权限
chmod: backup: Operation not permitted.
-bash-3.2$ su - root     
root‘s Password:
-bash-3.2# chmod 775 /home/backup
注:root用户需要赋权限
-bash-3.2# su - db2inst1
-bash-3.2$ db2 backup db cashman to /home/backup
SQL2061N  An attempt to access media "/home/backup" is denied.
-bash-3.2$ db2 list history backup all for cashman
注:db2历史上备份的情况

List History File for cashman

Number of matching file entries = 8

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20141015151732001   F    D  S0000000.LOG S0000000.LOG 
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20141015151732
   End Time: 20141015151736
     Status: A
 ----------------------------------------------------------------------------
  EID: 5 Location: /home/db2inst1/bak

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  R  D  20141016112050001   F       S0000000.LOG S0000000.LOG 20141015151732
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: RESTORE CASHMAN NO RF                                           
 Start Time: 20141016112050
   End Time: 20141016112126
     Status: A
 ----------------------------------------------------------------------------
  EID: 6 Location:

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20141114121100001   F    D  S0000000.LOG S0000000.LOG 
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20141114121100
   End Time: 20141114121107
     Status: A
 ----------------------------------------------------------------------------
  EID: 13 Location: /home/db2inst1/bak

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150217124659000   N       S0000000.LOG              
 ----------------------------------------------------------------------------

----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN ONLINE                                       
 Start Time: 20150217124659
   End Time: 20150217124700
     Status: A
 ----------------------------------------------------------------------------
  EID: 20 Location:

SQLCA Information

sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2413   sqlerrml: 0

sqlerrmc:
 sqlerrp : sqlubIni
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150217124927000   F       S0000000.LOG              
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20150217124927
   End Time: 20150217124928
     Status: A
 ----------------------------------------------------------------------------
  EID: 21 Location:

SQLCA Information

sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2071   sqlerrml: 37

sqlerrmc: /home/db2inst1/sqllib/adsm/libtsm.a?1
 sqlerrp : sqlubMWR
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150217125001000   F       S0000000.LOG              
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20150217125001
   End Time: 20150217125002
     Status: A
 ----------------------------------------------------------------------------
  EID: 22 Location:

SQLCA Information

sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2061   sqlerrml: 4

sqlerrmc: /opt
 sqlerrp : sqlubMWR
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150217125134000   F       S0000000.LOG              
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20150217125134
   End Time: 20150217125135
     Status: A
 ----------------------------------------------------------------------------
  EID: 23 Location:

SQLCA Information

sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2061   sqlerrml: 5

sqlerrmc: /home
 sqlerrp : sqlubMWR
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:

Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log  Backup ID
 -- --- ------------------ ---- --- ------------ ------------ --------------
  B  D  20150217125411000   F       S0000000.LOG              
 ----------------------------------------------------------------------------
  Contains 4 tablespace(s):

00001 SYSCATSPACE                                                          
  00002 USERSPACE1                                                           
  00003 MYTBS                                                                
  00004 SYSTOOLSPACE                                                         
 ----------------------------------------------------------------------------
    Comment: DB2 BACKUP CASHMAN OFFLINE                                      
 Start Time: 20150217125411
   End Time: 20150217125412
     Status: A
 ----------------------------------------------------------------------------
  EID: 24 Location:

SQLCA Information

sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -2061   sqlerrml: 12

sqlerrmc: /home/backup
 sqlerrp : sqlubMWR
 sqlerrd : (1) 0                (2) 0                (3) 0
           (4) 0                (5) 0                (6) 0
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
           (7)      (8)      (9)      (10)       (11)
 sqlstate:
-bash-3.2$ db2 backup db cashman use tsm
SQL2071N  An error occurred while accessing the shared library
"/home/db2inst1/sqllib/adsm/libtsm.a". Reason code: "1".
-bash-3.2$

-bash-3.2$ db2 backup db cashman use tsm
SQL2071N  An error occurred while accessing the shared library
"/home/db2inst1/sqllib/adsm/libtsm.a". Reason code: "1".
-bash-3.2$ db2 backup db cashman to /home/db2inst1
注:在db2用户有权限的目录下备份

Backup successful. The timestamp for this backup image is : 20150217130757

-bash-3.2$

备份数据库步骤如下
-bash-3.2$ db2 backup db cashman to /home/db2inst1
SQL1035N  The database is currently in use.  SQLSTATE=57019
-bash-3.2$ db2stop force
02/17/2015 13:39:14     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
-bash-3.2$ db2start
02/17/2015 13:39:20     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
-bash-3.2$ db2 connect to cashman

Database Connection Information

Database server        = DB2/AIX64 9.7.0
 SQL authorization ID   = DB2INST1
 Local database alias   = CASHMAN

-bash-3.2$ db2 backup db cashman to /home/db2inst1

bash-3.2$  db2 restore db cashman incremental automatic from /home/db2inst1 taken at 20150217134041 logtarget /db2_log/cashman
SQL1035N  The database is currently in use.  SQLSTATE=57019
-bash-3.2$ db2stop force
02/17/2015 13:56:53     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.
-bash-3.2$ db2start
02/17/2015 13:56:59     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
-bash-3.2$ db2 connect to cashman

Database Connection Information

Database server        = DB2/AIX64 9.7.0
 SQL authorization ID   = DB2INST1
 Local database alias   = CASHMAN

-bash-3.2$ db2 restore db cashman incremental automatic from /home/db2inst1 taken at 20150217134041 logtarget /db2_log/cashman
SQL2581N  Restore is unable to extract log files or restore a log directory
from the backup image to the specified path. Reason code "2".
-bash-3.2$ db2 restore db cashman incremental automatic from /home/db2inst1 taken at 20150217134041  
注:停止db2,启动连接后,可覆盖原数据                       
SQL2539W  Warning!  Restoring to an existing database that is the same as the
backup image database.  The database files will be deleted.
Do you want to continue ? (y/n)
Do you want to continue ? (y/n) y
DB20000I  The RESTORE DATABASE command completed successfully.

创建数据库
C:\Users\Administrator>db2 create database cashman using codeset utf-8 territory
 cn
 注:用db2inst1的用户创建数据库,然后创建模式,模式隶属于用户的关系,在赋予权限
DB20000I  CREATE DATABASE命令成功完成。

C:\Users\Administrator>
C:\Users\Administrator>
C:\Users\Administrator>db2 connect to cashman

数据库连接信息

数据库服务器         = DB2/NT64 9.5.0
 SQL 授权标识         = ADMINIST...
 本地数据库别名       = CASHMAN

C:\Users\Administrator>db2 restore db cashman incremental automatic from D:\ tak
en at 20150203144733
SQL2523W  警告!正在复原至与备份映像上的数据库不同,但具有匹配名称的现有数据库。

目标数据库将被备份版本覆盖。将删除与目标数据库相关联的前滚恢复日志。
想要继续吗?(y/n)
DB20000I  RESTORE DATABASE命令成功完成。

 db2注册码失效

C:\Users\Administrator>db2start
DB2-0 : 服务已返回特定的服务错误代码。

2015-03-06 13:49:54     0   0   SQL8000N  DB2START 处理失败;找不到有效的产品许
可证。如果许可您使用此产品,那么应确保正确注册了许可证密钥。可以通过“许可证中
”或 db2licm 命令行实用程序来注册许可证。许可证密钥可从您的许可产品 CD 中获得。
SQL1032N  未发出启动数据库管理器的命令。  SQLSTATE=57019

注:当出现上述问题,可能是注册码失效了

C:\Users\Administrator>db2 connect to cashman
SQL1032N  未发出启动数据库管理器的命令。  SQLSTATE=57019

C:\Users\Administrator>db2licm -l      注:可用该命令进行查证
Product name:                     "DB2 Enterprise Server Edition"
Expiry date:                      "已到期"
Product identifier:               "db2ese"
Version information:              "9.5"

在网上下载db2ese_cV9.5CPU.lic,用下边的命令加载

C:\Users\Administrator>db2licm -a D:\db2ese_cV9.5CPU.lic

LIC1402I  成功地添加了许可证。

LIC1426I   现在,您已获取本产品的使用许可,详细信息请参阅许可协议。使用此产品必
须接受 IBM 许可协议的条款,该许可协议位于以下目录: "D:\PROGRA~1\IBM\SQLLIB\lice
nse\en"

C:\Users\Administrator>
C:\Users\Administrator>db2licm -l     注:加载完和验证结果
Product name:                     "DB2 Enterprise Server Edition"
License type:                     "CPU 选项"
Expiry date:                      "永久"
Product identifier:               "db2ese"
Version information:              "9.5"
Features:
DB2 Database Partitioning:        "未许可"
DB2 Performance Optimization ESE: "未许可"
DB2 Storage Optimization:         "未许可"
DB2 Advanced Access Control:      "未许可"
DB2 Geodetic Data Management:     "未许可"
DB2 pureXML ESE:                  "未许可"
IBM Homogeneous Federation ESE:   "未许可"
IBM Homogeneous Replication ESE:  "未许可"

C:\Users\Administrator>db2start
2015-03-06 14:27:54     0   0   SQL1063N  DB2START 处理成功。
SQL1063N  DB2START 处理成功。

C:\Users\Administrator>db2 drop db cashman
DB20000I  DROP DATABASE命令成功完成。

C:\Users\Administrator>db2 create database cashman using codeset utf-8 territory
 cn
DB20000I  CREATE DATABASE命令成功完成。
注:用db2的用户创建数据库
C:\Users\Administrator>

时间: 2024-10-12 09:49:29

批处理数据--db2备份数据的相关文章

CentOS 6.5 MySQL/MariaDB数据备份与恢复备份详解

MySQL/MariaDB数据备份与恢复备份 数据对我们来说再重要不过了,那我们如何做到对数据尽可能的安全呢,当我们的数据丢失了那又该怎么做呢,所以说数据备份对我们的数据安全性来说太重要了. 数据对我们来说再熟悉不过了,也最平常不过了,我们每天都在接触各色各样的数据,数据记录了我们平常相关的业务信息,所以数据对于我们来说是很重要的,这么重要的数据如果我们的数据丢失了那我们是不是相关的业务都没法进行了呢,这应该是个很麻烦的问题,那我们怎么保护我们的数据的安全呢,这就要用到我们的数据备份了. 如何执

浅谈oracle逻辑备份、数据泵备份及冷备份

逻辑备份(数据迁移):以逻辑结构为为单位进行的备份跨用户移动数据跨数据库移动数据库为测试保存原始的数据状态对数据库进行版本升级 逻辑导出的注意事项:exp程序在目录中发现同名文件时会直接覆盖,不提示!!exp无法备份无段的空表执行逻辑导出时一定要注意字符集!最好使用包含中文的小表做测试!!导入时的数据和导出时的数据一模一样,导出之后数据库中表的数据变化全都丢失!! 逻辑导出:所有版本都可用,服务器端和客户端都可用 mkdir -p /home/oracle/expbk SQL> create t

数据库中如何备份数据

SQL数据中备份数据的语句: selete * into table_backup from table; 将数据引回原表: insert into table selete * from table_backup; Oracle 数据的备份语句: create table table_backup as selete * from table ;

赋能云HBase备份恢复 百T级别数据量备份恢复支持

云HBase发布备份恢复功能,为用户数据保驾护航.对大多数公司来说数据的安全性以及可靠性是非常重要的,如何保障数据的安全以及数据的可靠是大多数数据库必须考虑的.2016 IDC的报告表示数据的备份(data-protection)和数据恢复(retention)是Nosql的最基础的需求之一. 为什么需要云HBase备份恢复???我们希望云HBase支持备份和恢复功能,主要原因: 用户直接访问操作数据库,可能存在安全风险:项目存在合规以及监管的强需求:对数据库恢复数据到任意时间点(归档到任意时间

Vbs脚本实现数据CUT备份及自动轮询删除备份数据

我们上一篇文章中介绍了使用vbs脚本不同版本的office激活任务,其实说到vbs脚本相信大家都很了解了,有什么作用呢,其实说白了就是执行批处理任务的工具.Vbs在windows上应用相对比较多,其功能上我们就不多说了,今天呢还是介绍vbs脚本程序备份数据的计划任务.怎么想起来备份数据呢,近期呢,领导突然想到对公司的SAP备份数据进行异地备份,这样能提高数据的可恢复性:公司的SAP的系统是每天晚上2点执行一次备份,然后新的一天数据会覆盖旧的数据,如果当数据出现错误,我们也无法使用该之前的备份进行

Linux-6.5下 MariaDB-10基于LVM快照的备份数据 详解

理解部分: LVM是逻辑盘卷管理(Logical Volume Manager)的简称,它是Linux环境下对磁盘分区进行管理的一种机制,LVM是建立在硬盘和分区之上的一个逻辑层,来提高磁盘分区管理的灵活性.LVM可以对分区在线扩容,快照,镜像和条带化,功能非常强大.这篇文章的主题就是其中一个功能--快照. 快照(Snapshot)就是关于指定数据集合的一个完全可用拷贝,该拷贝包括相应数据在某个时间点(拷贝开始的时间点)的映像.快照可以是其所表示的数据的一个副本,也可以是数据的一个复制品: 其实

搭建中小规模集群之rsync数据同步备份

NFS重要问题 1.有关NFS客户端普通用户写NFS的问题. 1)为什么要普通用户写NFS. 2)exports加all_squash. Rsync介绍 什么是Rsync? Rsync是一款开源的.快速的.多功能的.可实现全量即增量的本地或远程数据同步备份的优秀工具.Rsync软件适用于unix.linux.windows等多种操作系统平台. Rsync简介 Rsync英文全称Remote synchronization.从软件的名称就可以看出来,Rsync具有可使本地和远程两台主机之间的数据快

Linux系统crond、rsync、打包备份数据操作实战

Linux系统crond.rsync.打包备份数据操作实战 前面介绍了系统中定时任务.rsync.打包等各种操作,同时也介绍了实际生产环境中的各类案例,今天我们结合这几种功能做一次实战(备份数据) 一:项目背景 某公司WEB服务器数据非常重要,但是如果硬件出现故障,数据就会丢失,人工备份比较费时费力,因些需要进行相关自动备份,并且要备份至指定的备份服务器上 具体备份内容有: 1.网站站点所有目录及相关文件 2.系统相关的配置文件 3.网站的访问日志文件 具体要求如下:(每天0点备份) 1.WEB

Windows使用robocopy、forfiles备份数据

事件描述: 2016.11.14一早,禅道(bug管理系统)启动不了了.经过一天各种折腾都不能正常启动服务,找到数据库目录和备份目录,都是空的.这是服务器在祝我31岁生日快乐吗,不带这么玩的. 下图为正常状态 下图为启动失败状态 自身存在的问题: 由于心里一直没把禅道放在心上,服务器的备份策略从来没有检查过.也没做过"灾难恢复"的测试.以至于出了问题后才想着去了解这个系统,看官方文档,找数据库目录等. 到现在为止也不知道系统是为什么挂的,挂的同时,数据库文件一点影也没了.只能让测试重新