Solved

Oracle Function

Posted on 2013-12-11
2
555 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle RMAN - trying to duplicate a database 5 30
Deleting Rows from an Oracle Database - Performance 19 47
SYbase 4 31
Email query results in HTML 6 20
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Creating and Managing Databases with phpMyAdmin in cPanel.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

778 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