我有一个.dmp
文件,我想将其导入Oracle 9i。我该怎么做?
答案 0 :(得分:27)
假设你有一个由oracle exp创建的.dmp文件,那么
imp help=y
将是你的朋友。它会引导你
imp file=<file>.dmp show=y
查看转储的内容,然后查看
之类的内容imp scott/tiger@example file=<file>.dmp fromuser=<source> touser=<dest>
从一个用户导入到另一个用户。如果它是一个复杂的模式,你需要预先创建所有引用的模式用户,并使用表空间来使imp工作正常
答案 1 :(得分:6)
我正在使用Oracle Database Express Edition 11g第2版。
按照步骤:
打开运行SQl命令行
第1步:以系统用户身份登录
SQL> connect system/tiger
第2步:SQL> CREATE USER UserName IDENTIFIED BY Password;
第3步:SQL> grant dba to UserName ;
第4步:SQL> GRANT UNLIMITED TABLESPACE TO UserName;
第5步:
SQL> CREATE BIGFILE TABLESPACE TSD_UserName
DATAFILE 'tbs_perm_03.dat'
SIZE 8G
AUTOEXTEND ON;
在Windows或Ubuntu中的终端中打开命令提示符。然后输入:
注意:如果您使用Ubuntu,请在路径中将“\”替换为“/”。
第6步:C:\> imp UserName/password@localhost file=D:\abc\xyz.dmp log=D:\abc\abc_1.log full=y;
完成....
我希望你在这里找到正确的解决方案。
感谢。
答案 2 :(得分:1)
根据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
所以,请为您的用户创建表空间:
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;
答案 3 :(得分:0)
Here您可以找到有关如何使用imp命令的一些提示。
答案 4 :(得分:0)
imp system/system-password@SID file=directory-you-selected\FILE.dmp log=log-dir\oracle_load.log fromuser=infodba touser=infodba commit=Y
答案 5 :(得分:-1)
.dmp文件是使用“exp”命令创建的oracle数据库的转储。您可以使用“imp”命令导入它们。
如果您的计算机上安装了oracle客户端,则可以执行命令
imp help = y
了解它的工作原理。绝对有帮助的是从数据库中了解数据的导出以及oracle版本是什么。