Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

scheduler jobs to refresh table data from SQL server

USER101May 24 2011 — edited May 25 2011
Hi !

I am planning to have a scheudler job to refresh data from a SQL server database into Oracle. All I do is run several of the below statements. Each of these tables have less than 100 rows. So, it completes in under 20 seconds.

I am wondering if it is a good idea to run it as PL/SQL block as below. Please can someone comment ?


delete from B;                                                  
insert into A select * from AA@choumsq020;                                      
commit;
delete from B;                                             
insert into B select * from BB@choumsq020;                            
commit;



I am planning to run it as below

BEGIN
  DBMS_SCHEDULER.create_schedule (
    job_name        => 'TEST'
    job_type 	    => 'PLSQL_BLOCK'
    job_action      => 'begin  
			delete from B;                                                  
			insert into A select * from AA@choumsq020;                                      
			commit;
			delete from B;                                             
			insert into B select * from BB@choumsq020;                            
			commit;
			end; '    
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'FREQ=MINUTELY, byminute=15',
    end_date        =>  NULL,
    comments        => 'Repeats every 15 mins, for ever.');
END;
/
Am I doing anything wrong here ? I am yet to run it on the database

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2011
Added on May 24 2011
4 comments
818 views