Command used to know if Oracle is 64 bit or 32 bit in Unix

What command would you use to tell if Oracle is 64 bit or 32 bit in Unix Systems.??
What command would you use to tell if Solaris running on 64 bit or 32 bit.??
Thnx
Sravan

probably file, I have no solaris here, but I tried on AIX
$ file /app/oracle/product/*/bin/oracle
/app/oracle/product/10.1.0.2/bin/oracle: 64-bit XCOFF executable or object module not stripped
/app/oracle/product/10.1.0.3/bin/oracle: 64-bit XCOFF executable or object module not stripped
/app/oracle/product/10.1.0.4/bin/oracle: 64-bit XCOFF executable or object module not stripped
/app/oracle/product/8.1.7.4/bin/oracle: executable (RISC System/6000) or object module not stripped
/app/oracle/product/9.2.0.5/bin/oracle: 64-bit XCOFF executable or object module not stripped
/app/oracle/product/9.2.0.6/bin/oracle: 64-bit XCOFF executable or object module not stripped
/app/oracle/product/9.2.0.7/bin/oracle: 64-bit XCOFF executable or object module not strippedas you can see, only the 8.1.7.4/bin/oracle kernel is not 64 bits, so it is 32 bits

Similar Messages

  • How to know whether the installed Oracle is 32 bits(or 64 bits)?

    I have installed Oracle 8.1.6 on HP-UX 11(64 bits OS ), But I dont know whether the oracle is 64 bits.
    How can I get to know it?
    Thanks!
    null

    Hi, This is late though, but to let you know that Oracle 8.1.6 is 64-bits
    Duronke
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by zhihui zu ([email protected]):
    I have installed Oracle 8.1.6 on HP-UX 11(64 bits OS ), But I dont know whether the oracle is 64 bits.
    How can I get to know it?
    Thanks!
    <HR></BLOCKQUOTE>
    null

  • What commands used for taking backup of oracle database using BR*Tools

    Can somebody please help me urgently to know what are the commands used for taking backup of oracle database using BR TOOLS.Also specifythe commands in detail which can be used for taking backups of oracle database ,Online Redo log files in databse using BRBACK tool,Archiving of offline, redo log files using BRARCHIVE, and Restoring a Database using BRRESTORE tool Commands(Plese specify the commands with their Syntax used).Also specify the commands with their Syntax which are used for taking backup of oracle database(online,Offline redo log files) into Tapedrives using BRTOOLS commands.
    Thanking You for helping (in advance).

    Dear Ashish,
    BRBACKUP / BRARCHIVE calls the operating system command to copy the files.
    Simple approach to get the commands is as follows.
    1. Set the BR_TRACE (as given in the SAP note 29321) and run the command for which you need to know the OS / SQL commands.
    2. This will generate the log file with the trace information. This trace has the information of the commands used by the job you have run.
    Hope this helps.
    Regards,
    Madhukar

  • I want to use command line to execute an oracle report?

    Dear all,
    I am using Oracle Application. Does anyone know how to use command line to execute an oracle report?
    I mean execute command from client to server.
    Please advice,
    Amy
    Edited by: amychan60 on Dec 13, 2009 11:33 PM

    Hi,
    Using Oracle Application Server the standard way for a client to request a report is via a HTTP request. This doesn't really lend itself to use directly on a command line on a client however you could use the following:
    explorer "http://your_server/reports/rwservlet?report=report_name.rdf&userid=userid/password@db_sid&paramform=no&destype=FILE&desname=c:\temp\filename.pdf&desformat=pdf"
    This will load explorer and submit that URL for you and request the report. You can change the parameters depending on the report output you require.
    If you need something that is silent (ie doesn't load in explorer) you'll need to investigate other ways of submitting that URL request, perhaps using Java. You could also use SRW.run_report (Event Driven Publishing) to submit the request using SQL.
    Cheers,
    Toby.

  • Want to know where oracle stores its command history?

    Hi,
    I want to know that as one user execute a command(sql/PL?SQL)...where this command history is stored in oracle....
    like a table is truncate by user...i just wann to know the detail of user who fired it,timestamp.......
    Thanks in advance

    Hi,
    I am also facing a similar situation where I need to get information as to who changed data last month.
    Can anyone please point me to some documents as to how I can get this information or how can I develop an auditing strategy so that next time I can get this info.
    Thanks

  • ORA-21700 error using sys.xmlType in Oracle 9.2

    I'm working on an application which uses the XMLType column in some of its database tables. When we started, we were using Oracle 9.0.1, and this test code works (which emulates how we have to, in some occasions, populate the XMLType column).
    However, we installed Oracle 9.2.0.3 on the same machine and created database instances using this version of Oracle. We didn't upgrade the original 9.0.1 installation (which still exists side-by-side). When we run this code, we get the following exception...
    java.sql.SQLException: ORA-21700: object does not exist or is marked for delete
    ORA-06512: at "SYS.XMLTYPE", line 0
    ORA-06512: at line 1
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1451)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:862)
    at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1846)
    at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1771)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2361)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:422)
    at com.edh.oracle.TransactionTester.testClob(TransactionTester.java:134)
    at com.edh.oracle.TransactionTester.main(TransactionTester.java:251)
    This exception occurs after we've written the data to a Clob and are attempting to call createXML to update the column.
    Is there anything additional I need to do to get this working in Oracle 9.2 again? Thanks.
    Code is:
    * TransactionTester.java
    * Created on 11 October 2002, 14:08
    package com.edh.oracle;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    * @author ehillman
    public class TransactionTester {
    private static String ORACLE_URL = "jdbc:oracle:thin:@wallaby:7012:CT2";
    /** Creates a new instance of TransactionTester */
    public TransactionTester() throws SQLException {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    private void createTables(Connection conn) throws SQLException {
    String createText = "create table SillyData (XML_VALUE XMLTYPE, XML_STORAGE CLOB)";
    Statement stmt = conn.createStatement();
    stmt.execute(createText);
    System.out.println("Tables created");
    private void dropTables(Connection conn) throws SQLException {
    String dropText = "drop table SillyData ";
    Statement stmt = conn.createStatement();
    stmt.execute(dropText);
    System.out.println("Tables dropped");
    private void testClob() throws SQLException, java.io.FileNotFoundException,
    java.io.IOException {
    System.out.println("testClob - START");
    Connection conn = DriverManager.getConnection(ORACLE_URL,
    "ehillman", "ehillman");
    System.out.println("connection received");
    createTables(conn);
    try {
    System.out.println("Loading MyFn.xml");
    java.io.FileReader inputReader = new java.io.FileReader(
    "C:\\Documents and Settings\\ehillman\\.netbeans\\edh test\\oracle jdbc\\com\\edh\\oracle\\MyFn.xml");
    conn.setAutoCommit(false);
    Statement stmt2 = conn.createStatement();
    stmt2.execute("insert into SillyData (XML_STORAGE) values (EMPTY_CLOB())");
    System.out.println("empty row inserted");
    stmt2 = conn.createStatement();
    ResultSet rs = stmt2.executeQuery("select XML_STORAGE from SillyData for update");
    System.out.println("Empty CLOB retireved");
    rs.next();
    java.sql.Clob clobValue = rs.getClob(1);
    oracle.sql.CLOB oraClob = (oracle.sql.CLOB) clobValue;
    System.out.println("casted");
    java.io.Writer writer = oraClob.getCharacterOutputStream();
    char[] buffer = new char[ oraClob.getChunkSize() ];
    for (int charsRead = inputReader.read(buffer); charsRead > -1; charsRead = inputReader.read(buffer)) {
    writer.write(buffer, 0, charsRead);
    writer.close();
    System.out.println("data written to Clob");
    PreparedStatement pState = conn.prepareStatement(
    "update SillyData set XML_VALUE = sys.XMLType.createXML(?)");
    pState.setClob(1, clobValue);
    int result = pState.executeUpdate();
    System.out.println("executeQuery returned " + result);
    } finally {
    dropTables(conn);
    conn.close();
    System.out.println("connection closed");
    System.out.println("testClob - END");
    * @param args the command line arguments
    public static void main(String[] args) {
    try {
    TransactionTester tst = new TransactionTester();
    tst.testClob();
    } catch (Exception ex) {
    ex.printStackTrace();

    I've found this....
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96620/xdb05obj.htm#1032058
    Does this mean that, for a table to use an XMLType column, it has to have a single schema definition for every row in the table?
    This won't fit for what we're doing.... that is, our table stores XML data for each row, but they are all different types of XML... they don't have the same structure,they don't use the same schema.
    Please let me know if I'm missing something

  • Issuing a simple EXECUTE command using ODP

    I want to issue a command using ODP in C# to refresh a materialized view.
    The command I want to execute is simple: EXECUTE DBMS_MVIEW.REFRESH('USER.MV_TEST','C');
    I have tried with and without the anonymous block BEGIN..END. I have tried issuing it as cmd.ExecuteNonQuery() and cmd.ExecuteReader(), but I always get an error.
    Here is the basic C# source code:
    con.ConnectionString = "User Id=user;Password=123;Data Source=oracle;";
    string cmdQuery = "BEGIN EXECUTE DBMS_MVIEW.REFRESH('USER.MV_TEST','C'); END;";
    OracleCommand cmd = new OracleCommand(cmdQuery);
    con.Open();
    cmd.Connection = con;
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    Anyone know what the problem is?
    Thanks

    Hi,
    Execute is a sqlplus command.
    Try
    string cmdQuery = "BEGIN DBMS_MVIEW.REFRESH('USER.MV_TEST','C'); END;";
    Cheers,
    Greg

  • Spanish characters getting garbled while executing command using Java code

    Hi,
    I try to execute a command using java code. output of the command contains spanish characters. Few of these characters getting garbled after the command execution.
    Runtime r = Runtime.getRuntime();
              Process p = null;
    String pgm="ipconfig /all";
              try
                        p = r.exec(pgm);
    BufferedReader br=new BufferedReader(new InputStreamReader
                                  (p.getInputStream()));
    while((val = br.readLine()) != null){ System.out.println(val);
              catch (Exception e)
                        return (null);
    I tried to run the code using -Duser.language=es -Duser.region=ES -Dfile.encoding=Cp850, but this did nt help. I could see the outputs properly in command prompt,
    If i redirect the output to a text file , it is getting garbled,
    Please let me know to solve this issue.

    884543 wrote:
    Hi,
    I try to execute a command using java code. output of the command contains spanish characters. Few of these characters getting garbled after the command execution.
    Runtime r = Runtime.getRuntime();
              Process p = null;
    String pgm="ipconfig /all";
              try
                        p = r.exec(pgm);
    BufferedReader br=new BufferedReader(new InputStreamReader
                                  (p.getInputStream()));
    while((val = br.readLine()) != null){ System.out.println(val);
              catch (Exception e)
                        return (null);
    I tried to run the code using -Duser.language=es -Duser.region=ES -Dfile.encoding=Cp850, but this did nt help. I could see the outputs properly in command prompt,
    If i redirect the output to a text file , it is getting garbled,
    Please let me know to solve this issue.Set the character set to UTF-8 to your InputStreamReader, for More details on usage refer the java api :
    http://download.oracle.com/javase/6/docs/api/java/io/InputStreamReader.html

  • Getting Error while using  LKM File to Oracle(SQLLDR) KM in ODI

    Hi All ,
    Could anyone please help me out on this error which i am getting while using LKM File to Oracle(SQLLDR)
    My Scenario :
    1. I have my CSV file created in one location with some records .
    2. Created a new interface having this CSV file as source(File Technology) and Table as target (Oracle technology)
    3. Here i want to get the contents from csv and store into the target table by using SQLLDR .For that i am using this KM- LKM File to Oracle(SQLLDR)
    4. By Executing the Interface i am getting following error at step 6 -call sqlldr
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (most recent call last):
      File "<string>", line 22, in <module>
    Load Error: See E:\demo1\file/SALES.log for details
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
      at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:577)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:468)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:662)
    Caused by: Traceback (most recent call last):
      File "<string>", line 22, in <module>
    Load Error: See E:\demo1\file/SALES.log for details
      at org.python.core.PyException.fillInStackTrace(PyException.java:70)
      at java.lang.Throwable.<init>(Throwable.java:181)
      at java.lang.Exception.<init>(Exception.java:29)
      at java.lang.RuntimeException.<init>(RuntimeException.java:32)
      at org.python.core.PyException.<init>(PyException.java:46)
      at org.python.core.PyException.doRaise(PyException.java:219)
      at org.python.core.Py.makeException(Py.java:1166)
      at org.python.core.Py.makeException(Py.java:1170)
      at org.python.pycode._pyx2.f$0(<string>:59)
      at org.python.pycode._pyx2.call_function(<string>)
      at org.python.core.PyTableCode.call(PyTableCode.java:165)
      at org.python.core.PyCode.call(PyCode.java:18)
      at org.python.core.Py.runCode(Py.java:1204)
      at org.python.core.Py.exec(Py.java:1248)
      at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
      ... 19 more
    Here the sales.log file is not created in the above directory .I am not getting  where it is actually went wrong.
    I searched for the solution and i could not find any.Please help me out as it is high priority for me.
    I tried to run SQL*Loader through command prompt and i am able to generate the data in the target table and not getting it through ODI.
    Atleast is there any workaround .Please suggest me.
    Environment Details: ODI_11.1.1.7.0, Oracle DB 11g
    Thanks,
    keerthi

    Which agent are you using to execute?
    Standalone? If standalone, did you start it with OPMN?  I've seen such issues with standalone agent started with OPMN.
    Generally these kind of issues occur when you try to run with standalone agent started with OPMN.
    Because OPMN does not have access to the environment shell variables PATH or ORACLE_HOME and therefore the sqlldr.exe binary (or other Oracle product binary) is not found for execution.
    In this case, you need to specify PATH and ORACLE_HOME variables in opmn.xml file like below for your agent(say "MyStandaloneAgent" in this case)
    <ias-component id="MyStandaloneAgent">
    <process-type id="odiagent" module-id="CUSTOM">
      <environment>
         <variable id="ORACLE_HOME" value="C:\oracle\product\11.2.0\client_1"/>
          <variable id="PATH" value="C:\oracle\product\11.2.0\client_1\BIN;$PATH"/>
    After that, start and stop the agent and try the execution once again.

  • Is there any incompatibility in using different JDBC and Oracle database versions?

    Hi everybody,
    I hope you can answer me ASAP.
    Which version of JDBC driver for Oracle could I use to access an Oracle database version 8.0.4.3.0 running on a SUN machine?
    Is it necessary to use the specific driver concerning to that version or could we use the JDBC version 8.1.6?
    If we decide to use JDBC 8.1.6 to work against the 8.0.4.3.0 database, will we find any incompatibility or problem?
    Thanks.
    null

    I don't know the answer to your question, but while looking for something else, I found a table listing "requirements and compatibilities for oracle jdbc drivers" that might answer your question:
    http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83724/getsta1.htm#1008206
    (My aologies if that URL gets broken apart by this posting software and you have to piece it together.)
    Hope this helps.

  • How to use BULK COLLECT in oracle forms

    hi gurus,
    I am using oracle forms
    Forms [32 Bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionI wanna use bulk collect from database table lets say <employees>
    while working on database level with collections and records it's working very well for me, but when I try to use that technique on oracle forms it hits me error
    error 591 this feature is not supported in client side programmingI know I can use cursors to loop through the records of oracle tables ,
    but I'm convenient while using collections and arrays
    for example
    Set Serveroutput On
    Declare
          Type Rec_T Is Record (     
           Empid Number ,
           Empname Varchar2(100)
          Type V_R Is Table Of Rec_T Index By Binary_Integer;     
          V_Array V_R;
    Begin
       Select Employee_Id , First_Name
       Bulk Collect
       Into V_Array
          From Employees; 
       For Indx In V_Array.First..V_Array.Last Loop
       Dbms_Output.Put_Line('employees id '||V_Array(Indx).Empid ||'and the name is '||V_Array(Indx).Empname);
       End Loop;      
         End;I wanna use this same way on oracle forms , for certain purposes , please guide me how can I use ...
    thanks...

    For information, you can use and populate a collection within the Forms application without using the BULK COLLECT
    Francoisactually I want to work with arrays , index tables ,
    like
             record_type (variable , variable2);
             type type_name <record_type>  index by binary_integer
            type_variable type_name;
            and in main body of program
            select something
            bulk collect into type_variable
            from any_table;
           loop
                type_variable(indx).variable , type_variable(indx).variable2;
           end loop;
           this is very useful for my logic on which I am working
              like
              type_variable(indx).variable || type_variable(indx-1);
             if it's possible with cursors then how can I use cursor that can fullfill my this logic@Francois
    if it's possible then how can i populate without using bulk collect?
    thanks
    and for others replies: if I can use stored procedures please give me any example..
    thanks

  • Using FILTER function in oracle answers

    Gurus,
    I have a question related to using Filter function in oracle answers.
    When trying to insert a Filter (expr) Using (expr) clause in the formula area of a fact table field, It errored out with msg saying about using a wrong measure.
    I know this can be done with a case expression but I tried filter clause since this is available in oracle answers.
    Please help me figuring out this scenario.
    Thanks.

    David / Raghu - Thanks for u'r replies and apologizes for not posting question with proper material.
    Am posting my code and the error message from the screen.
    Code :
    IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0)
    Error :
    nQSError: 10058] A general error has occurred. [nQSError: 22032] Function FILTER requires at least one measure attribute in its first argument. (HY000)
    SQL Issued: SELECT "Dim - MBS Loan"."LOAN AMOUNT", "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK", "Dim - MBS Loan"."LOAN TYPE SEN/SUB", "Dim - MBS Project"."PROJECT NAME", "Dim - MBS Project"."PROJECT NUMBER", "Fact - MBS Loan Transactions"."AR BALANCE INTEREST", "Fact - MBS Loan Transactions"."GL BALANCE INTEREST", IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0) FROM "Financials - MBS"
    OK (Ignore Error)
    Please continue answering my queries. Since am a newbie your answers won't be just a reply but it's actually learning for me.
    Thanks.

  • 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

  • Re: Error while Execute External Operating System Command using T.code SM49

    Dear Experts,
    I Have uploaded one .exe file in the application server (eg: sum.exe) and created the OS command in SM69 transaction .
    And maintained the application server path in the 'operating system command' field in SM69 t.code.
    Our SAP system, oprating system is UNIX.
    After I have executed the external command using transaction SM49 , but I got the below error.
    Can not execute external program (permission denied) , External program terminated with exit code 1
    Immediately I run the SU53 transaction code to check the authorization, but Authorization was successful.
    Could any one please help on this error.
    Thanks in advance.

    >>Can not execute external program (permission denied) , External program terminated with exit code 1
    You need to give the permission as 755 to your file.
    >>I Have uploaded one .exe file in the application server (eg: sum.exe)
    You are on UNIX and do not expect to any result of .exe file as UNIX doesn't know about this.

Maybe you are looking for