- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Pl Sql question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2002 01:35 AM
тАО07-16-2002 01:35 AM
my need is to launch a unix script (on the machine) from the inside of an oracle plsql procedure, in other words the procedure create a file and it should be thereafter sent via ftp: how can I launch the sending from there?
thanks already!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2002 03:00 AM
тАО07-16-2002 03:00 AM
Re: Pl Sql question
Can one execute an operating system command from PL/SQL?
There is no direct way to execute operating system commands from PL/SQL in Oracle7. However, one can write an external program (using one of the precompiler languages, OCI or Perl with Oracle access modules) to act as a listener on a database pipe (SYS.DBMS_PIPE). Your PL/SQL program then put requests to run commands in the pipe, the listener picks it up and run the requests. Results are passed back on a different database pipe. For an Pro*C example, see chapter 8 of the Oracle Application Developers Guide.
In Oracle8 one can call external 3GL code in a dynamically linked library (DLL or shared object). One just write a library in C/ C++ to do whatever is required. Defining this C/C++ function to PL/SQL makes it executable. Look at this External Procedure example.
http://www.orafaq.com/faqplsql.htm#OSCOMMAND
If you really want this, then maybe you should write your code in perl, and have perl call sql, giving you full control of your process.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2002 03:13 AM
тАО07-16-2002 03:13 AM
SolutionYes, this is possible (from Oracle 8.0.x and onwards) to execute an operating system command from within Oracle. In fact I answered this question before. See the following thread :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xcac1a2db8513d6118ff40090279cd0f9,00.html
Hope it helps,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2002 08:39 PM
тАО07-16-2002 08:39 PM
Re: Pl Sql question
One of the folks in the group wanted a stored procedure that would accept an script name and run the shell. This procedure has to be restricted so that only trusted users can run it. A user can easily pass the script dbshut to the stored procedure and the Oracle database will come tumbling down.
To maintain a healthy system you must restrict the stored procedure that you create as the interface (granting execute permission to only trusted users) or restrict what it can do.
-Good Luck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-17-2002 03:59 AM
тАО07-17-2002 03:59 AM
Re: Pl Sql question
Haven't tried it, but I think it should work.