Oracle database enables regular synchronization of tabular data between different databases

Source: Internet
Author: User

1. Create a database connection
CREATE  Public DATABASE  to  by ' ( DESCRIPTION = (    ADDRESS = (PROTOCOL = TCP) (HOST = 134.103.65.206) (PORT = 1521))    (Connect_data =      (SERVICE _name = ORCL)  )';
2. Create a stored procedure
Create or Replace procedureTest as   begin   DELETE  fromKdfaultorder;INSERT  intoKdfaultorderSelectbusinessdataid id,title reporttitle,mainsn faultnumber, (SelectSpecialtyname fromCcatsupt. Pub_specialty@kdogg whereSpecialtyid=bigspecialty) Bigtype, (SelectSpecialtyname fromCcatsupt. Pub_specialty@kdogg whereSpecialtyid=Specialty) Smalltype, (SelectBusinessName fromCcatsupt.sys_business@kdogg whereBusinessid=Business ) Reporttype,sourcedept reportresource,firstrecepttime reporttime,reqrepairtime ENDTIME, (SelectObjectName fromCcatsupt.org_tree@kdogg whereItemid=repairoper) Dealperson,hastennum Repairnum,decode (Processflag,'declarate','Ticketing','Billdeal','in Work Order Processing','Hangup','Hang Up','VISIT','To return') Orderstatus,alarmstatus Warnstatus, (SelectObjectName fromCcatsupt.org_tree@kdogg whereItemid=RegionID) AreaName fromCcatsupt. Svr_pub_da_mainqueue@kdoggwhereArchiveType is NULL andFirstrecepttime<Sysdate- the/1140 andReqrepairtime>Sysdate- the/1140;End;
3. Create a timed task
DECLARE  number;    begin   dbms_job.submit (job1,       ='test; ' ,        = sysdate,        = ' TRUNC (sysdate) + 1 + 1/(PER) ' );    Commit ;   End;
//querying all scheduled tasks for the current databaseDeclareJob1 Number; beginDbms_job.submit (JOB1, what= 'test;', Next_date=sysdate, Interval= 'TRUNC (sysdate) + 1 + 1/(PER)'); Commit; End; //run a scheduled taskbeginDbms_job.run ( in);Commit;End;

Oracle database enables regular synchronization of tabular data between different databases

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.