环境:WINDOWS 2003 ORACLE 9.2.0.1
问题:
用户User1拥有表空间tb1, in_tb1,其中tb1中为数据,in_tb1中为索引
如何将它复制到另一个用户user2下
其中表空间改为tb2,in_rb2,其中tb2中为数据,in_tb2中为索引

解决方案 »

  1.   

    参考 
      1 将用户User1的数据卸出 
      $ exp user1/passwd1 
      Export:......   Export file:expdat.dmp> 
      E(ntire database),(2)U(sers),or (3)T(ables):(2)U> 
      Export grants(yes/no):yes> 
      Export table data(yes/no):yes> 
      Compress extents(yes/no):yes> 
      Abort to export specified users.... 
      Abort to export O7USER1's tables... 
      Export terminated successfully without warnings  最后将user1用户的数据生成于默认的expdat.dmp 文件中。 
      
      2.将user1的数据全部复制到user2 中 
      $ imp user2/passwd2 
      Import:Release ......   Import file: > expdat.dmp 
      Enter insert buffer size (minimum is 4096) 30720>307200 
      Export file created by EXPORT:   List contents of import file only(yes/no):no> 
      Ignore create error due to object existence(yes/no):no> 
      Import grants(yes/no):yes> 
      Import table data(yes/no):yes> 
      Import entire export file(yes/no):no>y 
      开始复制user1之数据到user2中,出现如下提示: 
      .importing O7USER1's objects into O7USER2
      .. importing table "table1" 10 rows imported  … 
      Import terminated successfully without warnings. 
      

  2.   

    最简单最快的办法是用sql语句实现。
    在用户user2下,create table tb2 as select * from user1.tb1;
    然后生成对应的索引就可以了。
      

  3.   

    用sql语句实现。
    触发器和索引不会转换过来,自己手处理就可以动。
    序列吗?是与表无关的东西。要跟原数据库的currentval一直的话,需要手工设置的(利用导入导出是不可以的)。
      

  4.   

    create table tb2 as select * from user1.tb1;
    需要查询创建索引。
      

  5.   

    tb1不是表空间?
    可以create table tb2 as select * from user1.tb1
      

  6.   


    tb1和tb2都是表空间,不是表
      

  7.   

    tb1和tb2 是表空间
    可以create table tb2 as select * from user1.tb1吗?
    我记得只有表才有这种用法吧?
      

  8.   

    装pl/sql developer了吗。用export table导出,import table导入,非常方便
      

  9.   

    imp/exp
    rman
    impdp/expdp(10g)