17,377
社区成员
发帖
与我相关
我的任务
分享
-- 刚写了一个,应该就是你的需求
SQL> create user u1 identified by oracle default tablespace users ;
用户已创建。
SQL> create user u2 identified by oracle default tablespace users ;
用户已创建。
SQL> grant connect , resource, dba,select any table to u1 ;
授权成功。
SQL> grant connect , resource, dba,select any table to u2 ;
授权成功。
SQL> conn u1/oracle
已连接。
SQL> create table A1(id int , name varchar(10)) ;
表已创建。
SQL> create table A2(id int , name varchar(10)) ;
表已创建。
SQL> insert into A1 select rownum,'A1' from dual connect by rownum<=5;
已创建5行。
SQL> insert into A2 select rownum,'A2' from dual connect by rownum<=5;
已创建5行。
SQL> conn u2/oracle
已连接。
SQL> create table A(id int,name varchar(10)) ;
表已创建。
SQL> create synonym A1 for A ;
同义词已创建。
SQL> create synonym A2 for A ;
同义词已创建。
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
开
C:\>exp u1/oracle file=c:\u1.dmp
Export: Release 11.2.0.1.0 - Production on 星期三 4月 29 15:50:02 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的用户...
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 U1 的外部函数库名
. 导出 PUBLIC 类型同义词
. 正在导出专用类型同义词
. 正在导出用户 U1 的对象类型定义
即将导出 U1 的对象...
. 正在导出数据库链接
. 正在导出序号
. 正在导出簇定义
. 即将导出 U1 的表通过常规路径...
. . 正在导出表 A1导出了 5 行
. . 正在导出表 A2导出了 5 行
. 正在导出同义词
. 正在导出视图
. 正在导出存储过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计信息
成功终止导出, 没有出现警告。
C:\>imp u2/oracle file=c:\u1.dmp fromuser=u1 touser=u2 ingore=y
LRM-00101: 未知的参数名 'ingore'
IMP-00022: 处理参数失败, 请键入 'IMP HELP=Y' 获取帮助信息
IMP-00000: 未成功终止导入
C:\>imp u2/oracle file=c:\u1.dmp fromuser=u1 touser=u2 ignore=y
Import: Release 11.2.0.1.0 - Production on 星期三 4月 29 15:50:48 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
警告: 这些对象由 U1 导出, 而不是当前用户
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. . 正在导入表 "A1"导入了 5 行
. . 正在导入表 "A2"导入了 5 行
成功终止导入, 没有出现警告。
C:\>sqlplus "u2/oracle"
SQL*Plus: Release 11.2.0.1.0 Production on 星期三 4月 29 15:50:57 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from A ;
ID NAME
---------- ----------
1 A1
2 A1
3 A1
4 A1
5 A1
1 A2
2 A2
3 A2
4 A2
5 A2
已选择10行。
SQL>