分类: 服务器与存储
2008-06-14 13:37:31
SQL> create table t_a as select * from tab;
Table created.
SQL> create table t_b as select * from tab where rownum < 1;
Table created.
任务是将T_A表导出的记录导入到T_B表中, 所以我在SYSTEM用户中建了一个同义词.
SQL> create synonym t_a for mydul.t_b;
Synonym created.
接下来的导出和导入命令, 你自已去试试吧.
exp mydul/mydul file=t_a.dmp tables=t_a
imp system/oracle file=t_a.dmp fromuser=mydul touser=system ignore=y
验证一下数据有没有导入进去.
SQL> select count(*) from t_b;
COUNT(*)
----------
17
SQL> select count(*) from t_a;
COUNT(*)
----------
17
的imp导入数据时, 也只不过是运行Insert语句而已, 向同义词和向表, 它分得清吗?