我现在有一个表TableName1,我想建立一个这个表的备份,有什么好的方法吗?

解决方案 »

  1.   

    用sql语句:create table TableName1_bak as select * from TableName1;
      

  2.   

    我的方法是先建立一个表Table1_Bake;自己添加索引、主键、触发器等。insert into Table1_Bake(col1, col2, col3)
    select col1, col2, col3 from Table1楼上的也可以。好像还有一个select into 也可以,不知道如何实现。
      

  3.   

    select into 的方法我已经找到了select Table1.Col1, Table1.Col2, Table1.Col3 
    into Table1_Bake
    from Table用这个语句之前不用建表,而且可以选取字段来进行数据表的建立。
      

  4.   

    最方便的方法还是 select into
      

  5.   

    select into 的用法我在9i 中使用为什么报错呢,总是在新表的位置提示缺少关键字?
      

  6.   

    看这个表的作用是什么。物化视图或者直接insert into都行,我不倾向于触发器。