如何使用 exp 命令导出包含不同磁盘位置文件的 Oracle DB
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3624387/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to use exp command to export Oracle DB with files in different disk location
提问by loviji
we get problem, while trying to export Oracle DB. OS:CentOS ~ 5.2 DB:Oracle 10g.
我们在尝试导出 Oracle DB 时遇到问题。操作系统:CentOS ~ 5.2数据库:Oracle 10g。
Exp
command exports db files only in location:
Exp
命令仅在以下位置导出 db 文件:
/home/oracle/OraHome_1/oradata/master/xxx.dbf
/home/oracle/OraHome_1/oradata/master/xxx.dbf
, but tool can't export files in different location (we know about this files after getting trace) like this:
,但工具不能像这样导出不同位置的文件(我们在获取跟踪后知道这个文件):
'/disk1/dblog06.dbf', '/home/disk2/system01.dbf',
'/disk1/dblog06.dbf', '/home/disk2/system01.dbf',
Please, advice me, how to get dumpfile. or buckup it.
请给我建议,如何获取转储文件。或收拾它。
Thanks.
谢谢。
回答by Thilo
I am not sure if that is the question, but the exp
command will export database objects according to their logical schema (user name, table name). It does not matter which physical database file the data is coming from.
我不确定这是否是问题,但该exp
命令将根据其逻辑模式(用户名、表名)导出数据库对象。数据来自哪个物理数据库文件并不重要。
exp
works through an Oracle instance, which needs to have mounted the datafiles.
exp
通过 Oracle 实例工作,该实例需要安装数据文件。
Are these other files part of the Oracle database? Maybe another database? You need to find out which Oracle server uses them, and then run exp
against that instance.
这些其他文件是 Oracle 数据库的一部分吗?也许另一个数据库?您需要找出哪个 Oracle 服务器使用它们,然后exp
针对该实例运行。
回答by APC
EXPORT is not a backup tool. It is meant for transferring data from one database to another, or perhaps from one schema to another.
EXPORT 不是备份工具。它用于将数据从一个数据库传输到另一个数据库,或者从一个模式传输到另一个模式。
If you want to recover your data in the event of a database crash or corruption then you need to use the appropriate tool. There are OS solutions to this, but Oracle comes with a sophisticated backup and recovery tool: RMAN. Find out more.
如果您想在发生数据库崩溃或损坏的情况下恢复数据,则需要使用适当的工具。对此有操作系统解决方案,但 Oracle 附带了一个复杂的备份和恢复工具:RMAN。 了解更多。
回答by Alex Poole
You appear to have misunderstood what exp
does, and particularly what the file
parameter is for. The file
is the output dump file, normally given a .dmp
extension. Export takes data out of the database instance, it does not work under the hood on the datafiles - you have to tell it which data you want (full, user, tables, or tablespaces) and where to put it, not where it comes from.
您似乎误解了什么exp
,特别是file
参数的用途。该file
是输出转储文件,通常给予.dmp
延长。导出从数据库实例中取出数据,它在数据文件的幕后工作 - 您必须告诉它您想要哪些数据(完整、用户、表或表空间)以及将数据放在哪里,而不是从哪里来.
If you really did try to exp file=/home/disk2/system01.dbf
then what you actually asked it to do was trash your database; you're lucky that it did not overwrite the datafile and cause a catastrophic failure. Oracle seems to have saved you from yourself there, though possibly only thanks to having exclusive locks on the files at the time.
如果你真的尝试过,exp file=/home/disk2/system01.dbf
那么你实际上要求它做的是破坏你的数据库;您很幸运,它没有覆盖数据文件并导致灾难性故障。Oracle 似乎已经将您从那里救了出来,尽管可能只是因为当时对文件具有排他锁。
You need to read up on how it works and see if it actually does what you want - as APC notes it's not a backup tool. Looks at the Oracle documentation for your version, or somewhere like http://www.orafaq.com/wiki/Import_Export_FAQ, and also look at using data pump instead of exp
.
您需要仔细阅读它的工作原理,看看它是否真的能满足您的需求——正如 APC 指出的那样,它不是一个备份工具。查看适用于您的版本的 Oracle 文档,或类似http://www.orafaq.com/wiki/Import_Export_FAQ 的地方,并查看使用数据泵而不是exp
.