平台信息如下:
SunOS ycsyjw 5.9 Generic_112233-12 sun4us sparc FJSV,GPUZC-Moracle版本为9.2.0原来有一个“库” mydata  放在了 system表空间里面
现在自己新建了一个表空间 new_space想把mydata 从system里挪到new_space里,
不知道怎么操作,请教各位,
谢谢了。

解决方案 »

  1.   

    http://topic.csdn.net/u/20070929/10/586022a6-e615-4319-bb30-5827d71a52d9.html
      

  2.   

    Alter tablespace 表空间 [online | offline]表空间脱机以后,可以转移数据文件。
      

  3.   

    请问你的“库”"mydata"的概念是什么?一个用户??
    如果是user的话,好办。有两种办法:方法1、修改用户的默认表空间,该用户下的对象移动到新表空间。dba执行:
    alter user mydata default tablespace new_space;当前用户下执行:
    alter table aaa move tablespace new_space ;
    alter index bbb rebuild tablespace new_space ;如果对象太多可以用以下语句生成。select 'alter table ' || table_name || ' move tablespace new_space; '|| from user_tables;
    select 'alter index ' || index_name || ' rebuild tablespace new_space; '|| from user_indexes;
    方法2、exp/imp的方法。首先将该用户导出 exp ... owner=mydata ...然后drop掉该用户重新创建,或者drop该用户下所有对象。
    将该用户的默认表空间指向 new_space授权的时候,不要授给unlimited tablespace权限(或者在授权之后收回该权限)revoke unlimited tablespace from mydata;
    然后设定表空间使用配额:alter user mydata 
      quota 0 on system
      quota unlimited on new_space;然后执行imp,这样你的表和索引就不会再进入system了,而是进入new_space;
      

  4.   

    抱歉,sql语句里面最后的  || 
    是多余的,删掉就好。
      

  5.   


    修改用户表空间:alter table user.tablename move tablespace tablespacename; 
    alter index indexname rebuild tablespace tablespacename; 
    ----------------------------------------------
    alter table faq.t_test move tablespace T_FAQ; 
    alter index TNAME rebuild tablespace T_FAQ; 
      

  6.   


    你这里所说的库是不是一个schema的概念呀,是不是指的一个用户的默认表空间指定到system里去了呀,如果是这样的话,需要移动表空间里的对象,有两种方法1. 通过move table到达要求
    SQL>alter table schema.tablename move tablespace tablespacename; 2. 通过imp/exp来转移表空间中的对象,如果你建表的时候没有特别指定表空间的话,应该也可以成功,可惜你是9i,如果10g就提供expdp和impdp更好
      

  7.   

    没错,alter table move tablespace就可以办到.以前我做过