如何使用 Oracle PL/SQL Developer 创建转储?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/852261/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 01:50:51  来源:igfitidea点击:

How to create a dump with Oracle PL/SQL Developer?

oracleplsqldeveloper

提问by Guy

I need to take dump of a user (including tables, procedures ,etc.) as FILENAME.dmp.

我需要将用户(包括表、过程等)转储为FILENAME.dmp.

If I create a new user and import that FILENAME.dmp, then everything should be created.

如果我创建一个新用户并导入它FILENAME.dmp,那么一切都应该被创建。

How can I create this dump file?

如何创建此转储文件?

Don't tel me to use the Run > EXPor Run > IMPfunctions because, due to some problem, that feature is not working for me.

不要告诉我使用Run > EXPRun > IMP功能,因为由于某些问题,该功能对我不起作用。

回答by Guy

EXP (export) and IMP (import) are the two tools you need. It's is better to try to run these on the command line and on the same machine.

EXP(导出)和 IMP(导入)是您需要的两个工具。最好尝试在命令行和同一台机器上运行这些。

It can be run from remote, you just need to setup you TNSNAMES.ORAcorrectly and install all the developer tools with the same version as the database. Without knowing the error message you are experiencing then I can't help you to get exp/imp to work.

它可以从远程运行,您只需要TNSNAMES.ORA正确设置并安装与数据库版本相同的所有开发人员工具。在不知道您遇到的错误消息的情况下,我无法帮助您使 exp/imp 工作。

The command to export a single user:

导出单个用户的命令:

exp userid=dba/dbapassword OWNER=username DIRECT=Y FILE=filename.dmp

This will create the export dump file.

这将创建导出转储文件。

To import the dump file into a different user schema, first create the newuser in SQLPLUS:

要将转储文件导入不同的用户模式,首先在SQLPLUS 中创建新用户:

SQL> create user newuser identified by 'password' quota unlimited users;

Then import the data:

然后导入数据:

imp userid=dba/dbapassword FILE=filename.dmp FROMUSER=username TOUSER=newusername

If there is a lot of data then investigate increasing the BUFFERSor look into expdp/impdp

如果有大量数据,则调查增加BUFFERS或查看 expdp/impdp

Most common errors for exp and imp are setup. Check your PATHincludes $ORACLE_HOME/bin, check $ORACLE_HOMEis set correctly and check $ORACLE_SIDis set

exp 和 imp 最常见的错误是设置。检查您的PATH包含$ORACLE_HOME/bin,检查$ORACLE_HOME设置正确并$ORACLE_SID设置检查

回答by Simon

Just to keep this up to date:

只是为了保持最新状态:

The current version of SQLDeveloper has an export tool (Tools > Database Export) that will allow you to dump a schema to a file, with filters for object types, object names, table data etc.

当前版本的 SQLDeveloper 有一个导出工具 ( Tools > Database Export),它允许您将模式转储到文件中,并带有对象类型、对象名称、表数据等的过滤器。

It's a fair amount easier to set-up and use than expand impif you're used to working in a GUI environment, but not as versatile if you need to use it for scripting anything.

这是一个相当容易设置和使用比expimp,如果你已经习惯了在GUI环境中工作,但不能作为通用的,如果你需要使用它的脚本什么。

回答by sayannayas

Just as an update this can be done by using Toad 9 also.Goto Database>Export>Data Pump Export wizard.At the desitination directory window if you dont find any directory in the dropdown,then you probably have to create a directory object.

就像更新一样,这也可以通过使用 Toad 9 来完成。转到数据库>导出>数据泵导出向导。在目标目录窗口中,如果您在下拉列表中没有找到任何目录,那么您可能必须创建一个目录对象。

CREATE OR REPLACE DIRECTORY data_pmp_dir_test AS '/u01/app/oracle/oradata/pmp_dir_test'; 

See this for an example.

请参阅此示例

回答by Babar Siddique

There are some easy steps to make Dump fileof your Tables,Users and Procedures:

有一些简单的步骤,使转储文件你的表格,用户和程序:

Goto sqlplus or any sql*plus connect by your username or password

转到 sqlplus 或任何 sql*plus connect by your username or password

  1. Now type host it looks like SQL>host.
  2. Now type "exp" means export.
  3. It ask u for username and password give the username and password of that user of which you want to make a dump file.
  4. Now press Enter.
  5. Now option blinks for Export file: EXPDAT.DMP>_ (Give a path and file name to where you want to make a dump file e.g e:\FILENAME.dmp) and the press enter
  6. Select the option "Entire Database" or "Tables" or "Users" then press Enter
  7. Again press Enter 2 more times table data and compress extent
  8. Enter the name of table like i want to make dmp file of table student existing so type student and press Enter
  9. Enter to quit now your file at your given path is dump file now import that dmp file to get all the table data.
  1. 现在输入主机,它看起来像 SQL>host。
  2. 现在输入“exp”表示导出。
  3. 它要求您提供用户名和密码,并提供您要制作转储文件的用户的用户名和密码。
  4. 现在按 Enter。
  5. 现在导出文件的选项会闪烁:EXPDAT.DMP>_(为您要制作转储文件的位置提供路径和文件名,例如 e:\FILENAME.dmp),然后按 Enter
  6. 选择“整个数据库”或“表”或“用户”选项,然后按 Enter
  7. 再次按 Enter 2 次表数据并压缩范围
  8. 输入表的名称,就像我想让表学生的 dmp 文件存在一样,所以输入 student 并按 Enter
  9. 输入现在退出给定路径下的文件是转储文件,现在导入该 dmp 文件以获取所有表数据。

回答by Matthew Watson

Export (or datapump if you have 10g/11g) is the way to do it. Why not ask how to fix your problems with that rather than trying to find another way to do it?

导出(或数据泵,如果您有 10g/11g)是这样做的方法。为什么不问问如何解决您的问题,而不是尝试找到另一种方法来解决这个问题?