Using unix host command within plsql on aix
On an aix platform Im trying to host out of a plsql procedure to
use mail. I can only get the host command to work inside a blank
.sql file. ie. first line must have the host command on it. If
you try to imbed the host command within a procedure, the file
will just sit there and nothing happens.
null
Jay,
This forum is for Headstart related questions and experiences
only. Please go to metalink.oracle.com to get more information on
your problem.
Regards,
Lauri
Jay Levasseur (guest) wrote:
: On an aix platform Im trying to host out of a plsql procedure
to
: use mail. I can only get the host command to work inside a
blank
: .sql file. ie. first line must have the host command on it. If
: you try to imbed the host command within a procedure, the file
: will just sit there and nothing happens.
null
Similar Messages
-
Run like Host command in plsql
Hi,
We are using Host command in sql*plus , but i need to implement like host command in Plsql. I refered previous post and some other links , that most of them are prefered only java stored procedure, And even that restricted previllage.
Can you give some sample example launchiing Win OS command in plsql
venkiTo run a batch file, you need to use the Command Shell (and please do not call it a DOS shell like some people tend to do as it is not DOS). E.g.
c:\windows\system32\cmd.exe /c c:\temp\test.bat
We're running cmd.exe with switch /c that tells cmd to execute the command we're passing it, and then to terminate.
Note that we cannot interact with the shell from the PL/SQL side - we cannot answer prompts and so on. The script run, must be a proper batch/non-interactive script.
Also, the Oracle Server process (Win32 thread actually) that is servicing our Oracle client connection, is running the command for us. This thread itself is a background service process. It could run in Windows configured environment (VM/Virtual Machine) that is not allowed to interact with the desktop - or have limited or no access to certain files, folders and programs.
Technically speaking, this is what happens:
1) we pass the command to execute from our client to the Oracle server session servicing us
2) this Oracle thread uses the Java VM to make a Win32 call called CreateProcess()
3) the Win32 kernel executes that process
4) the process starts, runs and terminates
5) the Java VM inside the Oracle Server process regains control and pass the exit code and standard output of that process to PL/SQL
6) PL/SQL in turns, returns that very same data to our client
If you for example run a program that pauses and expects input, or hangs.. it will cause the above series of steps to stop at step 4. With the Java VM waiting on it to complete, and we waiting for the Java VM and PL/SQL call to complete. -
Hi,
I'm running windows 2000 O/S on my desktop to connect to an IBM AIX server to run Forms6. If you call the host command from within forms, does it go to the my desktop (client) or to AIX (server). Also, if I need a username and password to log onto AIX will I be prompted to for the username and password by the OS after issuing the host command? Please provide example if you can.
Thanks,
Leonard905When you execute a HOST command the code is executed on the machine on which your Forms engine is running.
In client server this will be the client.
In Web deployed Forms this will be the middle tier application server.
Regards
Grant Ronald
FOrms Product Management -
JDAPI to search for HOST command in PLSQL
Hi All
How do I seach for all host commands in a form. I can convert the form to text or xml but I would like to do that using JDAPI. Has anyone successfully done that.
Any help is appreciated.
Rgds
Arvind BalaramanCan someone help me?
Rgds
Arvind Balaraman -
Using unix 'diff' command to publish iweb to non .mac server
It is a common problem that you can't upload incremental changes to a website a web server that is not a .mac. Recently I found that the unix (shell) 'diff -qr' works nicely for this.
However I can't seem to get this to work in automator. That is where I need some help.
What I did :
I have an iweb website in my directory
Documents/website
I made a second directory where I store my uploaded version of the website:
Documents/websiteonserver
Using a shell script I want to compare the differences between these two directories using the diff command in a shell script. When I run 'diff -qr websiteonserver website' in a terminal window, it gives a nice overview of which files are changed and which ones are new. When workin with iWeb this saves me a lot of time uploading my homepage to a non .mac server. I can only upload the changed files, which is usually only a few. Diff does not look at timestamps (which are useless in the iweb case) but it actually looks into a file and with the -q option it stops when it finds a difference. With the -r added (-qr) it also looks through all subdirectories and compares files with the same name.
I like to automate this process so that my wife can update our family homepage with just one mouseclick (or as few as possible)
Unfortunately the diff command in automator gives an error, and there's no info on why it does this.
The commands I gave:
cd Documents
diff -qr websiteonserver website
(using PWD i verified that the path is correct like this). The only stumbling block for automator seems to be the diff command. Anybody any suggestions on this?
The next challenge is to take the diff output and use that to upload only changed/new files to a ftp server.
Any help / ideas are welcome
Greetings,
AdriaanDear Cyclosaurus,
I used a single command as us specified. It really helped to add the path to the directories I wanted to compare. So now at least I got it two work partly:
It seems to work only if I compare two files. Comparing directories still does not work. Maybe diff generates some kind of error code when doing this??? It does not do that in the shell.
If I compare all files in directories + subdirectories , the workflow does not work. It seems as if it only accepts a single output line or so from the diff function. If there is more output (or maybe some newline character) the workflow halts. Very peculiar.
mmm.... I will try to make a shell script which I can run in automator. In the script file I will then generate a txt file. Then the automator can run the script and then it can open the resulting file in a text editor. See if that works.
mmm nope. I made a script like this:
#!/bin/bash
diff -qr ~/Documents/websiteon_theserver/ ~/Documents/website/ > ~/Documents/logfile.txt
I modified the atributes to executable and I could run it from the command line. The logfile.txt was created and has the correct info. I could not run it from automator...
I did copy the last line from the script into automator. And also there it does create the logfile, but the automator still says there was an error and stops.
maybe I should try Applescript, were it not that I am totally clueless on that language... -
Accessing tape device from Terminal program using UNIX tar command
I am trying to create some tape backups of very large files (.dmg images) using the UNIX tar command.
I have a 72GB HP 4mm DAT USB drive, which shows up in the system profiler as:
DAT72 USB Tape:
Version: 30.30
Bus Power (mA): 500
Speed: Up to 480 Mb/sec
Manufacturer: Hewlett Packard
Product ID: 0x0125
Serial Number: 4855310528334645
Vendor ID: 0x03f0
But I do not see the device in the /dev/ directory (see below).
Is there a way I can determine the UNIX device name?
Or must I locate and load a driver for this DAT drive?
Thank you
Jeff Cameron
Last login: Mon Jun 9 20:14:36 on ttys000
caladan:~ jeff$ ls /dev/
appleAE0 ptyq7 ptyuc ttyp0 ttyt4
autofs ptyq8 ptyud ttyp1 ttyt5
autofs_control ptyq9 ptyue ttyp2 ttyt6
autofs_nowait ptyqa ptyuf ttyp3 ttyt7
bpf0 ptyqb ptyv0 ttyp4 ttyt8
bpf1 ptyqc ptyv1 ttyp5 ttyt9
bpf2 ptyqd ptyv2 ttyp6 ttyta
bpf3 ptyqe ptyv3 ttyp7 ttytb
console ptyqf ptyv4 ttyp8 ttytc
cu.Bluetooth-Modem ptyr0 ptyv5 ttyp9 ttytd
cu.Bluetooth-PDA-Sync ptyr1 ptyv6 ttypa ttyte
cu.Palm ptyr2 ptyv7 ttypb ttytf
cu.modem ptyr3 ptyv8 ttypc ttyu0
disk0 ptyr4 ptyv9 ttypd ttyu1
disk0s1 ptyr5 ptyva ttype ttyu2
disk0s3 ptyr6 ptyvb ttypf ttyu3
disk1 ptyr7 ptyvc ttyq0 ttyu4
disk1s1 ptyr8 ptyvd ttyq1 ttyu5
disk1s3 ptyr9 ptyve ttyq2 ttyu6
disk1s5 ptyra ptyvf ttyq3 ttyu7
disk2 ptyrb ptyw0 ttyq4 ttyu8
disk2s1 ptyrc ptyw1 ttyq5 ttyu9
disk2s10 ptyrd ptyw2 ttyq6 ttyua
disk2s11 ptyre ptyw3 ttyq7 ttyub
disk2s2 ptyrf ptyw4 ttyq8 ttyuc
disk2s3 ptys0 ptyw5 ttyq9 ttyud
disk2s4 ptys1 ptyw6 ttyqa ttyue
disk2s5 ptys2 ptyw7 ttyqb ttyuf
disk2s6 ptys3 ptyw8 ttyqc ttyv0
disk2s7 ptys4 ptyw9 ttyqd ttyv1
disk2s8 ptys5 ptywa ttyqe ttyv2
disk3 ptys6 ptywb ttyqf ttyv3
disk3s1 ptys7 ptywc ttyr0 ttyv4
disk3s3 ptys8 ptywd ttyr1 ttyv5
disk3s5 ptys9 ptywe ttyr2 ttyv6
dtrace ptysa ptywf ttyr3 ttyv7
dtracehelper ptysb random ttyr4 ttyv8
fbt ptysc rdisk0 ttyr5 ttyv9
fd ptysd rdisk0s1 ttyr6 ttyva
fsevents ptyse rdisk0s3 ttyr7 ttyvb
klog ptysf rdisk1 ttyr8 ttyvc
lockstat ptyt0 rdisk1s1 ttyr9 ttyvd
machtrace ptyt1 rdisk1s3 ttyra ttyve
null ptyt2 rdisk1s5 ttyrb ttyvf
profile ptyt3 rdisk2 ttyrc ttyw0
ptmx ptyt4 rdisk2s1 ttyrd ttyw1
ptyp0 ptyt5 rdisk2s10 ttyre ttyw2
ptyp1 ptyt6 rdisk2s11 ttyrf ttyw3
ptyp2 ptyt7 rdisk2s2 ttys0 ttyw4
ptyp3 ptyt8 rdisk2s3 ttys000 ttyw5
ptyp4 ptyt9 rdisk2s4 ttys1 ttyw6
ptyp5 ptyta rdisk2s5 ttys2 ttyw7
ptyp6 ptytb rdisk2s6 ttys3 ttyw8
ptyp7 ptytc rdisk2s7 ttys4 ttyw9
ptyp8 ptytd rdisk2s8 ttys5 ttywa
ptyp9 ptyte rdisk3 ttys6 ttywb
ptypa ptytf rdisk3s1 ttys7 ttywc
ptypb ptyu0 rdisk3s3 ttys8 ttywd
ptypc ptyu1 rdisk3s5 ttys9 ttywe
ptypd ptyu2 sdt ttysa ttywf
ptype ptyu3 stderr ttysb urandom
ptypf ptyu4 stdin ttysc vn0
ptyq0 ptyu5 stdout ttysd vn1
ptyq1 ptyu6 systrace ttyse vn2
ptyq2 ptyu7 tty ttysf vn3
ptyq3 ptyu8 tty.Bluetooth-Modem ttyt0 zero
ptyq4 ptyu9 tty.Bluetooth-PDA-Sync ttyt1
ptyq5 ptyua tty.Palm ttyt2
ptyq6 ptyub tty.modem ttyt3
caladan:~ jeff$ logoutI downloaded the BRU LE 30 day evaluation, and my first impression is favorable. I still need to perform a bit of testing. The HP drive I have does 36 GB per tape (72 at 50% hardware compression). My first attempt was to back up a single 22 GB .dmg file. Even with no compression it should have fit on one DAT tape, but after backing up 90% of the 22 GB it asked for a second tape. I still have to do more testing, but I very much appreciate the point in the very promising direction.
I will reply again to this thread with my results.
Jeff Cameron -
Opening a file using Webutil_Host.Host Command
Dear Gurus
I'm trying to open a file using following command behind a button on my form:
Webutil_Host.Host('x:\03\03\39920000023.gif');
I expected from this command to open the given gif file in default image viewer but it takes no action when I press the push button. So should I try something else???try this
Webutil_host command -
Urgent please
In PL/SQL how can I call notepad ?? is the command HOST useful here ? If yes, how ?
RegardsWe can use a java stored procedure to run OS commands. This is the most common use of java in the database. You can find the estimable Mr Kyte's implementation at AskTom.
I assume Notepad is just a random example, because PL/SQL is not interactive and I would guess that you won't actually be able to do anything useful by calling notepad from the database. Although if you do manage to do something useful let us know!
Cheers, APC -
Expdb using Unix pipe command for max compression
I think the answer to this is NO, but I thought I'd ask the questions anyway, in case some of the Oracle geniuses on this site have figured out a way around this.
We have been using the existing exp/imp commands for years, due to the fact that we can pipe the output through a pre-setup file that will compress the data as it is written. Since we have moved onto the 10g and now the v11 software, we are starting to what to utilize the parallelism that is afforded in expdp, but don't want to deal with the space required for non-fully compressed exports that occurs with expdp.
So the question is, has anyone figured out a way to use expdp and using 'on the fly' compression like you could do with the old exp utility on Unix boxes??
Any help would be appreciated....Unfortunately, no--it has to do with the parallel nature of the file ops that prevents compression through a pipe. However, if you buy the Compression option in 11--you can compress on the fly.
See this white paper.
http://www.oracle.com/technology/products/database/utilities/pdf/datapump11g2007_quickstart.pdf
Edited by: jdanton on Sep 2, 2008 3:12 PM -
How to run Unix Host commands from Database Triggers?
Hi
I need to create few directories in the Unix O/s under a specific directory (From a Database Trigger). And the directory names will be determined in the DB Trigger based on the data.
I hope someone would have come across a requirement like this and will be able to help me out.
Thanks.
MohanHi Christopher
How is it possible to use System calls from Triggers. Is it possible to use Runtime Libraries in DB Triggers.
Thanks
Mohan
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Christopher Racicot ([email protected]):
Try using the system calls available in
the C runtime library by calling an external
C procedure from the trigger. We will be
enhancing the support in UTL_FILE to address
issues like this in an upcoming release,
but for now an external procedure should
do the trick.<HR></BLOCKQUOTE>
null -
Running an SQR using HOST command
We are using Forms 10g and want to call sqr using the host command. The only way we can get this to work is to put the sqr call in a shell script which also contains all of the necessary environment variables and then use host to run that shell script.
I've tried putting the environment variables in default.env to no avail.
(This is a UNIX environment).
Is it possible to run an sqr directly using the host command?
host('sqr .....')
Thanks in advance!nope. You can use host command. And modify the shell script in such
a way that the results are written to a text file and read the result using
text io
Best regards
Rajesh ALex -
How can I use unix commands from oracle report
I have to use the following command from oracle reports.
In oracle forms we can use the HOST command but what about oracle reports2.5.
I have to email the attached file 100245.pdf from oracle reports to the given email id
uuencode 100245.pdf 100245.pdf | mailx -s "test" [email protected]Hi,
It's because .bat (or .cmd) files are scripts and not executables and are interpreted using the command line executable - which is normally cmd.exe (although you can buy others).
So you need to call cmd.exe passing the bat file name as a parameter, something like
cmd.exe /c batchfilename
Without the /c you will never get a response.
However, this brings us to the bizarre conclusion that you are going to:
call cmd.exe (a shell interpreter)
to launch a batch file
that calls cygwin (another shell interpreter)
which then runs ls
When shouldn't that just be:
call cmd.exe to run the dir command
Or better yet, If you are just after a file name listing and you seem to understand Java stored procs, why not just write a JSP to list the contents of a directory? No problems with OS dependant commands, scripts and 3rd party interpreters. Plenty of examples of that out on the internet as well.
HTH
Chris -
When use host command to call discoverer
hi all
i am using the host command in forms 6i to call open
the discoverer by command line . its fine and works well
but the discoverer locks the screen and i cant work with both of them so i have to close the discoverer and i cant leave it open .
can solve this problem ?Use API d2kwutil
PROCEDURE proc_call_disc IS
declare
nm_command varchar2(10000);
nm_user varchar2(20);
pw_user varchar2(20);
cn_user varchar2(20);
BEGIN
nm_user := get_application_property( username );
pw_user := get_application_property( password );
cn_user := get_application_property( connect_string );
nm_command := 'dis4usr /connect ' || nm_user || '/' || pw_user || '@' || cn_user||' /opendb "owner.'||v_nome_bis||'" /sheet '||v_sheet||' '||string_parametros;
win_api_shell.winexec(nm_command, WIN_API.SW_SHOWMAXIMIZED, false);
END; -
How to run a HOST command from Report 2.5
Hello everybody,
I want to pass an unix command from a Report. I am running the report (Report 2.5) on an Unix server and I want to pass a unix host command inside the Before Report Trigger of the report. But Report2.5 is not recognising the HOST built-in. Is there is any way around?
Thank in advance.
Samujjwal BasuFirst off is that openssl command correct? Should it be this instead:
openssl pkcs8 -inform der -nocrypt -in test.der -out result.pem
Try out your openssl command within a command prompt so that you know that it works ok. I think the command line you specified waits on stdin (well it does for me).
After that.....
runtime.exec creates a Process object. If you do this:
Process openssl = runtime.exec("....")
then you can examine the return code from openssl to see the exit code - for instance if the input file does not exist then exit = 1. You can test for this with Java
Alternatively you could get the stderr from the process and look inside it - if it is 0 length then all is good, if it has some text in there then it has likely failed. You could then throw an exception and include the stderr output in the exception messgae. You may need to experiment with this, runnig it first when openssl is happy then running it again when openssl is upset.
M -
Host command in forms/reports
Is there a host command in reports 6i? I used this in forms 6i. When I tried to use in Reports 6i, I received a compile error.
basically all I need to do is to get directory information. This can be easily done in forms using the host command. Is there any built in package or function to achieve this in reports?
thanksthere is no "host" command in reports 6i (or earlier versions). you might want to consider using forms+reports combination (calling the report from within a form, in which you can execute the host command and do whatever you want to do, then pass the related parameters to the report). I am using this approach to handle some complex end user reporting requirements.
hope this proves useful
regards
Maybe you are looking for
-
IM TRYING TO DOWNLOAD IOS7 AND MY PHONE SAYS : "Your iphone could not be activated because the activation server cannot be reached. try connecting your iphone to itunes to activate it, or try again in a couple minutes. if this problem persists, conta
-
Line item connection between MSEG and FAGLFLEXA
Hi all. I have the following problem: I have a material document in MM no 100. The FI document in FAGLFLEXA is document NO 1000. For the material document type 101 (reception) i have 5 articles. In FAGLFLEXA, in the FI document, i have besides the st
-
Creating a Simple Slideshow w music as a movie for a web page.
Hi all, I would like to create a simple slideshow with music saved as a mp4 movie for a web page. I'd like to use basic transitions like crossfades between the pictures and other fun stuff A few questions: 1 - Would I be better of creating this in i
-
Uptdate to 10.8.3 problems with photoshop
Hi since the uptdate to 10.8.3 I have somes problems with photoshop, it crash at each time I want to open it
-
Hi, I have a struts page that can be forwarded to from 2 other pages. How in struts do I determine which page actually did the forwarding. Thanks, Richard