将一个用户全的数据全部导入到另一个用户

 

任务:将SCOTT用户的数据(表,视图,过程,触发器……)全部导入到新用户PRODUCT

1.新建用户PRODUCT
(1).为新用户PRODUCT建立表空间PRODUCT
SQL>create tablespace product datafile '/DBSoftware/app/oracle/oradata/orcl/product01.dbf' size 50M;
(2).新建用户PRODUCT并为其分配20的表空间份额
SQL>create uesr product default tablespace product quota 20M on tablespace product;
2.为SCOTT,PRODUCT用户赋导入导出的权限
SQL>grant connect,resource,imp_full_database,exp_full_database to scott,product;
3.导出SCOTT用户的数据
[oracle@localhost ~]$exp scott/sky file=scott.dmp owner=scott log=scott.log
4.导入到PRODUCT用户
[oracle@localhost ~]$imp product/g596878 file=scott.dmp fromuser=scott touser=product log=scott.log ignore=y
Import: Release 10.2.0.1.0 - Production on Sun Oct 31 10:39:38 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. . importing table "BONUS" 0 rows imported
. . importing table "DEPT" 4 rows imported
. . importing table "DIRECT" 11 rows imported
. . importing table "DIRECT1" 11 rows imported
. . importing table "EMP" 14 rows imported
. . importing table "SALGRADE" 5 rows imported
. . importing table "T" 600 rows imported
. . importing table "TEMP" 0 rows imported
. . importing table "TEST" 10 rows imported
. . importing table "TREE" 10 rows imported
About to enable constraints...
Import terminated successfully without warnings.

[oracle@localhost ~]$

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值