今天有一個dmp文件,要導入到新庫中,進行了一次的操作。
[oracle@a2 u01]$ imp bj/bj file=/u01/bj.dmp fromuser=bj touser=tt log=/u01/imp.log
Import: Release 11.1.0.6.0 - Production on Mon Nov 7 16:07:02 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.01.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses UTF8 character set (possible charset conversion)
Import terminated successfully without warnings.
[oracle@a2 u01]$ imp bj/bj file=/u01/bj.dmp log=/u01/imp.log
Import: Release 11.1.0.6.0 - Production on Mon Nov 7 16:08:20 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.01.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses UTF8 character set (possible charset conversion)
IMP-00031: Must specify FULL=Y or provide FROMUSER/TOUSER or TABLES arguments
IMP-00000: Import terminated unsuccessfully
[oracle@a2 u01]$ imp bj/bj file=/u01/bj.dmp full=y log=/u01/imp.log
Import: Release 11.1.0.6.0 - Production on Mon Nov 7 16:10:07 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.01.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses UTF8 character set (possible charset conversion)
. importing BJ's objects into BJ
成功
[oracle@a2 u01]$ imp bj/bj file=/u01/bj.dmp fromuser=bj touser=bs log=/u01/imp.log
Import: Release 11.1.0.6.0 - Production on Mon Nov 7 16:13:39 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.01.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8MSWIN1252 character set (possible charset conversion)
export client uses UTF8 character set (possible charset conversion)
. . importing table "bj" 2 rows imported
成功
總結如下,如果不知道是採用什麼用戶導出的,那麼使用full=y,如果知道是什麼用戶導出的,就可以使用fromuser和 touser 指定。