Solved

Oracle Function

Posted on 2013-12-11
2
548 Views
Last Modified: 2013-12-16
Hi,
I have an PL/SQL function who need's to run every 15 minutes. The name of the function is UPDATE_RC_ITL, inserting the data from one to another database...
Thank you in advance
0
Comment
Question by:andrejaTJ
2 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39711150
you need db_link from the database with the destination table to the source database
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_5005.htm#SQLRF01205

you can use dbms_scheduler for scheduling a procedure or pl/sql call every 15 minutes
http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_sched.htm#CIHHBGGI

the first time you'll need to create the table
create table xxx as select from schema.table_name@db_link;

and then add the changed data with the merge statement
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_9016.htm#SQLRF01606
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 200 total points
ID: 39711153
Use dbms_scheduler to run the function.

This should work.  Just change the function name and name the job and comments whatever you want.
exec dbms_scheduler.create_job (job_name => 'SOME_JOB', -
	job_type => 'STORED_PROCEDURE', -
	job_action => 'myStoredFunction', -
	number_of_arguments => 0, -
	repeat_interval => 'FREQ=HOURLY; BYMINUTE=0,15,30,45; BYSECOND=0', -
	enabled => TRUE, -
	comments => 'My function');

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now