Home Database Mysql Tutorial 达梦(4)脱机备份恢复

达梦(4)脱机备份恢复

Jun 07, 2016 pm 03:23 PM
backup recover Simple Offline

达梦的脱机备份按理说应当很简单,可事实是消耗了我大把的时间。唉。 国产的软件公司是不是都很缺钱,缺人? 没人更新文档或在论坛上之类做些例子,不做好推广,没人用怎么做得起市场来? 不过唯一值得称道的是他们的客户QQ群还是很给力的。我周日弄的,遇到

达梦的脱机备份按理说应当很简单,可事实是消耗了我大把的时间。唉。 国产的软件公司是不是都很缺钱,缺人?
没人更新文档或在论坛上之类做些例子,不做好推广,没人用怎么做得起市场来?
不过唯一值得称道的是他们的客户QQ群还是很给力的。我周日弄的,遇到问题提了下问题,马上有人回答。

其实达梦脱机备份设计的很简单,在文档>这份pdf档的275页。它举了个例子.
DMBACKUP TYPE=FULL INI_PATH=c:\dmdata\dameng\dm.ini NAME=test

你按它说的步骤,
1.停掉服务,
Windows下: DM服务查看器 -> 停掉对应实例服务就行了
Linux下: 停掉./dmserver 就行了。


2.执行备份
DMBACKUP INI_PATH=C:\dmdbms\data\DAMENG\dm.ini NAME=DMSERVER
第一次可以成功,
但第二次执行就会报错。 你重启服务,再停掉再试,也会一样。
原因是参数"NAME"实际上相当于Oracle RMAN中的备份集名称。达梦数据库把这个当作
一个备份集的唯一标识。所以当你第二次执行时,数据库会认为这个备份名已存在。
而我误认为这个name是数据库名字。
好吧,我承认是我理解有误,但第二个问题就不关我事了。


我尝试用"BAKFILE_PATH"参数,将备份放到指定的一个文件中。
命令如下:
DMBACKUP INI_PATH=C:\dmdbms\data\DAMENG\dm.ini NAME=DMSERVER8 BAKFILE_PATH='c:\dmtest\xcl.bak';


结果老是报"-8018"错误
C:\dmdbms\bin>DMBACKUP INI_PATH=C:\dmdbms\data\DAMENG\dm.ini NAME=DMSERVER8 BAKFILE_PATH='c:\dmtest\xcl.bak';
backup V7.1.2.215-Build(2013.11.08-36626trunc)
Global parameter value of HA_OTHER_INST_PORT is illegal, use max value!
无效的备份路径名, backup error code : -8018
backup time used: 2967.504(ms)


解决方法是:
将NAME参数放在BAKFILE_PATH后面
C:\dmdbms\bin\dmbackup.exe INI_PATH=C:\dmdbms\data\DAMENG\dm.ini BAKFILE_PATH=C:\dmtest\xcl.bak NAME=DMSERVER8
这个问题因为我一直在怀疑BAKFILE_PATH参数是不是输入得不对,尝试了很多种方法。文档和网上也没查到相关的说明。最后还是达梦客户群
的人解答的。据说是因为代码更新很快,定制化也多,做不来过,所以文档更新不即时造成的。虽无语,不过也感觉到国产数据库日子过得不错啊。单子这

么多,据说已卖到国外了。

 

		C:\Users\XCL>C:\dmdbms\bin\dmbackup.exe INI_PATH=C:\dmdbms\data\DAMENG\dm.ini BAKFILE_PATH=C:\dmtest\xcl.bak NAME=DMSERVER8
		backup V7.1.2.215-Build(2013.11.08-36626trunc)
		Global parameter value of HA_OTHER_INST_PORT is illegal, use max value!
		start backup tablespace: SYSTEM.
		start backup file: C:\dmdbms\data\DAMENG\SYSTEM.DBF, pages: 1280
		end backup file: C:\dmdbms\data\DAMENG\SYSTEM.DBF

		end backup tablespace: SYSTEM.

		start backup tablespace: ROLL.
		start backup file: C:\dmdbms\data\DAMENG\ROLL.DBF, pages: 0
		end backup file: C:\dmdbms\data\DAMENG\ROLL.DBF

		end backup tablespace: ROLL.

		start backup tablespace: MAIN.
		start backup file: C:\dmdbms\data\DAMENG\MAIN.DBF, pages: 0
		end backup file: C:\dmdbms\data\DAMENG\MAIN.DBF

		end backup tablespace: MAIN.

		start backup tablespace: BOOKSHOP.
		start backup file: C:\dmdbms\data\DAMENG\BOOKSHOP.DBF, pages: 0
		end backup file: C:\dmdbms\data\DAMENG\BOOKSHOP.DBF

		end backup tablespace: BOOKSHOP.

		backup fun end time used: 1928.889(ms)
		backup successfully!
		backup time used: 3797.014(ms)

		C:\Users\XCL>
Copy after login

恢复

首先看参数:


C:\Users\XCL>C:\dmdbms\bin\dmrestore.exe help
格式: DMRESTORE KEYWORD=value 或 KEYWORD=(value1,value2,...,valueN)


例程: DMRESTORE INI_PATH=c:\dm7data\dameng\dm.ini FILE=c:\dm7data\backup\test.bak


必选参数: FILE


关键字 说明(默认)
--------------------------------------------------------------------------------
INI_PATH 服务器的ini文件路径
FILE 备份文件
MAPPED_FIL 当指定res_type为4时,输出备份文件的映射信息到该文件
TIME 恢复到的时间点
ARCHIVE_DIR 备份时的归档目录 格式 (dir1,dir2,dir3,...)
BACKUP_DIR 备份文件存放路径,用于搜索备份文件 格式 (dir1,dir2,dir3,...)
DATAFIL_PATH 恢复时指定文件路径 (id1,path1,id2,path2,id3,path3,...)
MIRROR_PATH 恢复时指定镜像文件路径 (id1,path1,id2,path2,id3,path3,...)
PARALLEL_DIR 并行映射文件所在的完整目录名
RES_TYPE 还原类型(0,1,2,3,4) 0:备份文件还原,1:备份文件显示,2:归档文件还原,3:单步增量还原,4:输出备份映射文件。
END_LSN 还原到指定的LSN
LOG 还原的日志输出文件
HELP 打印帮助信息

然后,发现要保留下面文件,然后运行恢复命令才能恢复出来,否则老是提示少文件,这个和Oracle之类还真不一样。
就是说能删的只有 BOOKSHOP.DBF DAMENG目录 trace目录 arch目录
这有啥用?

删得只剩下这些文件,少一个恢复时都会报错,文档没解释,真不解

C:\dmdbms\data\DAMENG>dir
 驱动器 C 中的卷是 OS
 卷的序列号是 C8C0-48C4

 C:\dmdbms\data\DAMENG 的目录

2014/01/07  16:43    <DIR>          .
2014/01/07  16:43    <DIR>          ..
2014/01/07  16:01        67,108,864 DAMENG01.log
2014/01/07  16:01        67,108,864 DAMENG02.log
2014/01/03  10:51             5,632 dm.ctl
2014/01/03  15:02            22,214 dm.ini
2014/01/04  10:48               127 dmarch.ini
2014/01/03  10:50               633 dm_service.prikey
2014/01/07  16:01        10,485,760 SYSTEM.DBF
               7 个文件    144,732,094 字节
               2 个目录 65,555,996,672 可用字节
Copy after login

执行恢复

C:\dmdbms\data\DAMENG>C:\dmdbms\bin\dmrestore.exe  INI_PATH=C:\dmdbms\data\DAMENG\dm.ini  file=C:\dmtest\dmcold.bak
restore V7.1.2.215-Build(2013.11.08-36626trunc)
Global parameter value of HA_OTHER_INST_PORT is illegal, use max value!

backup DMSERVER10 info:
backup sig:            BA
backup tool version:   12595
backup db name:        DAMENG
backup db magic:       1388717456
backup name:           DMSERVER10
backup type:           full
backup level:          offline
backup range:          database
backup description:
compressed level:      0
rac node:              0
page check:            0
length in char:        0
backup time:           2014-01-07 14:34:20
page size:             8 KB
extent size:           16
case sensitive:        1
log page size:         512 B
unicode flag:          0
data version:          0x70008
sys version:           V7.1.2.215-Build(2013.11.08-36626trunc)
enable policy:         0
parallel type:         0
parallel info len:     0
backup db fil num:     4
archive flag:          1
after backup LSN:      25337

file_seq   file_path                                                size(KB)
1          C:\dmtest\dmcold.bak                                     16384

file_seq   file_path                         mirror_path
1          C:\dmdbms\data\DAMENG\SYSTEM.DBF
2          C:\dmdbms\data\DAMENG\ROLL.DBF
3          C:\dmdbms\data\DAMENG\MAIN.DBF
4          C:\dmdbms\data\DAMENG\BOOKSHOP.DBF

Continue?[Y/N]:y
restore bak_file: C:\dmtest\dmcold.bak ...
start restore database...
start restore file: C:\dmdbms\data\DAMENG\SYSTEM.DBF(SYSTEM), pages: 278
end restore file: C:\dmdbms\data\DAMENG\SYSTEM.DBF(SYSTEM)
start restore file: C:\dmdbms\data\DAMENG\ROLL.DBF(ROLL), pages: 617
end restore file: C:\dmdbms\data\DAMENG\ROLL.DBF(ROLL)
start restore file: C:\dmdbms\data\DAMENG\MAIN.DBF(MAIN), pages: 4
end restore file: C:\dmdbms\data\DAMENG\MAIN.DBF(MAIN)
start restore file: C:\dmdbms\data\DAMENG\BOOKSHOP.DBF(BOOKSHOP), pages: 133
end restore file: C:\dmdbms\data\DAMENG\BOOKSHOP.DBF(BOOKSHOP)
end restore database data files.

restore finished, code = 0!

restore successfully!
restore time used: 3654.514(ms)               
Copy after login
恢复成功后
C:\dmdbms\data\DAMENG>dir
 驱动器 C 中的卷是 OS
 卷的序列号是 C8C0-48C4

 C:\dmdbms\data\DAMENG 的目录

2014/01/07  16:44    <DIR>          .
2014/01/07  16:44    <DIR>          ..
2014/01/07  16:44       157,286,400 BOOKSHOP.DBF
2014/01/07  16:44        67,108,864 DAMENG01.log
2014/01/07  16:44        67,108,864 DAMENG02.log
2014/01/07  16:44             5,632 dm.ctl
2014/01/07  16:44            22,214 dm.ini
2014/01/04  10:48               127 dmarch.ini
2014/01/07  16:44               156 dminst.sys
2014/01/07  16:44             2,131 dmrestore.log
2014/01/07  16:44               633 dm_service.prikey
2014/01/07  16:44       134,217,728 MAIN.DBF
2014/01/07  16:44       134,217,728 ROLL.DBF
2014/01/07  16:44        10,485,760 SYSTEM.DBF
2014/01/07  16:44        10,485,760 TEMP.DBF
              13 个文件    580,941,997 字节
               2 个目录 65,117,458,432 可用字节
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to recover expired WeChat files? Can expired WeChat files be recovered? How to recover expired WeChat files? Can expired WeChat files be recovered? Feb 22, 2024 pm 02:46 PM

Open WeChat, select Settings in Me, select General and then select Storage Space, select Management in Storage Space, select the conversation in which you want to restore files and select the exclamation mark icon. Tutorial Applicable Model: iPhone13 System: iOS15.3 Version: WeChat 8.0.24 Analysis 1 First open WeChat and click the Settings option on the My page. 2 Then find and click General Options on the settings page. 3Then click Storage Space on the general page. 4 Next, click Manage on the storage space page. 5Finally, select the conversation in which you want to recover files and click the exclamation mark icon on the right. Supplement: WeChat files generally expire in a few days. If the file received by WeChat has not been clicked, the WeChat system will clear it after 72 hours. If the WeChat file has been viewed,

The easiest way to query the hard drive serial number The easiest way to query the hard drive serial number Feb 26, 2024 pm 02:24 PM

The hard disk serial number is an important identifier of the hard disk and is usually used to uniquely identify the hard disk and identify the hardware. In some cases, we may need to query the hard drive serial number, such as when installing an operating system, finding the correct device driver, or performing hard drive repairs. This article will introduce some simple methods to help you check the hard drive serial number. Method 1: Use Windows Command Prompt to open the command prompt. In Windows system, press Win+R keys, enter "cmd" and press Enter key to open the command

How to recover browsing history in incognito mode How to recover browsing history in incognito mode Feb 19, 2024 pm 04:22 PM

Private browsing is a very convenient way to browse and protect your privacy when surfing the Internet on your computer or mobile device. Private browsing mode usually prevents the browser from recording your visit history, saving cookies and cache files, and preventing the website you are browsing from leaving any traces in the browser. However, for some special cases, we may need to restore the browsing history of Incognito Browsing. First of all, we need to make it clear: the purpose of private browsing mode is to protect privacy and prevent others from obtaining the user’s online history from the browser. Therefore, incognito browsing

How to backup Google Chrome extensions How to backup Google Chrome extensions Jan 30, 2024 pm 12:36 PM

How to backup Google Chrome extension? For most Google Chrome users, more or less plug-ins are installed during daily use. The existence of plug-ins can improve our usage experience. When we reinstall the system or browser, these plug-ins cannot be retained, and it is troublesome to download and install them again. So is there a way to back up the currently installed plug-ins? Here’s how to do it. The tutorial method of backing up chrome plug-ins first opens Google Chrome, click the menu in the upper right corner, and select More Tools - Extensions. Click Package extension above the extensions page. In C:UsersAdministratorAppDataLocalGoogleChromeUserDataDe

How to restore chat spark on TikTok How to restore chat spark on TikTok Mar 16, 2024 pm 01:25 PM

On Douyin, a short video platform full of creativity and vitality, we can not only enjoy a variety of exciting content, but also have in-depth communications with like-minded friends. Among them, chat sparks are an important indicator of the intensity of interaction between the two parties, and they often inadvertently ignite the emotional bonds between us and our friends. However, sometimes due to some reasons, the chat spark may be disconnected. So what should we do if we want to restore the chat spark? This tutorial guide will bring you a detailed introduction to the content strategy, hoping to help everyone. How to restore the spark of Douyin chat? 1. Open the Douyin message page and select a friend to chat. 2. Send messages and chat to each other. 3. If you send messages continuously for 3 days, you can get the spark logo. On a 3-day basis, send pictures or videos to each other

How to restore Xiaomi Cloud photo album to local How to restore Xiaomi Cloud photo album to local Feb 24, 2024 pm 03:28 PM

How to restore Xiaomi Cloud Photo Album to local? You can restore Xiaomi Cloud Photo Album to local in Xiaomi Cloud Photo Album APP, but most friends don’t know how to restore Xiaomi Cloud Photo Album to local. The next step is to restore Xiaomi Cloud Photo Album to local. Local method graphic tutorials, interested users come and take a look! How to restore Xiaomi cloud photo album to local 1. First open the settings function in Xiaomi phone and select [Personal Avatar] on the main interface; 2. Then enter the Xiaomi account interface and click the [Cloud Service] function; 3. Then jump to Xiaomi For the function of cloud service, select [Cloud Backup]; 4. Finally, in the interface as shown below, click [Cloud Album] to restore the album to local.

How to delete startup backup in Windows 11's File Explorer How to delete startup backup in Windows 11's File Explorer Feb 18, 2024 pm 05:40 PM

If you wish to hide the "Start Backup" option in Windows 11's File Explorer, here's what you can do. There are several ways to disable or hide the startup backup option in File Explorer, and we'll briefly list some methods to help you accomplish this task quickly. Before you get started, you need to understand that this option is closely tied to OneDrive. Once you open a library folder (such as Document, Pictures, Music, etc.), it will immediately appear in the file explorer's path. How to delete startup backup in Windows 11’s File Explorer To delete startup backup in Windows 11’s File Explorer, follow the steps below

How to restore default wallpaper in win10 How to restore default wallpaper in win10 Feb 10, 2024 pm 10:51 PM

Windows 10's May 2019 Update features a new, brighter default desktop background. It looks great - with the new light theme. If you use Windows 10’s dark theme, you may want a darker background. Strangely, the original Windows 10 desktop background has been removed from the latest version of Windows 10. You have to download it from the web or copy its files from an old Windows 10 PC. Although we were unable to find this wallpaper image on Microsoft's official website, you can download it from other sources. We found a copy of the original Windows 10 desktop wallpaper in 4K resolution on Imgur. Additionally, there are other sizes and more default walls

See all articles