DM7使用脱机工具dmbackup进行数据库备份

使用脱机工具dmbackup进行数据库备份,语法如下:

DMBACKUP KEYWORD=value

确认DM数据库服务器已停止后,在Windows“命令提示符”窗口中输入带参数的DMBACKUP命令启动该工具,参数说明见下表。

[dmdba@shard1 dmdbms]$ dmbackup help
Format:  ./dmbackup  KEYWORD=value

Example: ./dmbackup  INI_PATH=/opt/dm7data/dameng/dm.ini NAME=test.bak

Imperative Argument: INI_PATH NAME

Keyword             explain(default value)
--------------------------------------------------------------------------------
INI_PATH            the path of dmserver's dm.ini file
BASE_BAK_DIR        the path with increment backup Format (dir1,dir2,dir3,...)
NAME                backup name
TYPE                backup type (FULL, INCREMENT), Default(FULL)
BAKFILE_PATH        the file path of backup file
DESCRIBE            the description of backup
MAXSIZE             the max value capability of the single backup file Default(33MB~2048MB, default(2048))
ENCRYPT             encrypt type (0, 1, 2), Default(0)
PASSWORD            encrypt key
ENCRYPT_NAME        encrypt algorithm name
COMPRESS            compress level(0-9), 0:no compress, 9:high compress, Default(1)
PARALLEL            parallel mapping the file path
SHOW_BAK_INFO       the directory of backup Format (dir1,dir2,dir3,...)
HELP                output help info

INI_PATH:配置文件路径,最大长度为256字节,若未设置SHOW_BAK_INFO参数,则为必选参数
NAME:备份名,最大长度为128字节,若未设置SHOW_BAK_INFO参数,则为必选参数
BAKFILE_PATH:备份文件路径,可选参数
TYPE:备份类型,默认为完全备份,FULL 表示完全备份,INCREMENT表示增量备份,可选参数
BASE_BAK_DIR:增量备份时的指定基备份目录,可选参数,仅对增量备份有效
DESCRIBE:备份文件描述,即备注信息,注意:描述如果含有空格,需要用双引号括起来,否则会报错,可选参数
MAXSIZE:备份文件最大大小,取值范围为:33-2048,单位为M(兆),默认为2048,可选参数
ENCRYPT:加密类型,0表示不加密,1表示简单加密,2表示复杂加密,可选参数
PASSWORD:加密密码,长度最大为128字节,如果选择不加密,此处不必指定,可选参数
ENCRYPT_NAME:加密算法,可通过查看动态视图v$CIPHERS获取加密算法信息。不支持xxx_cbc和xxx_ecb算法。可选参数
COMPRESS:指定备份为压缩,如果不选择,则表示不压缩,可选参数
PARALLEL:指定并行备份映射文件完整路径,如: E:\bak.parallel。可选参数
SHOW_BAK_INFO:指定备份存放的目录,可以指定1~16个,可选参数
HELP:打印帮助信息
例1,对名为jydm数据库执行一个完全备份。

[dmdba@shard1 backup]$ dmbackup type=full ini_path=/dm_home/dmdba/dmdbms/data/jydm/dm.ini name=jydm
backup V7.1.6.46-Build(2018.02.08-89107)ENT
file dm.key not found, use default license!
start backup tablespace: SYSTEM.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/SYSTEM.DBF, pages: 2944
end backup file: /dm_home/dmdba/dmdbms/data/jydm/SYSTEM.DBF
end backup tablespace: SYSTEM.

start backup tablespace: ROLL.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/ROLL.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/ROLL.DBF
end backup tablespace: ROLL.

start backup tablespace: MAIN.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/MAIN.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/MAIN.DBF
end backup tablespace: MAIN.

start backup tablespace: BOOKSHOP.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/BOOKSHOP.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/BOOKSHOP.DBF
end backup tablespace: BOOKSHOP.

start backup tablespace: DMHR.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/DMHR.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/DMHR.DBF
end backup tablespace: DMHR.

start backup tablespace: USERS.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/users01.dbf, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/users01.dbf
end backup tablespace: USERS.

start backup tablespace: SYSAUX.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/SYSAWR.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/SYSAWR.DBF
end backup tablespace: SYSAUX.

start backup tablespace: FG_PERSON.
start backup file: /dm_home/dmdba/dmdbms/data/jydm/FG_PERSON.DBF, pages: 0
end backup file: /dm_home/dmdba/dmdbms/data/jydm/FG_PERSON.DBF
end backup tablespace: FG_PERSON.

backup fun end time used: 13128.406(ms)
backup successfully!
backup time used: 19512.280(ms)

在没有指定bakfile_path参数指定备份文件目录时,会在默认的备份目录中生成备份文件。

[dmdba@shard1 bak]$ pwd
/dm_home/dmdba/dmdbms/data/jydm/bak
[dmdba@shard1 bak]$ ls -lrt
-rw-r--r-- 1 dmdba dinstall 301989888 7月  11 19:20 DB_jydm_20200711192046000434.bak

Leave a Reply

Your email address will not be published.

Proudly powered by WordPress | Indrajeet by Sus Hill.