【发布时间】:2009-03-19 07:18:55
【问题描述】:
我有一个.dmp 文件,我想将它导入Oracle 9i。我该怎么做?
【问题讨论】:
我有一个.dmp 文件,我想将它导入Oracle 9i。我该怎么做?
【问题讨论】:
假设您有一个由 oracle exp 创建的 .dmp 文件
imp help=y
将成为你的朋友。它会带你去
imp file=<file>.dmp show=y
查看转储的内容,然后查看类似
imp scott/tiger@example file=<file>.dmp fromuser=<source> touser=<dest>
从一个用户导入到另一个用户。如果它是一个复杂的模式,请做好长期准备,因为您需要预先创建所有引用的模式用户和表空间以使 imp 正常工作
【讨论】:
我正在使用 Oracle Database Express Edition 11g 第 2 版。
按照步骤操作:
打开运行 SQl 命令行
第一步:以系统用户身份登录
SQL> connect system/tiger
第二步:SQL> CREATE USER UserName IDENTIFIED BY Password;
第 3 步:SQL> grant dba to UserName ;
第 4 步:SQL> GRANT UNLIMITED TABLESPACE TO UserName;
第五步:
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;
完成....
我希望你在这里找到正确的解决方案。
谢谢。
【讨论】:
我根据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;
【讨论】:
imp system/system-password@SID file=directory-you-selected\FILE.dmp log=log-dir\oracle_load.log fromuser=infodba touser=infodba commit=Y
【讨论】:
.dmp 文件是使用“exp”命令创建的 oracle 数据库的转储。您可以使用“imp”命令导入它们。
如果你的机器上安装了oracle客户端,你可以执行命令
imp help=y
了解它是如何工作的。从 wich 模式中了解数据导出以及 oracle 版本是什么肯定会有所帮助。
【讨论】: