Running OS command using OEM 11gR1

Hi,
I have installed OEM 11gR1 on linux 64bit machine and have applied all recommended patches on top of it. Everything worked out fine till i got to the part of configuring my database alert.
Database Instance: UAT > All Metrics > Tablespace Space Used (%) > Tablespace Name APPS_UNDOTS1 >
Jun 14, 2012 1:31:38 PM User Action SYSTEM SYSMAN initiated a manual reevaluation of the alert.
Jun 8, 2012 1:13:36 PM Corrective Action <SYSTEM> Execution created for Corrective Action INITIATE_SMS.
Jun 8, 2012 1:13:36 PM Corrective Action <SYSTEM> Another Corrective Action INI not run since there is an existing running execution of CA INITIATE_SMS.
Jun 8, 2012 12:50:05 PM <SYSTEM> Tablespace APPS_UNDOTS1 is 98 percent full
Jun 8, 2012 12:40:05 PM <SYSTEM> Tablespace APPS_UNDOTS1 is 91 percent full
Based on some tablespace criteria i want the system to:
1) generate a corrective action which is not happening (note that on line 2 above it seems like a corrective action was initiated but i don't know how this happened and this is the only occurrence)
2) run an OS command when the alert is initiated to
Questions:
1) why is the system not generating any corrective actions
2) how can i set OEM to run an OS command
Thank you for your help

odie_63 wrote:
Justin Cave wrote:
The normal way to approach that sort of requirement would be to use a Java stored procedure.Or a DBMS_SCHEDULER external program with "use_current_session" set to true.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1013568
On 10g+ I'd definitely give this a go.

Similar Messages

  • I want run some command using java

    hi all,
    i want run command using java code.
    from cell prompt when i run this command 'mysqldump test > /home/DBNAME.sql'
    it will create DBNAME.sql file.
    but i want to run this command using java code
    i tried the following code but it did not work.
    is any other way is their?
    try {
                   Runtime.getRuntime().exec("setxkbmap nudi");
              } catch(IOException ioe) {
                   ioe.printStackTrace();
    thanks in advance
    daya

    hello,
    thanks for replay
    i am sorry the above code should be like this.(the above code is working fine)
    public class ExportTest{
         public ExportTest(){
              try {
                   Runtime.getRuntime().exec("mysqldump test > '/root/DBNAME.sql'");
              } catch(IOException ioe) {
                   ioe.printStackTrace();
              }catch(Exception e){
                   e.printStackTrace();
         public static void main(String args[]){
              new ExportTest();
    }when run above class, it not creating DBNAME.sql file.
    when run in command prompt it creating DBNAME.sql
    ($ mysqldump test > /root/DBNAME.sql)
    but i want to run this command from java code, that's way tried to do using above
    code, but it won't create DBNAME.sql
    is it wrong what i am doing? or any other way?
    thanks inadvace
    daya

  • Run shell commands using java program

    Hi guys,
    I am trying to run shell commands like cd /something and ./command with arguments as follows, but getting an exception that ./command not found.Instead of changing directory using "cd" command I am passing directory as an argument in rt,exec().
    String []cmd={"./command","arg1", "arg2", "arg3"};
    File file= new File("/path");
    try{
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd,null,file);
    proc.waitFor();
    System.out.println(proc.exitValue())
    BufferedReader buf = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    catch(Exception e)
    {e.printStackTrace();
    So can anyone please tell me what is wrong with this approach? or is there any better way to do this?
    Thanks,
    Hardik

    warnerja wrote:
    What gives you the idea that the process to execute is called "./command"? If this is in Windows, it is "cmd.exe" for example.It does not have to be cmd.exe in Windows. Any executable or .bat file can be executed as long as one either specifies the full path or the executable is in a directory that is in the PATH.
    On *nix the file has to have the executable bit set and one either specifies the full path or the executable must be in a directory that is in the PATH . If the executable is a script then if there is a hash-bang (#!) at the start of the first line then the rest of the line is taken as the interpreter  to use. For example #!/bin/bash or #!/usr/bin/perl .
    One both window and *nix one can exec() an interpreter directly and then pass the commands into the process stdin. The advantage of doing this is that one can change the environment in one line and it  remains in effect for subsequent line. A simple example of this for bash on Linux is
    import java.io.OutputStreamWriter;
    import java.io.Writer;
    public class ExecInputThroughStdin
        public static void main(String args[]) throws Exception
            final Process process = Runtime.getRuntime().exec("bash");
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getErrorStream(), System.err)).start();
            new Thread(new PipeInputStreamToOutputStreamRunnable(process.getInputStream(), System.out)).start();
            final Writer stdin = new OutputStreamWriter(process.getOutputStream());
            stdin.write("xemacs&\n");
            stdin.write("cd ~/work\n");
            stdin.write("dir\n");
            stdin.write("ls\n");
            stdin.write("gobbldygook\n"); // Forces output to stderr
            stdin.write("echo $PATH\n");
            stdin.write("pwd\n");
            stdin.write("df -k\n");
            stdin.write("ifconfig\n");
            stdin.write("echo $CWD\n");
            stdin.write("dir\n");
            stdin.write("cd ~/work/jlib\n");
            stdin.write("dir\n");
            stdin.write("cat /etc/bash.bashrc\n");
            stdin.close();
            final int exitVal = process.waitFor();
            System.out.println("Exit value: " + exitVal);
    }One can use the same approach with Windows using cmd.exe but then one must be aware of the syntactic differences between commands running in .bat file and command run from the command line. Reading 'help cmd' s essential here.
    The class PipeInputStreamToOutputStreamRunnable in the above example just copies an InputStream to an OutputStream and I use
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    public class PipeInputStreamToOutputStreamRunnable implements Runnable
        public PipeInputStreamToOutputStreamRunnable(InputStream is, OutputStream os)
            is_ = is;
            os_ = os;
        public void run()
            try
                final byte[] buffer = new byte[1024];
                for (int count = 0; (count = is_.read(buffer)) >= 0;)
                    os_.write(buffer, 0, count);
            } catch (IOException e)
                e.printStackTrace();
        private final InputStream is_;
        private final OutputStream os_;
    }

  • Running unix command using java shows error

    Hi All,
    I am trying to run UNIX move command using Java exec method but its throwing error, unable to rename. Here below is the code i am trying to run to move all files from one directory to another directory. source and destination directory exists.
    public class Demo
        public static void main(String args[])
            try
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("mv /home/demo1/* /home/demo2");
                int exitVal = proc.waitFor();
                System.out.println("Process exitValue: " + exitVal);
            } catch (Throwable t)
                t.printStackTrace();
    }if i give "mv /home/demo1 /home/demo2" in exec method, its working, with * character its giving problem.
    Please help me in resolving the problem.
    Thank you

    Characters like *, >, &, |, etc. are interpreted by the command shell--that is by the bash, zsh, etc. programs. When you execute a command with ProcessBuilder or Runtime.exec, you're not going through one of those shells, so their interpretation of those characters is not available.
    In your code, the character * is being delivered directly to the mv command (which doesn't think * is anything special), as opposed to being turned into a list of files and directories as it would be when it's interpreted by the shell. The mv command doesn't know anything about the * character being special.
    If you want to have those shell interpretations, you need to execute the command through a shell. One example is like so, but a) you'll want to read up on the methods in exec() that take arrays of String, and b) you'll want to read up on ProcessBuilder, and c) you'll need to check your shell's man pages to see the exact syntax and arguments.
    runtime.exec("/bin/bash -c 'mv x/* y'");

  • Running 5 commands using array elements and waiting between?

    Hi All,
    Trying to learn PS so please be patient with me ;)
    System: PSv3 on Win2012 server running WSUS role
    I am wanting to execute 5 commands using a 'foreach' loop but wait until one finishes before moving onto the next. Can you please check out what I have and provide some suggestions of improvement? or scrap it completely if it's rubbish :(
    Current code:
    #### SCRIPT START ####
    #Create and define array and elements
    $Array1 = @(" -CleanupObsoleteComputers"," -DeclineSupersededUpdates -DeclineExpiredUpdates"," -CleanupObsoleteUpdates"," -CleanupUnneededContentFiles"," -CompressUpdates")
    #Run the cleanup command against each element
    foreach ($element in $Array1) {
    Get-WsusServer | Invoke-WsusServerCleanup $element -Whatif
    #### SCRIPT END ####
    I am assuming that I need to use @ to explicitly define elements since my second element contains two commands with a space between?
    The cleanup command doesn't accept '-Wait' so I'm not sure how to implement a pause without just telling it to pause for x time; not really a viable solution for this as the command can sometime take quite a while. They are pretty quick now that I do
    this all the time but just want it to be future proof and fool proof so it doesn't get timeouts as reported by others.
    I have found lots of code on the net for doing this remotely and calling the .NET assemblies which is much more convoluted. I however want to run this on the server directly as a scheduled task and I want each statement to run successively so it
    doesn't max out CPU and memory, as can be the case when a single string running all of the cleanup options is passed.
    Cheers.

    Thank you all for your very helpful suggestions, I have now developed two ways of doing this. My original updated (thanks for pointing me in the right direction Fred) and Boe's tweaked for my application (blew my mind when I first read that API code
    Boe). I like the smaller log file mine creates which doesn't really matter because I am only keeping the last run data before trashing it anyway. I have also removed the verbose as I will be running it on a schedule when nobody will be accessing it anyway,
    but handy to know the verbose commands ;)
    Next question: How do I time these to see which way is more efficient?
    My Code:
    $Array1 = @("-CleanupObsoleteComputers","-DeclineSupersededUpdates","-DeclineExpiredUpdates","-CleanupObsoleteUpdates","-CleanupUnneededContentFiles","-CompressUpdates")
    $Wsus = Get-WsusServer
    [String]$Logfile = 'C:\Program Files\Update Services\LogFiles\ArrayWSUSCleanup.log'
    [String]$Logfileold = 'C:\Program Files\Update Services\LogFiles\ArrayWSUSCleanup.old'
    If (Test-Path $Logfileold){
    Remove-Item $Logfileold
    If (Test-Path $Logfile){
    Rename-Item $Logfile $Logfileold
    foreach ($Element in $Array1)
    Get-Date | Out-File -FilePath $LogFile -Append -width 50
    Write-Output "Performing: $($Element)" | Out-File -FilePath $LogFile -Append -width 100
    . Invoke-Expression "`$Wsus | Invoke-WsusServerCleanup $element" | Out-File -FilePath $LogFile -Append -width 100
    Logfile Output {added 1 to show what it looks like when items are actions}:
    Wednesday, 27 August 2014 2:14:01 PM
    Obsolete Computers Deleted:1
    Wednesday, 27 August 2014 2:14:03 PM
    Obsolete Updates Deleted:1
    Wednesday, 27 August 2014 2:14:05 PM
    Expired Updates Declined:1
    Wednesday, 27 August 2014 2:14:07 PM
    Obsolete Updates Deleted:1
    Wednesday, 27 August 2014 2:14:09 PM
    Diskspace Freed:1
    Wednesday, 27 August 2014 2:14:13 PM
    Updates Compressed:1
    Boe's Updated Code:
    [String]$WSUSServer = 'PutWSUSServerNameHere'
    [Int32]$Port = 8530 #Modify to the port your WSUS connects on
    [String]$Logfile = 'C:\Program Files\Update Services\LogFiles\APIWSUSCleanup.log'
    [String]$Logfileold = 'C:\Program Files\Update Services\LogFiles\APIWSUSCleanup.old'
    If (Test-Path $Logfileold){
    Remove-Item $Logfileold
    If (Test-Path $Logfile){
    Rename-Item $Logfile $Logfileold
    [Void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    $Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer($WSUSServer,$False,$Port)
    $CleanupMgr = $Wsus.GetCleanupManager()
    $CleanupScope = New-Object Microsoft.UpdateServices.Administration.CleanupScope
    $Properties = ("CleanupObsoleteComputers","DeclineSupersededUpdates","DeclineExpiredUpdates","CleanupObsoleteUpdates","CleanupUnneededContentFiles","CompressUpdates")
    For ($i=0;$i -lt $Properties.Count;$i++) {
    $CleanupScope.($Properties[$i])=$True
    0..($Properties.Count-1) | Where {
    $_ -ne $i
    } | ForEach {
    $CleanupScope.($Properties[$_]) = $False
    Get-Date | Out-File -FilePath $LogFile -Append -width 50
    Write-Output "Performing: $($Properties[$i])" | Out-File -FilePath $LogFile -Append -width 100
    $CleanupMgr.PerformCleanup($CleanupScope) | Out-File -FilePath $LogFile -Append -width 200
    Logfile Output {added 1 to show what it looks like when items are actions}:
    Wednesday, 27 August 2014 2:32:30 PM
    Performing: CleanupObsoleteComputers
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 1
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:32 PM
    Performing: DeclineSupersededUpdates
    SupersededUpdatesDeclined : 1
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:34 PM
    Performing: DeclineExpiredUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 1
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:36 PM
    Performing: CleanupObsoleteUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 1
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0
    Wednesday, 27 August 2014 2:32:38 PM
    Performing: CleanupUnneededContentFiles
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 0
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 1
    Wednesday, 27 August 2014 2:32:43 PM
    Performing: CompressUpdates
    SupersededUpdatesDeclined : 0
    ExpiredUpdatesDeclined    : 0
    ObsoleteUpdatesDeleted    : 0
    UpdatesCompressed         : 1
    ObsoleteComputersDeleted  : 0
    DiskSpaceFreed            : 0

  • Running Dos Command using Java

    How do i run a particular Dos command using a simple java class?

    Process process = Runtime.getRuntime().exec( ... );
    Search the forum. There are plenty of examples.

  • Running System commands using Runtime.exec()

    I'm trying to run an example from "The Java Programming Language" book by Arnold, Gosling and Holmes. I'm trying to run a system level command and get the results. The code looks like:
    public static String[] runCommand(String cmd) {
    String[] outputData= null;
    String[] cmdArray = {"/usr/bin/ls", "-l", "/tmp"};
    try {
    Process child = Runtime.getRuntime().exec(cmdArray);
    InputStream in = child.getInputStream();
    InputStreamReader reader = new InputStreamReader(output);
    BufferedReader = new BufferedReader(reader);
    // read the commands output
    int counter = 0;
    String line;
    while ((line = input.readLine()) != null)
    outputData[counter++]= line;
    if (child.waitFor() != 0){  // error when it's not 0       
    System.out.println("Couldn't run the command.");
    System.out.println("It produced the following error message : " + child.exitValue());
    outputData = null;
    } catch (Exception e){
    System.out.println("It got here!");
    System.out.println("It produced the following error message : " + e.getMessage());
    outputData = null;
    return outputData;
    It gets to the while line, trys to run the input.readLine() and kicks out the exception that looks like:
    It got here!
    It produced the following error message : null
    I know it gets to the input.readLine() because I had a whole lot more try blocks in there, but for simplicity left it out (so it look like the code in the book, which I tried originally). When I run the same command from the command line (on our Sun Solaris 2.8 system) I get results back. I'm not sure what I'm doing wrong. Any help would be greatly appreciated. Thanks.

    Hi, duffymo, hope you can help me. Consider this servlet code:
    String theCommand = "csh /export/home/gls03/sasstuff/runsas.csh /export/home/g
    ls03/sasstuff/gary2.sas";
    //Create a parent Process for the sas program subprocess:
    Process p = rt.exec(theCommand);
    System.out.println("after call to rt.exec(theCommand)");
    Here is the runsas.csh script:
    #!/bin/csh
    setenv LD_LIBRARY_PATH /opt/sybase/lib:/usr/lib:/usr/openwin/lib:/opt/SUNWspro/S
    C2.0.1
    setenv SASROOT /usr/local/CDC/SAS_8.2
    setenv XKEYSYMDB /usr/local/CDC/SAS_8.2/X11/resource_files/XKeysymDB
    $SASROOT/sas -sasuser /hpnpages/cgi-bin/applinks/hospcap/tmp $1
    The execution never gets to the println statment, here is the error:
    class java.io.IOException Exception. Message: CreateProcess: csh /export/home/g
    ls03/sasstuff/runsas.csh /export/home/gls03/sasstuff/gary2.sas error=2
    java.io.IOException: CreateProcess: csh /export/home/gls03/sasstuff/runsas.csh /
    export/home/gls03/sasstuff/gary2.sas error=2
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:66)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:551)
    at java.lang.Runtime.exec(Runtime.java:477)
    at java.lang.Runtime.exec(Runtime.java:443)
    at sasRunnerNew.doPost(sasRunnerNew.java:103)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:262)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:21)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at us.ny.state.health.hin.hinutil.HinFilter.doFilter(HinFilter.java:124)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2643)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2359)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    The command runs fine in unix.
    I've also tried using these as arguments to exec:
    String theCommand = "/bin/csh /export/home/gls03/sasstuff/runsas.csh /export/home/gls03/sasstuff/gary2.sas";
    String[] theCommand = {"csh", "/export/home/gls03/sasstuff/runsas.csh", "/export/home/gls03/sasstuff/gary2.sas"};
    These generate the same error. I'm thinking this is a sas-specific problem.
    Thanks for any help. Gary

  • To run a command using java code

    hi all,
    There is a command
    "java -jar selenium-server.jar -interactive"
    which i am running through command prompt after going to D:\MyFolder\Examples .
    i want to execute this command using java code .please help

    subratjyetki wrote:
    please answer in detail or if posible can u give the code for thisThe detail is given in the reference. Why don't you read it?
    I could give you the code but it will cost you ?100 per hour.

  • Running OS command using DBMS_PIPE

    Hi,
    I have reproduce the exemple in the documentation DBMS_PIPE - Example 3: Execute System Commands using the proc daemon.pc. It works, the commands are getting executed, but I have no control over them. What I need is for the calling PL/SQL function to wait for the OS command to finnish before continuing with the execution the PL/SQL function.
    Any hint would be appreciated. Thanks.

    odie_63 wrote:
    Justin Cave wrote:
    The normal way to approach that sort of requirement would be to use a Java stored procedure.Or a DBMS_SCHEDULER external program with "use_current_session" set to true.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#i1013568
    On 10g+ I'd definitely give this a go.

  • Running System Commands using Java

    HI,
    I am developing an application using java which requires some system commands to be run.For example i have to write a java function which can program the windows scheduler to run a particular executable at some time & another one to initiate an ftp.I however do not know how to execute the corresponding commands from java.Is there any way or some specific api(similar to the system command in c) that i can use to perform these operations.I am using j2sdk 1.4.0_01 on a win 98 machine to develop the application.

    See [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html]java.lang.Runtime

  • Deploy wsp through Power Shell- start stop SP admin service and run execadmsvcjobs command using power shell

    Hi,
     Can anyone pls point me any link/ src code  for  deplyoing wsp using power shell. I know I can deploy it through Add-spsolution and install-spsolution, the issue is that, it will give   "status - stuck in deploying scheduled..."
    and i need to restart the sharepoint services - services.msc --> SP administration and timer services - and then i need to run the exceadmsvcjobs command to deploy / update the wsp  successfully in solution store.
    i mean, whats the power shell equivalent of these tasks. or anyone has already scripted these.
    if i elaborate little bit, would like to know how to automatically Retract, Remove, Add and Deploy SharePoint 2010 WSP Solution Files with PowerShell

    ok, i have found  the same :
     here its : hope this will help someone.
    function wait4timer($solutionName)
    $solutionName ="TestingWSP.wsp"
    $solution = Get-SPSolution | where-object {$_.Name -eq $solutionName}
    if ($solution -ne $null)
    Write-Host "Waiting to finish soultion timer job" -ForegroundColor Green
    while ($solution.JobExists -eq $true )
    Write-Host "Please wait...Either a Retraction/Deployment is happening" -ForegroundColor DarkYellow
    sleep 5
    Write-Host "Finished the solution timer job" -ForegroundColor Green
    try
    # Get the WebApplicationURL
    $MyWebApplicationUrl = "http://srvr:21778/";
    # Get the Solution Name
    $MywspName = "TestingWSP.wsp"
    # Get the Path of the Solution
    $MywspFullPath = "D:\myWorkspace\TestingWSP.wsp"
    # Try to get the Installed Solutions on the Farm.
    $MyInstalledSolution = Get-SPSolution | Where-Object Name -eq $MywspName
    # Verify whether the Solution is installed on the Target Web Application
    if($MyInstalledSolution -ne $null)
    if($MyInstalledSolution.DeployedWebApplications.Count -gt 0)
    wait4timer($MywspName)
    # Solution is installed in atleast one WebApplication. Hence, uninstall from all the web applications.
    # We need to unInstall from all the WebApplicaiton. If not, it will throw error while Removing the solution
    Uninstall-SPSolution $MywspName -AllWebApplications:$true -confirm:$false
    # Wait till the Timer jobs to Complete
    wait4timer($MywspName)
    Write-Host "Remove the Solution from the Farm" -ForegroundColor Green
    # Remove the Solution from the Farm
    Remove-SPSolution $MywspName -Confirm:$false
    sleep 5
    else
    wait4timer($MywspName)
    # Solution not deployed on any of the Web Application. Go ahead and Remove the Solution from the Farm
    Remove-SPSolution $MywspName -Confirm:$false
    sleep 3
    wait4timer($MywspName)
    # Add Solution to the Farm
    Add-SPSolution -LiteralPath "$MywspFullPath"
    # Install Solution to the WebApplication
    #Install-SPSolution -Identity <SolutionName> -WebApplication <URLName> [-GACDeployment] [-CASPolicies]
    install-spsolution -Identity $MywspName -WebApplication $MyWebApplicationUrl -GACDeployment #-FullTrustBinDeployment:$true -GACDeployment:$false -Force:$true
    # Let the Timer Jobs get finishes
    wait4timer($MywspName)
    Write-Host "Successfully Deployed to the WebApplication" -ForegroundColor Green
    catch
    Write-Host "Exception Occuerd on DeployWSP : " $Error[0].Exception.Message -ForegroundColor Red
    ref :
    http://www.sharepointpals.com/post/How-to-Deploy-a-SharePoint-2013-Solution-(WSP)-in-the-Farm-using-PowerShell

  • Problem in running system commands using Runtime()

    hi,
    i am trying to run the "dir" command in windows OS using Runtime(). But while
    executing the program i am getting
    java.io.IOException: CreateProcess: dir error=2 error. But if i replace the "dir" command by "notepad" command its working fine. below is the source code.
    class testing
    public static void main(String args[])
         try{
    Runtime rt=Runtime.getRuntime();
    Process p=rt.exec("dir"); //Generating Errors
    //Process p=rt.exec("notepad"); //Working Fine
         }catch(Exception e){System.out.println(e);}
    }plzz help me out.
    thanx

    thats fine its working. i made two changes. First i used an array to send the
    arguments. if we directly use "cmd.exe /c dir" then its converting "/C" to "\C" thus
    producing the error. so i used
    Runtime rt=Runtime.getRuntime();
    String args1[]={"cmd.exe","/C","dir"};
    Process p=rt.exec(args1);But then i got no error no output. From other forums i came to know about capturing the data using input streams and i included the following code.
    BufferedReader Resultset = new BufferedReader
         (new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = Resultset.readLine()) != null)
         {          System.out.println(line);          }Now its working fine. Thanx for ur help.

  • Problem in running Linux command using JavaRuntine

    All,
    When I ran a Linux command in Java Program It does not give a correct output instead it returns null string.
    When I ran the Qsub command( as given in the below program) in Java program I suppose to get Unable to run job: unknown resource "mechhpc1".Exiting. as an output. But it returns null string. It works fine in linux terminal.
    Can you please anyone help me to fix this issue?
    Regards,
    Thamizhannal P
    Source code:
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    public class QSubCmdTest {
         static String Qsub = "sudo -u tce qsub -S /bin/bash ansys_p3 "
                   + "-pe Parallel 3 -l h_rt=3:4:4,ansys=0.333,mechhpc1=0.333 "               
                   + "-a 0804081247.15 /home/tce/c1p4/AnsysParallel";
    /* The aboove command output in terminal (linux machine)
    Unable to run job: unknown resource "mechhpc1".Exiting. */
         static String QSUBcommandOutput = "";
         public static void main(String[] args) {
              System.out.println("Job Submission testing");
              try {
                   Process processExecGenericJobScript = Runtime.getRuntime().exec( new String[]{"/bin/bash","-c",Qsub});
                   //QSUB Command output Reader
                   BufferedReader QSUBcommandOutputReader = new BufferedReader(
                             new InputStreamReader(processExecGenericJobScript
                                       .getInputStream()));
                   System.out.println("Reader "+QSUBcommandOutputReader.readLine());
                   //QSUB command output string
                   String QSUBCommandOutputString = "";
                   while ((QSUBCommandOutputString = QSUBcommandOutputReader
                             .readLine()) != null) {
                        QSUBcommandOutput += QSUBCommandOutputString;
                        QSUBcommandOutput += "\n";
                   System.out.println("QSUBcommandOutput:" + QSUBcommandOutput);
              } catch (Exception exp) {
                   exp.getMessage();
    }

    I would expect error messages to be output on stderr not stdout and you only read stdout. You should read, digest and implement the recommendations in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .

  • Colors details in Performance Graph of OEM 11gR1

    Dear All,
    I use OEM 11gR1 to monitor continuous performance of my database.
    Though what colors represent is described on the right panel, but i need to study them in details and if any abnormal raise in color what actions should be taken.
    Is there any documentation available that I can study?
    Like brown color is concurrency, what does it means in detail and how to avoid the situation?
    Thanks,
    Imran

    Just to state in short.
    1. Graphs mostly contains two part graph + legend
    2. legend will tell you that color used is for what concurrency, ideal wait etc. They are basically waits.

  • Not able to create Oracle External Procedure to Run Host Commands

    Trying to follow this article
    http://timarcher.com/node/9
    Its related to
    Oracle External Procedure to Run Host Commands
    steps
    1)mkdir –p /u01/app/usfapp/oracle_external_procs/oracle_host
    2)
    Author is suggesting to create a file
    but header file is missing in very first line... may be not sure..say it is <stdio.h>Create a file named oracle_host.c. The contents of this file will be:
    #include
    int RunCmd(char *cmd)
    return(system(cmd));
    4) Create the file named makefile. The contents of this file will be:
    oracle_host: oracle_host.o
    gcc -shared -o oracle_host.so oracle_host.o
    $ cat makefile
    oracle_host: oracle_host.o
         gcc -shared -o oracle_host.so oracle_host.o
    5)
    Now run the command make
    The output on my server looks like:
    [u01/app/usfapp/oracle_external_procs/oracle_host]
    banner@usfbannerte [TRNG] > make
    gcc -shared -o oracle_host.so oracle_host.o
    here I stuck .. Not able to run this step ]$ make
    gcc -shared -o oracle_host.so oracle_host.o
    /usr/bin/ld: oracle_host.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    oracle_host.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    make: *** [oracle_host] Error 1
    Any one has any idea what went wrong
    Any other link related to this is most welcomed.
    Please suggest ...

    hi
    please update
    or
    provide any other link / document for
    Oracle External Procedure to Run Host Commands
    --using c
    Thanks in advance.

Maybe you are looking for

  • HT5625 apple id problems with apple id and icloud log on

    hi all you dudes out there? i am having problems with my log on to itunes and icloud? really thye problem began some time ago when i got an upgrade from iphone 3s to iphone 4s, i kept my old iphone as a second phone then gave the old one to my mrs? t

  • Time Machine Partition

    I just bought this used iMac with Leopard and immediately upgraded to Snow 10.6.4. Now Time Machine won't show a partition to back up to; the window is blank and it just makes a button available to Set Up A Time Capsule. How do I get a partition avai

  • Pro*C /AIX /11.1.0.X :demo programs return "duplicate symbol" warnings

    this problem has been raised in SR 7229372.994. Working in 11.1.0.6 or 11.1.0.7 on AIX , compilation of the proc*C "sample1" demo program returns various duplicate symbol warnings: ld: 0711-224 WARNING: Duplicate symbol: p_xargc ld: 0711-224 WARNING:

  • Coldfusion query of queries error

    I have a long query named "Results.Itinerary" in a CFC which I have to add this query to. <CFLOOP QUERY = "Results.Itinerary"> <CFQUERY NAME = "GetPorts" DATASOURCE="x"> SELECT * FROM Itinerary_Ports WHERE (ItineraryID = #ItineraryID#) AND (Name NOT

  • Only want VOIP calls, can it be made to do that?

    Don't want a phone carrier. Rather purchase directly and use for VOIP calls. Possible? If so, where to buy?