How does client invoke an operating system command in the Server machine.?
Guys,
Is there any way that a client could trigger an operating system command on the Oracle Server machine?
I've a VB scipt file in the server machine.My requirement is to execute that VB file on the server machine.(The script would essentially create a DSN on the server machine).
The normal way to execute a VB script would be to specify the name of the file in the command prompt.(If my VB script ONDEMAND.VBS resides in C:\ONDEMAND folder,I need to execute the statement
"C:\ONDEMAND\ONDEMAND.VBS" in the command prompt to get it executed.)
I would utilise the SQL command below
HOST C:\ONDEMAND\ONDEMAND.VBS
to invoke it programatically(from a PL\SQL scipt).
Can someone help me in utiliting HOST command in Oracle(Or by any other means) for a client database operation to execute an Operating system command in the Oracle server machine?
Thanks,
Bhagat
Hi Bhagat,
This has been asked several times recently:
Executing Shell Script from PL/SQL Block
Fire an executable using oracle
Cheers,
Colin
Similar Messages
-
How does this work with multiple systems backing up with time machine
I was wondering as Apple states that this will do multiple time machine backups as in multiple computers, how does this do this? I am assumng that it will require me to partition the srive in the unit as multiple partitions. 1 for each time computer with time machine running.
I'm sorry, I'm not quite sure how to interpret your answer so I'll ask for clarification.
Do you mean that the backup belonging to each user will be protected by filesystem perms? In other words Alice's backup will be owned by Alice and only readable by her, ditto for the hyperthetical Bill?
I guess in other words, does Time Machine preserve file ownership perms? -
Operating System Command in JDBC Sender
Hello everybody,
I'm trying to find some syntax to execute an operating system command on Windows Server 2003, but the commands don't seem to work I'm actually trying to generate a directory, now the problem is that I can't find syntax examples on how to do this I tried something like MKDIR TEST, now is the syntax of the command lines as you write them in Command Prompt, or maybe there is my error, thanks in advance.
Regards,Confirmed.
JDBC sender also support OS command.
Refer to note 841704 if you face any issue while executing OS command in JDBC adapter.
Note: OS Command execute when processing in database executed successfully. It is even independent on OS command Errors.
Thanks
Farooq
Edited by: Farooq Farooqui on Jan 16, 2009 11:36 AM -
File adapter operating system command exit code
Hello,
If you call an operating system command in the file adapter, how is the exit code of the command handled? The documentation says nothing about this.
If I call 'true', I expect the file adapter to succeed.
If I call 'false', I expect the file adapter to fail.
Hope someone can calrify.
Best regards
/Otto FrostHi, Yes, you are rigth, it spawns a subprocess, that runs without control.
In java you use Runtime.exec().
It returns a process.
process.exitValue() returns an int.
The process is already used to terminate the process after timeout I suppose.
You would like to be able to have the fileadapter succeed or fail depending on this exitValue.
Depending on the command you execute, the exit code is different. RTFM on unix.
You would like to define which codes should be treated as success, and which ones that should be treated as failure.
true typically returns 0 and false not 0
However, a comparison command could for example return 0 for equal, -1 if the frist argument is smaller and 1 if the first argument is larger.
For the diff command, Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
Thanks
/Otto -
Hi,
There is an urgent requirement, i want to know about Run Operating System Commands in file adapter. What are all possible commands for windows operating system? and how it works? Kindly send me your suggestions and links at the earliest.
Your help will be appreciated.
Thanks,
Sadhna.Hi,
Run Operating System Command Before/After Message Processing
● Command Line
An operating system command specified here is executed before or after the message processing of a file that was found in a run. The default value is an empty character string (no command).
When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
● %f (file name)
● %F(absolute file name including path)
● Timeout (secs)
This specifies the maximum runtime of the executing program in seconds. When this time interval is exceeded, the adapter continues processing. The executing program continues to run in the background.
● Terminate Program After Timeout
Set this indicator if the adapter is to terminate the executing program when the timeout is exceeded.
The adapter writes the output (STDOUT and STDERR) for the operating system command in the system trace.
Regards,
Phani -
Execute external operating system command
Hi Friends,
I have a requirement to run a script file with extention '.PL' on the application server using ABAP.
i have sample how to run it in XI.
XI3.0 provides a very simple way of handling this using the "Operating System Command" in the File Adapter.
I post my output file in the following folder,
/usr/sap/sapout/test/
The shell script is available in the following path,
/usr/sap/bin/convert.pl
The figure below explains as to how we call the shell script using "Operating System Command".
File Acess parameters
Target Directory = /usr/sap/sapout/test/
File Name Scheme = TestOutput.txt
Processing Parameters
File Construction Mode = Add Time Stamp
File Type = Binary
Operating System Command = /usr/sap/bin/convert.pl %F
I have to do the same thing in ABAP as it has been done for XI as mentioned in the above example.
My operating system is UNIX.
If any one can give me a sample it would be really helpful to me.
Thanks in advance,
Arundhathi.Hi Arundhati,
You can run operating system commands from ABAP.
e.g. If you want to change UNIX right for any file, you can use following code.
lv_ucomm = 'chmod a+rwx 123.txt'.
CALL 'SYSTEM' ID 'COMMAND' FIELD lv_ucomm.
whatever command you provide in Field parameter ( lv_ucomm in the above case ), ABAP run that command at operating system level.
In your case, you can provide command in lv_ucomm to run script at operating system level.
Hope it will help you.
Regards,
Naren -
CCMS Auto-React: Operating System Commands
Hi Gurus,
I want to run an operating system command in the event that an alert is raised in my CEN CCMS system.
I have set up the operating system command in SCEN (using SM69) and tested it -- no problems. I have used the example given on help.sap.com. It works great from SM69 or SM49.
I have created a custom MTE Auto-Reaction Method that is a copy of the SAP standard and it points to the logical name of the op system command I created in SM69.
But, when I assign the Auto-Reaction method to an MTE and kick off the auto-reaction, nothing happens. I have tried assigning it auto-reaction method as a method for a local MTE and also as a central auto-reaction, but I get nothing.
Please help me see what I am missing.
Many thanks in advance,
Nic DoodsonHi Michael,
Thanks for the response, I hope you can help.
Logical command is called: Z_NI_ALERT_OVO
It calls the operating system command: /usr/sap/tmp/test.sh
It allows additional parameters.
test.sh is :
#!/usr/bin/sh
echo $2 alert from $1 Message $5 $4 > /usr/sap/tmp/alert_$3.txt
I can run this from SM49/SM69 and it works fine.
Method is: Z_SEND_ALERT_TO_OVO
Calls function module: SALO_EXECUTE_SYSTEM_COMMAND_V2
Can be executed on: Any Server
Execution Method: Periodically in Dialog Process
Parameters:
COMMAND : Z_NI_ALERT_OVO
PARAMATERS : <blank>
REACT_ON_ALERTS : red
MTENAME : SID/SEGMENT/CONTEXT/OBJECT/ATTRIBUTE
PARAMLIST_1: COLOR DATE_TIME MSG
PARAMLIST_2: ID
Help!
I can only think there is something about it being a local/centrally distrubuted auto-reaction method...I'm assigning it as a cenrally distributed auto-reaction method.
Any input would be great.
Cheers,
Nic -
Client Side Operating System Commands
Hello,
I need to invoke client side operating system commands or batch executables (e.g. test.bat) with the help of Java stored procedures and PL/SQL written in database server. My database is Oracle 10g and installed on UNIX platform, and I am trying to call Windows client commands. What do you prefer to do this?
I investigated lots of documents, but they generally refer how to call OS commands of the server on which the database is running.
Thanks.It mostly depends on your particular client application how it handles return parameters from SQL or PLSQL.
One simple way would be to simply "print" out the desired client command and let it evaluate it from the client side.
As an example I use SQL*Plus:
/* declare bind variable */
SQL> VAR x varchar2(30)
/* define substitution variable (cmd) */
SQL> COLUMN cmd new_value cmd
/* Assign the SQL output to the declared bind variable */
SQL> BEGIN
SELECT 'echo Hello World'
INTO :x
FROM DUAL;
END;
PL/SQL procedure successfully completed.
/* Assign the bind variable to SQL*Plus substitution variable */
SQL> SELECT :x cmd
FROM DUAL
CMD
echo Hello World
1 row selected.
/* Finally let the HOST command evaluate the substution variable */
SQL> HOST &&cmd
Hello WorldHope you got the idea ... -
How to call Operating System commands / external programs from within APEX
Hi,
Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
Any pointers will be greatly appreciated.
Thanks & Regards,Hi Guys,
I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
sqlplusw.exe user/password@database @script1.sql
sqlplusw.exe user/password@database @script2.sql
sqlplusw.exe user/password@database @script3.sql
sqlplusw.exe user/password@database @script4.sql
What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
Any help will be greatly appreciated.
Thanks & Regards, -
how can I downgrade my operating system as my bluetooth work ok with my holde commodore on the 4.2.1 system but now it is upgraded to the latest system it does not operate properley
thankyou but it looks like we won't be buying another iphone
-
I downloaded the new operating system and now the Bluetooth in the car does not play my music. The music on the phone show the cloud and the red arrow pointing downwards. How do I download all the music again to my phone please?
I have an ITunes account. I got it when I got my IPOD. I've thought about upgrading, but I didn't see any reason to buy a newer IPOD because they all come with so much stuff I don't want/need. I don't have my current IPOD filled yet and I really don't need an IPOD Touch that has capabilities that my Droid already has. I don't need to be concerned with documents, mail, attaching to Facebook or playing games. I can do all that on my phone. I just want to maintain my music between 3 devices.
So now that I see it is not to my benefit to have this product---can you point me in the direction to cancel this? And how do I get my music back? Will it show up once I cancel my account? -
How to use Operating System Commands while using define in sqlplus
How to use Operating System Commands while using define in sqlplus . The Host OS is Linux
define report_name=PROD_${host date "+%b"}.html
The above is not working.
The output should be
define report_name=PROD_JAN.html
Regards,
DBof course I was talking nonsense: the problem here is the mixing of bind variables and DEFINE variables.
With the following changes the script should work (the conditions for begin_interval_time are perhaps not what you want):
variable snap1 number
variable snap2 number
variable rptname varchar2(20)
begin
SELECT min(snap_id) into :snap1 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
SELECT max(snap_id) into :snap2 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
end;
col file_name_value new_value report_name noprint
select 'PROD_'|| to_char(sysdate,'MON') || '_' || to_char(sysdate,'DD') file_name_value from dual;
define report_type = 'html'
define num_days=2
define begin_snap=:snap1
define end_snap=:snap2
@@?/rdbms/admin/awrrpt.sql -
How to execute operation system commands by using TSQL without enabling xp_cmdshell.
Hi Experts
Looking for advise if one can use operation system commands using TSQL without enabling xp_cmdshell.
actually using xp_cmdshell requires sysadmin privs which I am unable to provide (directly or using proc) to a user but the user needs some operating system commands to execute for file manipulation from sql server session. Please share your thought.
Best Regards
khalil>but the user needs some operating system commands to execute for file manipulation from sql server session
See article here
http://www.mssqltips.com/sqlservertip/2014/replace-xpcmdshell-command-line-use-with-sql-server-agent/:
"Problem
I need to run something from the command-line, but based on best practices xp_cmdshell has been disabled. The task that needs to run is an internal process that will originate from within SQL Server. Is there a way to do this without using xp_cmdshell?
Solution
The use of xp_cmdshell is generally frowned upon and is now recommended to be disabled, unless it is absolutely necessary. There is a solution that works around this restriction via the use of SQL Server Agent.
Wherever SQL Server is installed, SQL Server Agent is installed with it (except for SQL Express). SQL Server Agent has the ability to run job steps which invoke the command shell. And in the case that the job is owned by a member of the sysadmin fixed server
role, the job will execute as the service account under which the SQL Server Agent is running. "
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014 -
How to execute Operating System commands from Stored procedure.
Any help on how to execute Operating System commands from stored procedures will be appreciated.
Nanditha.Search the forums for 'External Procedure' and you will find example code that has been posted before.
-
How to Run Operating System Command Before/After Message Processing SAP PI
Hi,
We are trying to execute multiple commands via "Operating System Command Before/After Message Processing".
When we use single command say for example cp or mv (copy or move) the commands get executed fine.
eg: cp %F /var/opt/data/outbound/Test/Dummy.txt
/this works fine/
when we club commands together or try to redirect the outputs of commands, none of the commands get executed.
eg:
cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
or
wc -l %F > /var/opt/data/outbound/Test/Dummy.txt
Is it possible to execute multiple commands or redirect the output of commands without using a shell script? The PI server we are working on iis hosted on UNIX environment.Hi Harleen,
try like this
cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
instead of semicolon try this
(1) &
command1 & command2
Execute Command1 and then execute Command2
(2) &&
command1 && command2
Runs the command2 only when command1 doesn't Complete successfully
(3) ||
command1 || command2
Runs the second command if the first command had an error
(4) ()
(command1 || command2) || (command3 & command4)
Defines the order in which commands are to be executed
Regards
Suraj
Maybe you are looking for
-
I need help I cant register my sons ipods or get facetime to confirm e-mail I could use some help pleas
-
I need to do a login page by using the JSP...which as normal->capture the username and password in text box on webpage....then compare them in the record in a table called Users in a SQL Server Database...How can I connect to the database?is it like
-
Bitmap Fill is not working as thought
I am working on a simple target game. I have a class created that inherits from Sprite called TargetSprite. TargetSprite creates a resize matrix, sets beginBitmapFill, sets the line type, then draws a circle, then ends the fill. The problem is that i
-
Cannot back up my pics to DVD??
Hi, Hope you can help. I select all my pics, click file and then burn to cd. I select my DVD drive from the drop down menu. On the top left of the window it states "free space available on disk 8 457mb"?? When I insert a DVD into my drive (4.7gb) and
-
4.1.4 and XP Home
I've downloaded 4.1.4 desktop software on both my desktop and laptop. Both pcs have Windows XP Home Edition and the Palm desktop software will not open. I get a Windows error - ModVer: 6.2.4131.0 Offset: 00004973. I contacted Palm and they said it's