你用exp命令把数据从第一个表空间的用户的数据导出来后,再用imp命令导入到第二个表空间的第二个用户
解决方案 »
- 存储过程的事务处理问题
- 求助...in里的内容如何动态...
- 各位大侠快来帮忙!
- 简单问题,没人知的。。SQL/PLUS 窗口登陆,查询后不能拉动滚动条??
- 问一个sql语句
- 更新字段中部分值的问题
- 触发器无效且未通过重新确认
- 判断一张表是否存在应该怎么做?
- 想问问大家,需要什么样的oracle图书,已经出版的图书中,大家觉得哪些书出的比较好,对自己的工作有帮助?
- Oracle 导入导出问题,老是报错(VNI-2015:验证错误),请各位高手指点???
- 难道oracle8和oracle8i还不是一个 借了本oracle8和机器上的oracle8i怎么也对不上 他们的命名规则是怎么样的 为什么这么复杂
- trim函数 -oralce 的bug?
rudolf@TEST902>select segment_name,tablespace_name from user_segments; SEGMENT_NAME TABLESPACE_NAME ------------------------------ ------------------------------ DEPT TS EMP TS BONUS TS SALGRADE TS T TS LEADS TS PK_DEPT TS PK_EMP TS T_PK TS 9 rows selected. Our target is to move these object back to 'USERS' tablespace. here is how: exp rudolf/nix compress=n statistics=none file=rudolf Recreate user rudolf: system@TEST902> system@TEST902>drop user rudolf cascade; User dropped. system@TEST902>create user rudolf identified by nix 2 default tablespace users 3 temporary tablespace temp 4 quota 0 on system 5 quota unlimited on users 6 quota unlimited on indx; User created. system@TEST902>grant connect,resource to rudolf; Grant succeeded. After the user was recreated, we use imp to extract out our script for table recreation: imp rudolf/nix rows=n show=y file=rudolf.dmp indexfile=tabcre.sql Edit tabcre.sql, repace ABLESPACE "TS" with TABLESPACE "USERS", and you may remove the "rem" comments, delete some lines.
system@TEST902>@connect rudolf/nix rudolf@TEST902> rudolf@TEST902>@tabcre Table created. .... IMP data now, and check the status: imp rudolf/nix file=rudolf.dmp ignore=y rudolf@TEST902>select segment_name,tablespace_name from user_segments; SEGMENT_NAME TABLESPACE_NAME ------------------------------ ------------------------------ BONUS USERS DEPT USERS EMP USERS LEADS USERS SALGRADE USERS T USERS PK_DEPT USERS PK_EMP USERS T_PK USERS You'll see we succeeded in switch the objects' tablespace from TS to USERS. Hope this is helpful you.
突然想起来要做的不是这么回事,我要做的是从一个库把数据和表空间全部导到另一个库,呵呵,不知道alter方法行不行了!