Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Host command using OAS

Status
Not open for further replies.

Kenrae

Programmer
Feb 7, 2001
174
ES
I'd need something similar to the host command you can use on forms. The Oracle server is a Unix machine (HP9000). I need to send commands to the Server OS.

Thank's in advance
 
Uppps, I forgot to comment that I cannot use the dbms_pipe package :p
 
Well I think you well may be scuppered then.

The next best thing I can think of is....

any job wanting to do an OS command writes a file on the server using utl_file to a certian fixed dir, it writes the exact syntax of what it wants doing.

A Unix shell script scans this dir looking for files, if it finds one it does it and then deletes the file. then scans again or maybe sleeps a bit first would be better...

If you wanted the DB app to be able to acknowledge that the command has been performed then it would have to use utl file to poll for the files existence as soon as it is gone then it could assume the job is done.


This is well dodgy though, I'm sure someone else has a better solution....
 
Thanks for the reply.
I've found the solution anyway, I'll explain it here.

In Oracle 8 you can call external procedures. It's only a matter of doing a simple c function like that:

int syscommand(char *command)
{
return(system(command));
}

Then you must compile and link it as a dynamic library (.so) and register it in Oracle. You must add some lines to listener.ora and tsnames.ora too.
Well, if someone needs something like that (for example, you can transfer files using ftp...) this is a simple solution :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top