你用exp命令把数据从第一个表空间的用户的数据导出来后,再用imp命令导入到第二个表空间的第二个用户
解决方案 »
- 如何提高此sql语句的查询效率? 期待yangfuen637200老兄看看。
- 用现有的数据库文件创建数据库
- 怎样让数据文件脱机
- 用exp导出AIX下数据库时报块找不到错误
- 请教sql语句
- 如何用SQL语句(oracle数据库)将/2/5/10/156/89/57/这种字符串换成'2','5','10','156','89','57'这种样式
- lock_sga=true后数据库不能正常启动
- 我用ODBC操作ORACLE数据库,数据库操作有时一直没反映,不知是死锁还是什么其它原因?????????????
- 请教一个关于IN的sql语句
- 调用PRO*C库的C程序编译出现错误,高手指教
- 难道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方法行不行了!