| 代码如下 | 复制代码 | 
| 
 在imp的帮助中: SHOW just list file contents (N),默认为N。 下面通过实验说明2点: 1.show=y 可以显示dmp文件中创建对象的语句。 2.show=y 就如同oracle说的那样, just list file contents,这里不进行导入操作。 准备实验环境: 1.创建用户,并赋权: SQL> create user testshow identified by a123; User created SQL> grant connect,resource to testshow; Grant succeeded SQL> grant create synonym to testshow  2.创建对象: SQL> create table test (id number,name varchar2(20)); Table created SQL> create synonym emp for scott.emp; Synonym created 3.查看对象是否创建成功: SQL> select count(*) from emp;  开始实验: 1.导出testshow用户的所有对象: C:Usersyafeishi>exp system/dang file=testshow.dmp  compress=n owner=testshow  2.删除testshow下的test表和emp同名: SQL> drop table test; Table dropped SQL> select * from test; select * from test  | 
	  |
ORA-00942: 表或视图不存在
| 代码如下 | 复制代码 | 
| 
 SQL> drop synonym emp; Synonym dropped SQL> select count(*) from emp; select count(*) from emp ORA-00942: 表或视图不存在 3.show=y 进行导入操作  | 
	  |
C:Usersyafeishi>imp system/dang file=testshow.dmp log=testshow.log show=y from 
user=testshow touser=testshow 
Import: Release 10.2.0.3.0 - Production on 星期一 8月 27 13:20:45 2012 
Copyright (c) 1982, 2005, Oracle.  All rights reserved. 
连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production 
With the Partitioning, OLAP and Data Mining options 
经由常规路径由 EXPORT:V10.02.01 创建的导出文件 
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入 
. 正在将 TESTSHOW 的对象导入到 TESTSHOW
| 代码如下 | 复制代码 | 
| "BEGIN  "  "sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT('USERENV','" "CURRENT_SCHEMA'), export_db_name=>'ORCL.REGRESS.RDBMS.DEV.US.ORACLE.COM', i" "nst_scn=>'11274324817182');" "COMMIT; END;" "ALTER SESSION SET CURRENT_SCHEMA= "TESTSHOW"" "CREATE TABLE "TEST" ("ID" NUMBER, "NAME" VARCHAR2(20)) PCTFREE 10 PCTUSED " "40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUP" "S 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS" . . 正在跳过表 "TEST" "ALTER SESSION SET CURRENT_SCHEMA= "TESTSHOW"" "CREATE SYNONYM "EMP" FOR "SCOTT"."EMP""  | 
	  |
成功终止导入, 没有出现警告。
可以看到日志打出了创建对象的语句,证明了第一点。
再查看库中对象是否导入:
| 代码如下 | 复制代码 | 
| 
 SQL> select * from test; select * from test  | 
	  |
ORA-00942: 表或视图不存在
| 代码如下 | 复制代码 | 
| 
 SQL> select count(*) from emp; select count(*) from emp  | 
	  |
ORA-00942: 表或视图不存在
看到对象并没有导入,证明了第二点。
4.show=n 导入
| 代码如下 | 复制代码 | 
| C:Usersyafeishi>imp system/dang file=testshow.dmp log=testshow.log show=n igno  re=y fromuser=testshow touser=testshow Import: Release 10.2.0.3.0 - Production on 星期一 8月 27 13:21:35 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. 连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production With the Partitioning, OLAP and Data Mining options  | 
	  |
经由常规路径由 EXPORT:V10.02.01 创建的导出文件 
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入 
. 正在将 TESTSHOW 的对象导入到 TESTSHOW 
. . 正在导入表                          "TEST"导入了           0 行 
成功终止导入, 没有出现警告。
| 代码如下 | 复制代码 | 
| 
 SQL> select * from test; ID NAME ---------- -------------------- SQL> select count(*) from emp; COUNT(*) ---------- 16 对象也导入进来了。 ---EOF  | 
	  |