如何将 .dmp 文件导入 Oracle?

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

How do I import a .dmp file into Oracle?

oracleimport

提问by kblair

I have a .dmpfile that I would like to import into Oracle 9i. How do I do that?

我有一个.dmp文件要导入到 Oracle 9i 中。我怎么做?

回答by kblair

Presuming you have a .dmp file created by oracle exp then

假设您有一个由 oracle exp 创建的 .dmp 文件,然后

imp help=y

will be your friend. It will lead you to

将是你的朋友。它会引导你到

imp file=<file>.dmp show=y

to see the contents of the dump and then something like

查看转储的内容,然后类似

imp scott/tiger@example file=<file>.dmp fromuser=<source> touser=<dest>

to import from one user to another. Be prepared for a long haul though if it is a complicated schema as you will need to precreate all referenced schema users, and tablespaces to make the imp work correctly

从一个用户导入到另一个用户。如果它是一个复杂的架构,请做好长期准备,因为您需要预先创建所有引用的架构用户和表空间以使imp 正常工作

回答by Ketul patel

I am Using Oracle Database Express Edition 11g Release 2.

我使用的是 Oracle 数据库快捷版 11g 第 2 版。

Follow the Steps:

按照步骤:

Open run SQl Command Line

打开运行 SQL 命令行

Step 1: Login as system user

第一步:以系统用户登录

       SQL> connect system/tiger

Step 2 : SQL> CREATE USER UserName IDENTIFIED BY Password;

第2步 : SQL> CREATE USER UserName IDENTIFIED BY Password;

Step 3 : SQL> grant dba to UserName ;

第 3 步: SQL> grant dba to UserName ;

Step 4 : SQL> GRANT UNLIMITED TABLESPACE TO UserName;

第四步 : SQL> GRANT UNLIMITED TABLESPACE TO UserName;

Step 5:

第 5 步:

        SQL> CREATE BIGFILE TABLESPACE TSD_UserName
             DATAFILE 'tbs_perm_03.dat'
             SIZE 8G
             AUTOEXTEND ON;

Open Command Prompt in Windows or Terminal in Ubuntu. Then Type:

在 Windows 中打开命令提示符或在 Ubuntu 中打开终端。然后输入:

Note : if you Use Ubuntu then replace " \" to " /" in path.

注意:如果您使用 Ubuntu,请将路径中的“\”替换为“/”。

Step 6: C:\> imp UserName/password@localhost file=D:\abc\xyz.dmp log=D:\abc\abc_1.log full=y;

第 6 步: C:\> imp UserName/password@localhost file=D:\abc\xyz.dmp log=D:\abc\abc_1.log full=y;

Done....

完毕....

I hope you Find Right solution here.

我希望你在这里找到正确的解决方案。

Thanks.

谢谢。

回答by ankit

i got solution what you are getting as per imp help=yit is mentioned that imp is only valid for TRANSPORT_TABLESPACEas below:

我得到了您所得到的解决方案,imp help=y其中提到 imp 仅适用于TRANSPORT_TABLESPACE以下情况:

Keyword  Description (Default)       Keyword      Description (Default)
--------------------------------------------------------------------------
USERID   username/password           FULL         import entire file (N)
BUFFER   size of data buffer         FROMUSER     list of owner usernames
FILE     input files (EXPDAT.DMP)    TOUSER       list of usernames
SHOW     just list file contents (N) TABLES       list of table names
IGNORE   ignore create errors (N)    RECORDLENGTH length of IO record
GRANTS   import grants (Y)           INCTYPE      incremental import type
INDEXES  import indexes (Y)          COMMIT       commit array insert (N)
ROWS     import data rows (Y)        PARFILE      parameter filename
LOG      log file of screen output   CONSTRAINTS  import constraints (Y)
DESTROY                overwrite tablespace data file (N)
INDEXFILE              write table/index info to specified file
SKIP_UNUSABLE_INDEXES  skip maintenance of unusable indexes (N)
FEEDBACK               display progress every x rows(0)
TOID_NOVALIDATE        skip validation of specified type ids
FILESIZE               maximum size of each dump file
STATISTICS             import precomputed statistics (always)
RESUMABLE              suspend when a space related error is encountered(N)
RESUMABLE_NAME         text string used to identify resumable statement
RESUMABLE_TIMEOUT      wait time for RESUMABLE
COMPILE                compile procedures, packages, and functions (Y)
STREAMS_CONFIGURATION  import streams general metadata (Y)
STREAMS_INSTANTIATION  import streams instantiation metadata (N)
DATA_ONLY              import only data (N)

The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE import transportable tablespace metadata (N)
TABLESPACES tablespaces to be transported into database
DATAFILES datafiles to be transported into database
TTS_OWNERS users that own data in the transportable tablespace set

So, Please create table space for your user:

因此,请为您的用户创建表空间:

CREATE TABLESPACE <tablespace name> DATAFILE <path to save, example: 'C:\ORACLEXE\APP\ORACLE\ORADATA\XE\ABC.dbf'> SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 10G EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;

回答by deepak gupta

imp system/system-password@SID file=directory-you-selected\FILE.dmp log=log-dir\oracle_load.log fromuser=infodba touser=infodba commit=Y

回答by Hank Gay

Hereyou can find some tips on how to use the imp command.

在这里您可以找到有关如何使用 imp 命令的一些提示。

回答by Alex

.dmp files are dumps of oracle databases created with the "exp" command. You can import them using the "imp" command.

.dmp 文件是使用“exp”命令创建的 oracle 数据库的转储。您可以使用“imp”命令导入它们。

If you have an oracle client intalled on your machine, you can executed the command

如果您的机器上安装了 oracle 客户端,则可以执行以下命令

imp help=y

小鬼帮助=y

to find out how it works. What will definitely help is knowing from wich schema the data was exported and what the oracle version was.

找出它是如何工作的。从哪个模式导出数据以及oracle版本是什么,肯定会有所帮助。