Operating system calls from apex
Question about operating system calls from apex.
I created a java file which is wrapped with pl/sql like
create or replace java source named "ExternalCall" as
import java.io.*;
I do the steps from this web page http://www.oracle.com/global/de/community/tipps/oscalls/index.html
The page is in german, but for experienced users the code on this page says everything.
In apex i have an application which calls this function with the "move" command in a sql-report region.
Let's say move c:\work1\file.txt c:\work2\file.txt
Everything works fine on one host(pc) but if i want to transfer the file from my host to another one then
i get the messgage "no access" although i have read, write access on the other host.
By the way, on both hosts i have admin rights.
Why can't i transfer the file over a network ?
Thanks in advance for any kind of help.
Regards
Stefan
null
You say that "on both hosts i have admin rights".
Remember that Oracle doesn't log in as "you", so Oracle may not have rights to the remote host.
There are a lot of different permissions that can be assigned to java stored procedures. This chapter in the documentation might help:
http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14187/chnine.htm#BABFBDGG
You might get better help from the JVM forum:
Java in the Oracle Database
Similar Messages
-
Operating System Calls from APEX with Java and PL/SQL
Question about operating system calls from apex.
I created a java file which is wrapped with pl/sql like
create or replace java source named "ExternalCall" as
import java.io.*;
I do the steps from this web page http://www.oracle.com/global/de/community/tipps/oscalls/index.html
The page is in german, but for experienced users the code on this page says everything.
In apex i have an application which calls this function with the "move" command in a sql-report region.
Let's say move c:\work1\file.txt c:\work2\file.txt
Everything works fine on one host(pc) but if i want to transfer the file from my host to another one then
i get the messgage "no access" although i have read, write access on the other host.
By the way, on both hosts i have admin rights.
Why can't i transfer the file over a network ?
Thanks in advance for any kind of help.
Regards
StefanI guess you are working on a Windows host. In this case Oracle processes are running as Windows services with a build-in MS system account. This account has no access to network ressources. You have two ways to get out of your windows box:
Assign Oracle services a network enabled account, e.g. domain user with local administrator privileges. (I never tried this and I don't like to recommend it.)
Use a command script for copying files and use explicite authentication within this script:-
net use \\myserver\ipc$ tiger /user:scott
copy c:\temp\xxx1 \\myserver\share\temp
copy c:\temp\xxx2 \\myserver\share\temp
Michael -
Operative System call from Composition Environment 7.2
Hello all,
what is the way to execute a shell script from SAP Composition Environment 7.2 (only j2ee stack).
....On an ABAP engine I know that the solution is true with a transaction that create a external system call, but on j2ee?
thank you!!Hi Rajesh,
Please try to clear cookies and temp file from your browser. and try again. if issue still persist, then try again later
Hope it helps
Regards
Arun -
Cross platform operating system calls from Java
For our application we need to call an external program to perform FTP. We use ncftp as it's available on all the server platforms our clients use (Sun, HP, Linux, Windows). Up to now we've been using a Java program that listens to the Oracle pipe and sends a string to the OS.
Now we are using 8i we thought it would be better to use Java within Oracle as this should reduce problems due to the external program not running. On Windows it works fine, but on Linux runtime.exec does not seem to take account of the system path. If I send something like '/usr/bin/ncftpput ...' it works, but I can't rely on the executable being in that directory although it should be somewhere in the path. I want to just pass 'ncftpput ...'.
Ideally I want to be able to make the code OS independent, but would consider doing something in the Java part to detect the OS and adapt accordingly, perhaps by using a shell e.g. '/bin/sh -c ncftpput ...', but I've had problems with that using the whole command line and can I rely on having a specific shell on all *nix systems?
At some point we'd like to do all the FTP from within Oracle, but that looks like a bigger project.
Any ideas/suggestions?
Thanks
SteveSteve,
To determine the OS, you should be able to check the System properties. As an example, when I run this (quick and dirty) sample code, I can see that os.name=Windows NT on my Windows instance:
CREATE OR REPLACE JAVA SOURCE NAMED "envTest" AS public class envTest {
public static void getEnvVar() {
System.getProperties().list(System.out);
CREATE OR REPLACE PACKAGE envTest IS
PROCEDURE getEnvVar;
END;
CREATE OR REPLACE PACKAGE BODY envTest IS
PROCEDURE getEnvVar IS
LANGUAGE JAVA NAME 'envTest.getEnvVar()';
END;
To see the output after executing envTest.getEnvVar, map System.out to DBMS_OUTPUT before running it, as follows:
set serveroutput on
begin
dbms_java.set_output(100000);
end;
Hope this helps,
-Dan
http://www.compuware.com/products/devpartner/db/oracle.htm
Debug PL/SQL and Java in the Oracle Database -
Calling Operating System Commands from PL/SQL using java
Calling Operating System Commands from PL/SQL - The Java Way
wlth help of given thread link,
Calling OS Commands from Plsql
but i had user privilege problem
Declare
x Varchar2(2000);
Begin
x := OSCommand_Run('/tmp/sri/GROUP_ho.sh');
DBMS_OUTPUT.Put_Line(x);
End;
o/p;
can't exec: /tmp/sri/GROUP_ho.sh lacks user privilege
i done the grant privillage also
part
dbms_java.grant_permission('abcd', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
dbms_java.grant_permission('abcd', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
dbms_java.grant_permission('
abcd', 'SYS:java.io.FilePermission','<<ALL FILES>>', 'execute');
again
get
can't exec: /tmp/sri/GROUP_ho.sh lacks user privilege
same error;Process management at the OS level should prevent execution continuing in the calling code until the command has completed (either successfully or with error).
If the low level java code were to spawn child process threads then execution could continue, but I'm guessing the Java function your talking about doesn't do that and just calls the operating system to execute the command and waits for the returning code to come back. -
Call operating system services from Jdeveloper
How can i call operating system services from Jdeveloper ?
nullWe do not use JDeveloper but use external procedures/routines called from the database. Then you can call a database procedure to an operating system task.
Linda -
Error in BW ( Operating system call SiPeekPendConn failed )
Hi All,
This is Ganesh, new to SAP BASIS. We are facing some errors in BW, where users cannot able to run BW reports from yesterday.
Please find below system log details:
Operating system call recv failed (error no. 10054)
NiConnect Unsuccessful, Return Code: -0010
> Host: 156.5.30.34
> Service: sapgw00
Please help me out by providing the solution and the cause for above system log.
Waiting for your reply.
Best Regards,
GaneshHi,
check this,
http://sap.ittoolbox.com/groups/technical-functional/sap-bw/sap-r3-to-bw-521356#M521423
Also try to search with the error ur getting in Google or for Notes in SMP.
Regards,
Ravi -
System Call from Java, problem LD_LIBRARY_PATH
I use class Runtime to invoke Operating System Call.
I want to run OS command gpg (gnu program for encrypting/ decrypting files).
What is interesting, when I run my sqlplus script from system user (used for database installation) call ends with success.
Running script from other os users or machines ends with -1 code and error message:
"ld.so.1: gpg: fatal: libiconv.so.2: open failed: No such file or directory"
gpg uses libraries given LD_LIBRARY_PATH (/opt/gnupg/lib:/usr/lib:/usr/local/lib)
I think that is the problem. Is there a workaround for that??
Best regard
GrzegorzMaybe related to the fact that the PATH environment variable is unset then re-initialized by Oracle to PATH = /usr/local/bin:/bin:/usr/bin. Try using absolute path for the OS commands.
Kuassi
- blog http://db360.blogspot.com/
- book http://db360.blogspot.com/2006/08/oracle-database-programming-using-java_01.html -
I fail to start the sap server with error:Operating system call recv failed
I fail to start the sap server in SAP R3 Management Console and the message in the syslog was :
R/3 Basis System: Operating system call recv failed (error no. 10053)
Is there any one could tell me how to resolve the problem or give me some advice?I will appreciate him/her very much.Thank you.trc file: "dev_disp", trc level: 1, release: "620"
Sun May 07 13:14:30 2000
kernel runs with dp version 3(ext=1) (@(#) DPLIB-INT-VERSION-3)
length of sys_adm_ext is 304 bytes
systemid 560 (PC with Windows NT)
relno 6200
patchlevel 0
patchno 674
intno 20020600
pid 3628
***LOG Q00=> DpSapEnvInit, DPStart (00 3628) [dpxxdisp.c 978]
shared lib "dw_xml.dll" version 674 successfully loaded
shared lib "dw_xtc.dll" version 674 successfully loaded
shared lib "dw_stl.dll" version 674 successfully loaded
Sun May 07 13:14:32 2000
WARNING => DpNetCheck: NiAddrToHostCanon() took 2 seconds
Sun May 07 13:14:37 2000
WARNING => DpNetCheck: NiAddrToHost(1.0.0.0) took 5 seconds
***LOG GZZ=> 2 possible network problems detected - check tracefile and adjust the DNS settings [dpxxtool2.c 3212]
MtxInit: -2 0 0
DpShMCreate: sizeof(wp_adm) 12784 (752)
DpShMCreate: sizeof(tm_adm) 1690816 (8412)
DpShMCreate: sizeof(wp_ca_adm) 18000 (60)
DpShMCreate: sizeof(appc_ca_adm) 6000 (60)
DpShMCreate: sizeof(comm_adm) 192000 (384)
DpShMCreate: sizeof(wall_adm) (22440/34344/56/100)
DpShMCreate: SHM_DP_ADM_KEY (addr: 001E0040, size: 1977824)
DpShMCreate: allocated sys_adm at 001E0040
DpShMCreate: allocated wp_adm at 001E0560
DpShMCreate: allocated tm_adm_list at 001E3750
DpShMCreate: allocated tm_adm at 001E3778
DpShMCreate: allocated wp_ca_adm at 00380438
DpShMCreate: allocated appc_ca_adm at 00384A88
DpShMCreate: allocated comm_adm_list at 003861F8
DpShMCreate: allocated comm_adm at 00386210
DpShMCreate: allocated ca_info at 003B5010
DpShMCreate: allocated wall_adm at 003B5018
MBUF state OFF
Sun May 07 13:14:38 2000
EmInit: MmSetImplementation( 2 ).
<ES> client 0 initializing ....
<ES> InitFreeList
<ES> block size is 1024 kByte.
Using implementation std
<EsNT> Memory Reset enabled as NT default
<EsNT> EsIUnamFileMapInit: Initialize the memory 2458 MB
<ES> 2457 blocks reserved for free list.
ES initialized.
***LOG Q0K=> DpMsAttach, mscon ( db01) [dpxxdisp.c 9115]
CCMS: Initalizing shared memory of size 20000000 for monitoring segment.
CCMS: start to initalize 3.X shared alert area (first segment).
DpMsgAdmin: Set release to 6200, patchlevel 0
MBUF state PREPARED
MBUF component UP
DpMBufHwIdSet: set Hardware-ID
***LOG Q1C=> DpMBufHwIdSet [dpxxmbuf.c 941]
DpMsgAdmin: Set patchno for this platform to 674
Release check o.K.
Sun May 07 13:15:18 2000
ERROR => W2 (pid 4776) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W2
Sun May 07 13:15:38 2000
ERROR => W5 (pid 4548) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W5
ERROR => W8 (pid 4592) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W8
ERROR => W9 (pid 4584) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W9
ERROR => W12 (pid 4676) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W12
ERROR => W13 (pid 4272) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W13
my types changed after wp death/restart 0xbf --> 0xb7
Sun May 07 13:15:58 2000
ERROR => W4 (pid 4888) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W4
ERROR => W6 (pid 4788) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W6
ERROR => W15 (pid 4596) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W15
Sun May 07 13:16:18 2000
ERROR => W1 (pid 4892) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W1
ERROR => W3 (pid 4904) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W3
ERROR => W7 (pid 4000) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W7
ERROR => W10 (pid 4864) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W10
my types changed after wp death/restart 0xb7 --> 0xb5
Sun May 07 13:16:38 2000
ERROR => W0 (pid 4900) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W0
ERROR => W11 (pid 4500) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W11
ERROR => W14 (pid 4636) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W14
ERROR => W16 (pid 3532) died [dpxxdisp.c 11523]
force unlock of wp_adm mutex W16
my types changed after wp death/restart 0xb5 --> 0x80
DP_FATAL_ERROR => DpEnvCheck: no more work processes
DISPATCHER EMERGENCY SHUTDOWN ***
DpModState: change server state from STARTING to SHUTDOWN
Sun May 07 13:16:42 2000
***LOG Q0M=> DpMsDetach, ms_detach () [dpxxdisp.c 9341]
MBUF state OFF
MBUF component DOWN
***LOG Q05=> DpHalt, DPStop ( 3628) [dpxxdisp.c 7883] -
How to: execute operating system commands from PL/SQL
System: IBM pSeries AIX
Oracle: 11g Enterprise
Is there a quick way to execute operating system commands from PL/SQL?
Without creating a JAVA class....
I need to execute a Loader script.
I want to do this from within PL/SQL.
I need to to do 4 things.
Three require SQL scripts.
The fourth is SQL*Loader.
The usual way is with a UNIX script calling 3 SQL scripts and one Loader control file.
Is there way to do all this from within ONE PL/SQL SCRIPT ??
Just let me know.Is there a quick way to execute operating system commands from PL/SQL?
NO
Without creating a JAVA class....
I need to execute a Loader script.
I want to do this from within PL/SQL.
WHY ON EARTH, such action will create a new connection and become a resource hog?
I need to to do 4 things.
Three require SQL scripts.
The fourth is SQL*Loader.
The usual way is with a UNIX script calling 3 SQL scripts and one Loader control file.
Which is perfect for the purpose.
Is there way to do all this from within ONE PL/SQL SCRIPT ??
Just let me know.
NO, there is NOT. Nor should there be. Why create unstable ineffcient Mickey Mouse systems, glued together by hacking?
Sybrand Bakker
Senior Oracle DBA -
Error on WAS no. 10054 SAP Basis System: Operating system call
Hi All,
Error on WAS no. 10054 SAP Basis System: Operating system call
we got the following error message in the syslog of the WAS:
SAP Basis System: Operating system call recv failed (error no. 10054)
The system still works. What can we do?
Thanks.
Best Regards,Hi,
Please check the folloiwng notes
Error no. 10054
34116 - Syslog: "Operating System call xxxx failed"
Thanks
Adil -
Can I source an environment before making a system call from the database
I can execute system calls from the database like
Process proc = Runtime.getRuntime().exec("env");
but I am unable to source an environment before making the call.
Our goal is to from within the database to execute tkprof on a
raw trace file then load both files into clobs in a table. We can load
the raw trace no problem, we just cannot figure out how to execute
tkrprof on the raw trace then load its output.
Anyone know if this is possible to hava java get a runtime and then call
an environment file to source the environment so that path's and other environment variables are set prior to executing another system command.Thanks for that...but can I do multiple edits in my Stored Procedure Vaibhav and pass back something that I can then utilize in my SSIS? For example...
One and Only one Member Span...so I'd be doing a SELECT COUNT(*) based on my match criteria or handle the count accordingly in my Stored Procedure and passing something back via the OLE DB Command and handling it appropriately in SSIS
Are there "Diabetes" claims...again probably by analyzing a SELECT COUNT(*)
Am I expecting too much from the SSIS...should I be doing all of this in a Stored Procedure? I was hoping to use the SSIS GUI for everything but maybe that's just not possible. Rather use the Stored Procedure to analyze my stged data, edit accordingly, do
data stores accordingly...especially the data anomalies...and then use the SSIS to control navigation
Your thoughts........
Could you maybe clarify the difference between an OLE DB Command on the Data Flow and the Execute SQL Task on the Control Flow...
You can get return values from oledb comand if you want to pipeline.
see this link for more details
http://josef-richberg.squarespace.com/journal/2011/6/30/ssis-oledb-command-and-procedure-output-params.html
The procedure should have an output parameter defined for that
I belive if you've flexibility of using stored procedure you may be better off doing this in execute sql task in control flow. Calling sp in data flow will cause it to execute sp once for each row in dataset whereas in controlflow it will go for set based
processing
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Executing a Operating System command from Stored Procedure ??
I want to execute a Operating System command from a PL/SQL Stored Procedure, can anyone suggest me how can I do this ??
I am on Sun-Solaris with Oracle 8.1.7 database.
Please do email me at [email protected]
Thanks in Advance,
Ramesh L.Are you using a webserver? If so, you could make your operating system script into a CGI program, then execute it from pl/sql using utl_http.request.
-
Operating system call w2k and linux
Hello:
I am not a programmer but i nedd a routine to do an operating system call and execute a batch or shell set of commands,
do anyone know how can i do it?
thanks a lot in advanceOr maybe Runtime.exec is enough for you. MUCH simpler than JNI, as long as a shell executing a script is all you want.
Read this first:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
% -
Work Process tries to restart but fails - Operating system call fork:restar
Hi
We have a ECC 5.0 system running on v5r4 (6.40 kernel level 159). Some of the work processes fail and then try to restart and fail again. Thus there are many job log entries in both SAP and OS/400.
The OS/400 logs mention the PASE (unix executable environment) and MCH3203.
SAP mentions Operating system call fork:restart
OSS has note #884359 which mentions a palitative but despite being at 6.40 level 159 the parameter profile as/4/wp_max_restart is said to be "unknown" by RZ10.
We are making sure we are up to date with the APAR II14126 just in case this is the issue.
It did start after the time change but we are not sure this is the root cause.
We are also considering getting upto kernel 171.
Anyone else seen this issue?
thanks
Matthew MilneWe see those problems once a while, and usually they are gone when you restart the instance or after an IPL. You should report the problem to IBM, they will probably be interested in the LIC log entries that come along with the error (STRSST - Start a Service Tool - Licensed Internal Code Log). II14126 is probably a good start (for example, MF40759).
The profile parameter as4/wp_max_restart is only known to the kernel, because it is not intended as a permament setting, but only as a temporary workaround for the problem in the PASE environment. That's why RZ11 does not know about the parameter and reports it as unknown.
Kind regards,
Christian Bartels.
Maybe you are looking for
-
I set up family sharing with a secondary ID and now can't add my primary ID to the group.
I signed up for family sharing with a secondary Apple ID that I use for the iTunes store, and included my wife in the group. When I try to also include my primary Apple ID, I get an error message that says "You cannot send an invitation to your own a
-
IPod setup on Mac now needed for PC with Vista
I have had my iPod setup on a Mac and now am using a PC with Vista. I installed iTunes 8.x and when I connected my iPod I was informed that it had to be reformatted for use with Windows. This iPod is packed with music. Is there any way to salvage the
-
PC Suite connectivity problems
I have owned 3 different nokia phones over the last 5 years or so. With all of the phones and using different versions of PC Suite, different methods of connection (cable, infrared) and even different computers I have never had satisfactory connectiv
-
Changed artist name to 'last, first' and some don't sort by last.
I'm running iTunes 11.1.4.62 on Windows7 looking at songs sorted by artist. I changed Eric Clapton to Clapton, Eric. Three and only three of the songs are still sorting as if they start with "er". One was purchaced on 6/9/2009 the other two on 10/
-
Can any one of you suggest me any tutorial about Calendar function? How to add the calendar component into Studio Creator? Highly appreciate your help. Also, I need help on File upload.