这是两个平台的数据移植问题,在A平台的数据库里给我提供了一个接口表t_interface,我要从这个接口表中把需要的记录取出(标志位为0的记录),然后我还要把这个表中刚刚取出的记录的标志位置位1,这个时候要在日志表中t_log把这些记录插入,这个日志表和接口表结构一样,在后面加一个当前的时间(取这些记录的时间).
这个存储过程是在A平台下的库中.现在在我的这个B平台下的库中有一张表,就是接口表中的那些记录的其中字段,在我的这个平台下要有个存储过程去调用A平台的按个存储过程,并且还要得到那些记录,我要插在我的这个表中.我这个存储过程要在每天的0点执行.这个两个平台都是oracle 数据库,两个库可能在一个服务器上,也可能在两个服务器上,希望高手们给我提供两套方案,跪谢~~~~~~~~~~~

解决方案 »

  1.   

    用DBMS_JOB包可以操作Oracle里面的Job(定时任务)
    Summary of DBMS_JOB Subprograms
    Table 20-1 DBMS_JOB Package Subprograms  
    Subprogram Description
    SUBMIT Procedure Submits a new job to the job queue.
    REMOVE Procedure Removes specified job from the job queue.
    CHANGE Procedure Alters any of the user-definable parameters associated with a job.
    WHAT Procedure Alters the job description for a specified job.
    NEXT_DATE Procedure Alters the next execution time for a specified job.
    INSTANCE Procedure Assigns a job to be run by a instance.
    INTERVAL Procedure Alters the interval between executions for a specified job.
    BROKEN Procedure Disables job execution.
    RUN Procedure Forces a specified job to run.
    USER_EXPORT Procedure Re-creates a given job for export.
    USER_EXPORT Procedure Re-creates a given job for export with instance affinity.
      

  2.   

    ExampleThis submits a new job to the job queue. The job calls the procedure DBMS_DDL.ANALYZE_OBJECT to generate optimizer statistics for the table DQUON.ACCOUNTS. The statistics are based on a sample of half the rows of the ACCOUNTS table. The job is run every 24 hours:VARIABLE jobno number;
    BEGIN
       DBMS_JOB.SUBMIT(:jobno, 
          'dbms_ddl.analyze_object(''TABLE'',
          ''DQUON'', ''ACCOUNTS'', 
          ''ESTIMATE'', NULL, 50);' 
          SYSDATE, 'SYSDATE + 1');
       commit;
    END;
    /
    Statement processed.
    print jobno
    JOBNO
    ----------
    14144
      

  3.   

    两个库如果不在同一服务器,可采用DBLINK连接定时执行存储过程,采用JOBhttp://www.jobcorps.com.cn/blog/portal.asp?blogid=132&pages=data/view/20上面应该有你用到的东西,祝好运