[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to execute a command on the command line of a Windows OS through a Oracle DB Trigger?

Posted on 2011-05-11
11
Medium Priority
?
440 Views
Last Modified: 2012-06-27
Can anyone please show me how I can execuate a command on the command line of a Windows OS through an Oracle DB Triggger.

Thanks in advanced.
0
Comment
Question by:tcorigli
9 Comments
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 35737139
You need to write a Java external procedure.  There are several examples out there.

Here's the first one I found:
http://forums.oracle.com/forums/thread.jspa?messageID=1439836
0
 
LVL 8

Expert Comment

by:POracle
ID: 35738222
using plsql you can't do this.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35738233
>>using plsql you can't do this.

You can with the Java wrapper.  Just not natively using only PL/SQL.
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
LVL 8

Expert Comment

by:POracle
ID: 35738293
ya that what I am saying......"you can't do it with plsql"

other ways:-
java
proc
etc...
0
 
LVL 15

Expert Comment

by:Franck Pachot
ID: 35740796
Hi,
You need to be very careful if you do that, calling someting non-transactional fron a trigger.
What if the statement rolls back for any reason ? Then command that has been called will not roll back its effects.
And for internal reasons, a trigger can fire twice for the same update.
Regards,
Franck.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35742522
I cannot agree more with franckpachot about the potential problems.

That said, I was researching an answer to another question and came across something I had forgotten.  Depending on your version, DBMS_SCHEDULER can execute an OS program.

Check the docs for job_type EXECUTABLE

http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sched.htm

I've never tried this but in theory you should be able to create the job then start it from the trigger.
0
 

Author Comment

by:tcorigli
ID: 35878946
I've requested that this question be deleted for the following reason:

not needed anymore
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35878947
Just because you don't need this anymore doesn't mean we did not answer your question.

Please post your final solution and if it wasn't covered here, I'll retract my objection.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35922879
I suggest:
accept:  http:#a35737139
assist:   http:#a35742522
assist:   http:#a35740796
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

872 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