任务:将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 ~]$
将一个用户全的数据全部导入到另一个用户
最新推荐文章于 2024-05-27 22:58:34 发布