如题,
因为需要用到
set copycommit 1
set arraysize 1000
copy from命令,而我发现在过程中不能使用.
那位大侠用过,帮帮我,感激不尽,分不够再加.

解决方案 »

  1.   

    SQL> copy from si/si@orcl to si/si@orcl create aa using select * from a;Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    Table AA created.   6 rows selected from si@orcl.
       6 rows inserted into AA.
       6 rows committed into AA at [email protected]> desc aa
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     A                                                  VARCHAR2(10)SQL> declare
      2  i number;
      3  begin
      4  execute immediate 'copy from si/si@orcl to si/si@orcl create aa using select * from a';
      5  end;
      6  /
    declare
    *
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 4
    SQL> drop table aa;SQL> ed
    Wrote file afiedt.buf  1  declare
      2  i number;
      3  begin
      4  execute immediate 'create table aa as select * from a';
      5* end;
    SQL> /PL/SQL procedure successfully completed.SQL> desc aa
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     A                                                  VARCHAR2(10)这个只是SQLPLUS 的的一个命令,不是SQL语句,你可以通过DBLINK来实现你的目的,execute immediate 'create table aa as select * from a@dblink_name';
      

  2.   

    这个只是SQLPLUS 的的一个命令,不是SQL语句,你可以通过DBLINK来实现你的目的,execute immediate 'create table aa as select * from a@dblink_name';我用的是dblink,因为我要复制的表有上亿条记录,用create会回滚段不够。
      

  3.   

    你为什么不每复制N条commit一次?
      

  4.   

    可不可以告诉我方法?
    用rownum?