简体   繁体   English

如何将 a.dmp 文件导入 Oracle?

[英]How do I import a .dmp file into Oracle?

I have a .dmp file that I would like to import into Oracle 9i.我有一个.dmp文件,我想将其导入 Oracle 9i。 How do I do that?我怎么做?

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 正常工作

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;第 4 步: 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.打开 Windows 中的命令提示符或 Ubuntu 中的终端。 Then Type:然后键入:

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;第六步: 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.谢谢。

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

i got solution what you are getting as per imp help=y it is mentioned that imp is only valid for TRANSPORT_TABLESPACE as 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;

Here you can find some tips on how to use the imp command.在这里,您可以找到有关如何使用 imp 命令的一些提示。

.dmp files are dumps of oracle databases created with the "exp" command. .dmp 文件是使用“exp”命令创建的 oracle 数据库的转储。 You can import them using the "imp" command.您可以使用“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 版本是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM