什么是sql-dump? [英] What is sql-dump for?

查看:826
本文介绍了什么是sql-dump?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道SQL转储是一系列插入SQL语句,它反映数据库中的所有记录。但是它用于什么?为什么要转储数据库记录?每个数据库都支持转储功能?

I know that a SQL dump is a series of insert SQL statements which reflect all the records inside the database. But what is it used for? Why should we dump the database records? Does every database support a dumping function?

推荐答案

有些奇怪的是,这实际上是备份数据库的常用方法。由于各种复杂的原因,复制实际保存数据的文件本身并不是通常的备份方法。

Somewhat strangely, this is actually the usual way to back up a database. Copying the files themselves that actually hold the data is not the usual backup method, for various complicated reasons.

所有数据库都以这种方式工作,至少我从来没有听说过一个没有:它们都有一个工具来导出一堆SQL代码,当执行时,将重建数据库在转储开始时的相同状态。

All databases work this way, or at least I've never heard of one that doesn't: they all have a facility to export a bunch of SQL code that, when executed, will recreate the database in the same state it was in when the dump was started.

然而,由于不同数据库系统使用的SQL的各种方言之间的细微差别,这些各种格式通常是不兼容的。有些实用程序可以在其中一些之间进行转换,但我不知道任何'Rosetta Stone'处理每一种可能的情况。

However these various formats are generally incompatible, due to subtle differences between the various dialects of SQL used by the different database systems. There are utilities that can convert between some of them, but I'm not aware of any 'Rosetta Stone' that handles every possible case.

备份数据库的方法,当在不同服务器之间转移db应用程序的数据时,这种技术也很有用,即从开发到测试到生产。

As well as being the primary method of backing up a database, this technique is also useful when staging the data of db apps between different servers, ie from development to testing to production.

这篇关于什么是sql-dump?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆