如何将数据导入不同的表空间 _MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 1710 | 回复: 0   主题: 如何将数据导入不同的表空间         下一篇 
landy
注册用户
等级:新兵
经验:61
发帖:72
精华:0
注册:2011-12-31
状态:离线
发送短消息息给landy 加好友    发送短消息息给landy 发消息
发表于: IP:您无权察看 2015-7-1 11:00:22 | [全部帖] [楼主帖] 楼主

目的:将sfx schema下的所有对象导入到sjh schema下,注意用户sfx,sjh所在的默认表空间不一样。

 

$ exp sfx/sfx file=sfx.dmp

Export: Release 10.2.0.2.0 - Production on Thu Mar 26 16:26:35 2009

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production

With the Partitioning, OLAP and Data Mining options

Export done in US7ASCII character set and AL16UTF16 NCHAR character set

server uses WE8ISO8859P1 character set (possible charset conversion)

. exporting pre-schema procedural objects and actions

. exporting foreign function library names for user SFX

. exporting PUBLIC type synonyms

. exporting private type synonyms

. exporting object type definitions for user SFX

About to export SFX's objects ...

. exporting database links

. exporting sequence numbers

. exporting cluster definitions

. about to export SFX's tables via Conventional Path ...

. . exporting table                             T1          1 rows exported

. exporting synonyms

. exporting views

. exporting stored procedures

. exporting operators

. exporting referential integrity constraints

. exporting triggers

. exporting indextypes

. exporting bitmap, functional and extensible indexes

. exporting posttables actions

. exporting materialized views

. exporting snapshot logs

. exporting job queues

. exporting refresh groups and children

. exporting dimensions

. exporting post-schema procedural objects and actions

. exporting statistics

Export terminated successfully without warnings.

$ imp sjh/sjh file=sfx.dmp fromuser=sfx touser=sjh

Import: Release 10.2.0.2.0 - Production on Thu Mar 26 16:40:52 2009

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.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 SFX, 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                           "T1"          1 rows imported

Import terminated successfully without warnings.

SQL> show user

USER is "SJH"

SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME                     TABLESPACE_NAME

------------------------------ ------------------------------

SJH0                           USERS

T1                             SJHTEST

TEST                           USERS

TEST1                          USERS

SQL> select * from T1;

ID NAME

---------- --------

1 sjh

--表空间还是原来的SJHTEST。达不到我们的目的。

 

对用户SJH做些设置:

 

SQL> grant dba to sjh;

Grant succeeded.

SQL> revoke unlimited tablespace from sjh;

Revoke succeeded.

SQL> alter user sjh quota 0 on SJHTEST;

User altered.

SQL> alter user sjh quota unlimited on USERS;

User altered.

 

重新开始导入:

SQL> drop table T1 purge;

Table dropped.

$ imp sjh/sjh file=sfx.dmp fromuser=sfx touser=sjh

Import: Release 10.2.0.2.0 - Production on Thu Mar 26 16:59:36 2009

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.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 SFX, 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                           "T1"          1 rows imported

Import terminated successfully without warnings.

SQL> select table_name,tablespace_name from user_tables;

TABLE_NAME                     TABLESPACE_NAME

------------------------------ ------------------------------

SJH0                           USERS

T1                             USERS

TEST                           USERS

TEST1                          USERS

SQL> select * from t1;

ID NAME

---------- --------

1 sjh

OK!

--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论