自动建立表空间,比如每到一个月的开始,就自动建立一个以时间命名的表空间
在创建表的时候,表分区自动根据时间的不同自动将数据存入各自的表空间
怎么实现! 请大狭指点

解决方案 »

  1.   

    job+存储过程+动态SQL。job每天夜里执行存储过程,存储过程检查是否是月的最后一天,如果是,就用动态SQL执行创建表分区的语句。
      

  2.   

    create or replace create_table is
       dd   varchar2(20);
    begin
       select col into dd from t1 where rownum=1  --dd:='2005/10/01';
       if sysdate>to_date(dd, 'yyyy/mm/dd') then
          execute immediate 'create table ||to_char(sysdate, 'yyyy/mm/dd')||' col1.....';
          dd:=to_char(add_months(sysdate+1), 'yyyy/mm/dd');
          update t1 set col=dd;
       end if;
       commit;
    end;--定时脚本
    variable   a  number;
    begin
        dbms_job.submit(:A, 'create_table;', sysdate, 'sysdate+1');
        commit;
    end;
      

  3.   

    定时的动作用job做,功能用存储过程实现