Shell script to compare files

Hi all

Here's the example script used to compare two files, this can be further strengthened.

"DATE ='date + %m %d %Y"
TIME ='date + hour %M ' %S
Count = 0
echo "provide the HIGH (for example XXFIN) # | ${T}
read ON
echo "provide the entries of these: FORMS or REPORTS or JAVA or XML or ADMIN_SQL or MODELS.
read TYPE
FILE = ${HIGH} _ ${TYPE} _Compare_File_Results_$ {DATE} ${TIME} .log
= TEE ' tee - a ${FILE} ".
echo "##########################################################################################################################" | ${T}
echo "file Type if binary comparison provides 'B' or 'o'." ${T}
read file_type
echo file_type
echo "file path provide Production." ${T}
read prod_path
echo ' fix file path provide. " ${T}
read fix_path
echo "you have given the path of the Production file as: $prod_path" | ${T}
echo "you have provided the path to the patch as file: $fix_path | ${T}
echo "compare results will show up in the file:" | ${T}
echo "##########################################################################################################################" | ${T}

for release in "r ls $prod_path ';" do #' ls/app/ebs/atgsidev01/gsidev01cust/xxcomn/java/Test/1 /'; do
If cmp s "$prod_path / $release" "$fix_path / $release".
then
echo "test... =" cmp s "$prod_path / $release" "$fix_path / $fix" | "» ${T}
FI
If [version f $fix_path / $]
then
ECHO # "the file exists...". "> > Compare_File_Results.txt

If ['B' - eq "$file_type"];
then

If diff - q ' release$ prod_path / $"" $fix_path / $libération ";
then
ECHO # 'The game of files' $release
on the other
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${T}
echo "file name:" $release | "» ${T}
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${T}
Count = ' expr $count + 1'.
echo "files are different:" $release | ${T}
diff o "$prod_path / $release" "$fix_path / $libération" | ${T} ;
fi # end if diff - q

on the other

If cmp s "$prod_path / $release" "$fix_path / $release".
then
ECHO # 'The game of files' $release
on the other
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${T}
echo "file name:" $release | "» ${T}
echo "==========================================================================================================================" | ${T}
Count = ' expr $count + 1'.
echo "files are different:" $release | ${T}
diff o "$prod_path / $release" "$fix_path / $libération" | ${T} ;
echo "==========================================================================================================================" | ${T}
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" | ${T}
fi #End if the COP/MOP-s

fi #if ['B' - eq]

fi # if [f

fact
echo "##########################################################################################################################" | ${T}
echo "number of files = $count | ${T}
echo "##########################################################################################################################" | ${T}

Thanks for sharing the script!

Tags: Oracle Applications

Similar Questions

  • using DBFS file system for request shell scripts

    Guy
    We use DBFS application shell scripts using Korn shell scripts. The default shell for use is/bin/ksh

    Exadata = X 2-2
    version = 11.2.2.2.1 BP4
    Version Oracle = 11.2.0.2

    WARNING: incorrect syntax, perhaps a fake '-'? See /usr/share/doc/procps-3.2.7/FAQ
    -ksh: xxx.ksh: xxx.ksh: cannot run [bad address]

    When you run as

    ksh xxx.ksh it works fine

    Thank you

    MOS 1054431.1 also discusses this:

    "DBFS filesystems can always hold files of shell script or binary file, but if it is mounted with the direct_io option, files on DBFS is not executable. In this case, a second file DBFS system may be used because it can be mounted without the option direct_io to support executable files or scripts. »

  • Re: Unix shell script to notify if an array has reached a number of lines

    Looking to write a script to send an alert notification when an Oracle database table object reaches a certain value of line number. If anyone has the logic "If this while" for a script shell unix would be great.

    With the logic of control and check on the table when it reaches the total line number can be added to the script and on-demand via cron.

    Thank you.

    Thus, you must periodically (how often?) a COUNT (*) on the target table?  Is this acceptable overhead?

    /Korn Bourne shell scripts can compare numbers and check if one is greater than another.  See "-gt" UNIX - Shell basic operators

    Hemant K Collette

  • Call the batch file and not the shell script using measures of the event

    Can I use EVENTACTIONS at the door of gold like

    eventactions (SHELL, /path-to-batch-file/test1.bat)

    will this work? I am on a windows machine, so I need to run a batch file and not a shell script

    In GGSCI, you can shell OUT to the BONE and call a command/executable file.

    For example on Windows:

    GGSCI (WIN2003) 2 > shell dir

    Volume in drive C has no label.

    Volume serial number is 8CCC-9E58

    Directory of C:\ggs

    18/08/2012 07:23

    .

    18/08/2012 07:23

    ...

    2010-10-15 06:37 bcpfmt.tpl 426

    2010-10-15 06:37 bcrypt.txt 1 725

    22/04/2011 03:41 2 560 category.dll

    05/11/2011 10:43

    cfg

    2010-10-15 07:15 739 chkpt_ora_create.sql

    ...

    What were the results when you tried this in an EVENTACTIONS clause?

  • How to write the CLOB parameter to a file or a XML using shell script?

    I run an oracle stored procedure using shell script. How can I get the OUT of the procedure (CLOB) parameter and write it to a file or a XML in UNIX environment using shell script?
    Edit/Delete Message
    SQL> var c clob
    SQL>
    SQL> begin
      2          select
      3                  DBMS_XMLGEN.getXML(
      4                          'select rownum, object_type, object_name from user_objects where rownum <= 5'
      5                  ) into :c
      6          from    dual;
      7  end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> set long 999999
    SQL> set heading off
    SQL> set pages 0
    SQL> set feedback off
    SQL> set termout off
    SQL> set trimspool on
    // following in the script is not echo'ed to screen
    set echo off
    
    spool /tmp/x.xml
    select :c from dual;
    spool off
    
    SQL>
    SQL> --// file size
    SQL> !ls -l /tmp/x.xml
    -rw-rw-r-- 1 billy billy 583 2011-12-22 13:35 /tmp/x.xml
    
    SQL> --// file content
    SQL> !cat /tmp/x.xml
    
    
     
      1
      TABLE
      BONUS
     
     
      2
      PROCEDURE
      CLOSEREFCURSOR
     
     
      3
      TABLE
      DEPT
     
     
      4
      TABLE
      EMP
     
     
      5
      TABLE
      EMPTAB
     
    
    
    SQL> 
    
  • Unzip the file sys of operation or execute an Oracle stored procedure shell script

    Y at - it a package or something else I can use a procedure stored Oracle to decompress a file of the operating system or run a shell script? Have Oracle 11g 2, Linux Redhat. I am familiar with utl_file to look at properties, open, close, write files, etc., but am looking for a way to decompress a file or run a shell script.

    Without papers, and likely or very likely not supported

    http://technology.AMIS.nl/Blog/5307/Oracle-database-directory-listing-with-ls-function

    There are JVM/Java alternatives to it. Search asktom.oracle.com

    Published by: Marco Gralike on August 23, 2011 22:31

  • Create SQLNET.ora file throug shell script

    How to create a file sqlnet.ora through Solaris shell script?

    I have a little bit of our 11g databases created by another team without sqlnet.ora files and they are now in production.
    I am looking for a simple way to create a file sqlnet.ora via a solaris shell script and send it in the field to be set up by one of our certification authorities.

    OR

    How to write a simple SQL script to create the sqlnet.ora? Then I can create a shell script to run.

    Any ideas will be appreciated?

    Published by: Albert Zaza October 7, 2010 14:06

    Albert Zaza wrote:

    The spec is a little different from what we have vascular. I need to set up some security configuration as well.

    What kind of security config? It will vary from one facility to the other?

    SQLNET.ora is a very simple text file. I have to agree that you should be able to just build one and then distribute it.

    Maybe I didn't explain well enough.

    The problem is that the work will be done my Solaris System Admin (SA) who go out once a month. He takes with him are preparing with the difference, including work on Oracle and work when the package is installed, the work of the Oracle will be as well.

    So what I want is a syntax used to create the file below and then executed by a shell script when the package is installed by the SA.

    #################################################
    sqlnet.ora # Network Configuration file: $ORACLE_HOME/network/sqlnet.ora
    # Generated by Oracle configuration tools.

    NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
    SQLNET. INBOUND_CONNECT_TIMEOUT = 60
    SQLNET. EXPIRE_TIME = 300

    Ok...

    echo "#################################################"  > $ORACLE_HOME/network/admin/sqlnet.ora
    echo "# sqlnet.ora Network Configuration File: $ORACLE_HOME/network/sqlnet.ora"  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    echo "# Generated by Oracle configuration tools."  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    echo ""  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    echo "NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)"  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    echo "SQLNET.INBOUND_CONNECT_TIMEOUT=60"  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    echo "SQLNET.EXPIRE_TIME=300"  >>  $ORACLE_HOME/network/admin/sqlnet.ora
    

    or just to have a copy of the sqlnet.ora and

    cp $source_dir/sqlnet.ora $ORACLE_HOME/network/admin/sqlnet.ora
    

    Published by: EdStevens on October 8, 2010 11:33

  • How to solve this problem in shell script: unexpected end of file

    Hello

    I need to connect to each of the databases listed in/etc/oratab and check what database is stopped (or mounted only) and what database is opened to accept the connection. However, the following shell script gives me this error message:

    $>./check_is_db_runing.sh
    . / check_is_db_runing.sh: line 39: syntax error: unexpected end of file

    Could someone please help me solve this problem, why the code (line 29 to 32) does not work in the LOOP? It works without the LOOP.

    Thanks in advance!



    1 #! / bin/bash
    2
    3 LOGDIR = / oracle/data03/dbscripts
    4 ORATABFILE = / etc/oratab
    5
    6 cat $ORATABFILE | read everything online
    7 do
    8-case $LINE in
    9 \#*) ;; Comment # line in oratab
    10 *)
    11 ORACLE_SID ='echo $LINE | AWK - f: '{print $1}'-'
    12 if ['$ORACLE_SID' = ' *']; then
    13 # NULL SID - ignore
    14 ORACLE_SID =""
    continue 15
    16 IFS
    17
    # 18 continue only if the last field corresponds to 'Y '.
    19 if ["' echo $LINE | '] [' awk - f: '{print $NF}'-' "="Y"]; then
    20 if [' echo $ORACLE_SID | cut b 1'! = '+']; then
    21
    22 ORACLE_HOME ='echo $LINE | AWK - f: '{print $2}'-'
    23 PATH = $ORACLE_HOME/bin: / bin: / usr/bin: / etc
    24 export ORACLE_HOME ORACLE_SID, PATH
    LOGFILE = $25 LOGDIR/check_$ ORACLE_SID.log
    26 touch $LOGFILE
    #echo 27 $LOGFILE
    28
    $29 ORACLE_HOME/bin/sqlplus - s "/ as sysdba" < < EOF > $LOGFILE
    30 select * from global_name;
    exit 31
    32 EOF
    33
    34 fi
    35 fi
    36;
    ESAC 37
    38 fact

    This code works IE. produces newspapers with result sql - slightly modified to be executable:

    #! / bin/bash

    LOGDIR = / tmp
    ORATABFILE = / etc/oratab

    Cat $ORATABFILE | read everything online
    do
    case $LINE in
    \#*) ;; Comment # line in oratab
    *)
    ORACLE_SID ='echo $LINE | AWK - f: '{print $1}'-'
    If------[-z $ORACLE_SID-]; then
    # NULL SID - ignore
    ORACLE_SID =""
    continue

    # Only if the last field corresponds to 'Y '.
    on the other

    ORACLE_HOME ='echo $LINE | AWK - f: '{print $2}'-'
    PATH = $ORACLE_HOME/bin: / bin: / usr/bin: / etc
    export ORACLE_HOME ORACLE_SID, PATH
    LOGFILE = $logdir/check_$ ORACLE_SID.log
    Touch $LOGFILE
    #echo $LOGFILE

    $ORACLE_HOME/bin/sqlplus - s "/ as sysdba" < eof=""> $LOGFILE
    Select * from global_name;
    output
    EXPRESSIONS OF FOLKLORE

    FI
    ;;
    ESAC
    fact

  • shell script for oracle alert.log file

    Hi gurus,

    I want to write the shell script to know the last timing 10 stop of the database of the alerts log file. I'm working on oracle 9i.

    Could someone please advice on that.

    Thanks in advance

    Kind regards
    Shaan

    Published by: Shaan_dmp on January 5, 2009 13:27

    Published by: Shaan_dmp on January 5, 2009 13:28

    Use awk. I have not at hand a 9i but here is a very simple version for 10g XE

    My awk file (line numbers for the notes below - don't include them):

    01:BEGIN { prevline = "";} 02:03:/Completed: alter database close/ {print prevline,FS,$0;}04:05:{prevline = $0;}
    

    The command line and the results (from my alert log 300 k)

    $ awk -f alert.awk.txt alert_xe.logFri Apr 11 18:08:40 2008   Completed: alter database close normalFri May 16 18:53:21 2008   Completed: alter database close normalTue May 20 17:28:23 2008   Completed: alter database close normalThu Jul 17 19:08:52 2008   Completed: alter database close normalFri Aug 15 15:12:48 2008   Completed: alter database close normalWed Nov 05 08:52:59 2008   Completed: alter database close normalFri Nov 14 16:36:03 2008   Completed: alter database close normalTue Dec 09 10:46:23 2008   Completed: alter database close normalMon Jan 05 11:12:22 2009   Completed: alter database close normal
    

    What it means:

    (1) section START line 01 defines the variable to contain the previous line
    (2) the /search chain / line 03 search marker in the file for a stop, and then performs the requested action (print the time that was in the previous line and then this line; use FS (the field to the awk - space normally separator) as a separator
    (3) on line 05 is a statement that we do on each line - is remembered in case it is the timestamp for the closure.

    Now, you can include several cases corner for closures by adding several models of research etc. For more information, google for examples of awk.

    AWK is really good at this sort of thing!

    HTH

    Nigel cordially

  • Get the progress and result of a shell script

    Hello

    I would use a shell script to convert MP3 / audio FLAC files MP3 files with a bitrate of 192kbs and do other things in Automator or AppleScript script.

    So I installed lame and flac with brew, run an Automator process with a selected file and perform an action of AppleScrip:

    on run {input, parameters}
    
      if input is not {} then
    
      repeat with theFile in input
    
      set posix_file to POSIX path of theFile
    
      if input is not {} then
    
      tell application "Terminal"
    
      set thescript to "/usr/local/bin/lame -b 192 \"" & posix_file & "\" "
    
      do script thescript
    
      end tell
    
      end if
    
      end repeat
    
      end if
    
      return input
    
    end run
    

    The Terminal window is there because you tell the Terminal to run your script - try using shell script.

  • AppleScript and shell scripts

    I'm on Mac OS X 10.11.2 and have problems with AppleScript and shell scripting.

    The following script is a cutting of a larger project:

    Tell application "Finder".

    the value the_MePath (path for me)

    the value the_MeCont (the_MePath container) as string

    tell the end

    the value of the_MeCont (text 1 thru-2) the_MeContShell

    -normally isn't here!

    the value the_MePara (the_MeCont & "STH - C Para WAV_48k_24.txt")

    the value the_Parameters (opening for access file the_MePara with permission to write)

    write ("WAV\r24\r48000\r48k\r") the_Parameters

    Close access the_Parameters

    -normally isn't here!

    -destined to be there!

    -the value the_MePara (shell script 'find' & city form the_MeContShell POSIX path & "-iname" "Para STH - C *'")

    the value the_Parameters (opening for access file the_MePara)

    the value the_ParaList (read the the_MePara file)

    Close access the_Parameters

    paragraph 1 of the value userFormat the_ParaList

    paragraph 2 of the the_ParaList the value userBitDepth

    paragraph 3 of the the_ParaList the value userSampleRate

    paragraph 4 of the the_ParaList the value shortSampleRate

    The lines between the "-normally isn't there!"-lines fills a file in the directory of the AppleScript with the data.

    So now the file is there.

    If I remove these lines and enable the line below "-intended to be here! ', the shell should find this file.

    What I get, then, is a mistake:

    "Fehler beim Zugriff auf das Netzwerk." error number - 5000 file "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to "class fsrf".

    to "open for access file the_MePara.

    Any ideas, anyone?

    Kind regards...

    ... Maik

    Hello

    Remove the end of file before the_MePara.

    the_MePara contains a posix path type path--> "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt.

    You can use the file on the path of type HFS --> ' StartupDiskName:Users: shared: _AppleScript development: _Archiv Sniplets:STH - C Para WAV_48k_24.txt.

    Information:

    The script didn't need to open and close the access when the script to read-only.

    Use this line only--> the value the_ParaList to read the_MePara

  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

  • The work of the Disqualification of Linux Shell Script

    Hello

    We are the 11.1.1.7.3 with Weblogic Web server and Linux App Server Disqualification.

    I want to know how we can carry out the work of the Disqualification of the Linux and write these commands in the shell script.

    (1) present the task (run)

    (2) check the employment status to see if the work is in working condition or supplement

    I know that on Windows, it utility jmxtools.jar of command line operations in dnDirector/Tools folder. But I'm not able to find the jmxtools.jar file in one of the edq.home or edq.local.home of the directories under Linux install.

    Can you guide me to the location where the jmx utility will be available under Linux and also the command to check the status of the job?

    Thank you

    Ravi

    It's him!

    Jobs called via the command line interface return an exit status when finished.

    Monitor the precise status of the long-term work requires the use of the server of the Disqualification Console user interface.

  • Call Shell Script from within PL/SQL - using DBMS_PIPE

    Hi all

    I'm trying to run a shell script inside my PL/SQL using DBMS_PIPE block (not sure if this is the right way or not)

    Pl Sql script

    ==========

    Set serveroutput size 100000

    declare

    cursor c1 is select * from mag_images

    where nom_image like '% comp2.

    v_path varchar2 (100): = ' / home/maguzzi/DOCUMENTS_DIR / ";

    v_result number: = 0;

    v_in_filename varchar2 (100): = v_path | ' test_file.jpg';

    v_out_filename varchar2 (100): = v_path | ' test_file_out.jpg';

    v_script varchar2 (100): = "tst_convert.sh";

    v_command varchar2 (200): = 'sh'. v_path | v_script | » '|| v_in_filename | » '|| v_out_filename;

    Start

    A1 to c1 loop

    dbms_output.put_line ('v_command: ' | v_command);

    write_to_file ('test_file.jpg', 'DOCUMENTS_DIR', a1. Content);

    dbms_output.put_line (' file write result: ' | v_result);

    v_result: = exec_host_command (v_command);

    dbms_output.put_line (' resize result :'|| file v_result);

    end loop;

    end;

    Result DBMS_OUTPUT

    ====================

    v_command: /home/maguzzi/DOCUMENTS_DIR/tst_convert.sh test_file.jpg test_file_out.jpg

    Result of the entry of the file: 0

    Result of resizing the file: 0

    PL/SQL procedure successfully completed.

    Function exec_host_command

    =======================

    FUNCTION to CREATE or REPLACE exec_host_command (lc_cmd IN VARCHAR2)

    RETURN INTEGER IS

    ln_status NUMBER;

    lc_errormsg VARCHAR2 (80);

    lc_pipe_name VARCHAR2 (30);

    BEGIN

    lc_pipe_name: = 'Maguzzi_PIPE ';

    DBMS_PIPE. PACK_MESSAGE (lc_cmd);

    ln_status: = dbms_pipe.send_message (lc_pipe_name);

    RETURN ln_status;

    END;

    /

    The Image of the BLOB is written to the correct location on the server "test_file.jpg", and although the exec_host_command function returns a value of 0, the shell script (tst_convert.sh) is not executed (i.e. no output file is created - outfile.txt and the image is not copied/converted to a new file name "" test_file_out.jpg" )

    Shell script

    ========

    tst_convert.sh

    echo 'Here' > outfile.txt

    Echo $1 > > outfile.txt

    Echo $2 > > outfile.txt

    resizing to convert $1 - $200 2

    Could this be problems with permissions on files?

    test_file1.jpg has permission - rw-rw-r-

    test_convert.sh a permission rwxrwxrwx

    When I run the script manually and pass in 2 parameters ($1 = infilename and $2 = outfilename), it works...

    I'd appreciate if someone can point out my mistake or suggest another method that works.

    Thanks in advance

    How long does it take to create the converted file? Remember that the external Scheduler is running asynchronously, so it is possible that the converted file does not exist yet when the PL/SQL block subsequently tries to open it.

    Try to add some delay seconds to the routine to ensure that the external task is completed:

        begin
          dbms_scheduler.create_job(
              job_name => 'MAG_IMAGE_CONVERT2'
            , job_type => 'EXECUTABLE'
            , job_action => '/home/oracle/DOCUMENTS_DIR/tst_convert2.sh' );--  '/home/oracle/DOCUMENTS_DIR/tst_convert.sh');
          dbms_scheduler.enable('MAG_IMAGE_CONVERT2');
          dbms_lock.sleep(3);
        end;
    

    This probably isn't really a viable solution in the long term if it turns out that this is really the problem.

  • CDF to run commands / Shell scripts

    Hi friends,

    I need help serious here regarding the CDF function.

    I created a JAR file to run batch/shell scripts via the calculation script.

    I tested the JAR file and it works perfectly well that run without the calculation script, but I get errors including in Calc script, I get the error message.

    Initially, the error was: error of Machine virtual Java and later, it is class not found.

    Here are the steps to register the CDF:

    1. place the JAR file in the location: E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\udf\

    2. update the file udf.policy with the following statement:

    Grants all permissions to BatEx

    give the code "file:${essbase.java.home}/BatEx.jar" {}

    permission java.security.AllPermission;

    };

    3 restart the Essbase services.

    4. I am trying to create this function at Global level so no mention is not the name of the Application in the MaxL at registration:

    create or replace function '@BatEx' as

    "BatEx.

    Spec '@BatEx(Complete path in double quotes) '.

    Comment "Functions A CDF that runs the batch file in Essbase Server";

    5 this is the calc script:

    @BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat '; -It gives an error: error: invalid syntax 1012000 - not a command CALC [@BatEx]

    I tried another way:

    RUNJAVA @BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat '; -Gives an error: problem running [@BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat']: [can't find @BatEx class]

    Where I am wrong here? Please help me out here.

    Kind regards

    RB

    Thanks much Amit and Jake! I finally cracked!

    Sad thing is that I have found no OTN correct information regarding function Java Custom, rather there was a lot of information about CDFs pre-existing provided by Oracle, so I decided to write a complete solution of CDF, where Java code too was created by the developer of Essbase applications.

    The requirement that I had was to trigger the batch file in the calculation script. Here is the detailed requirement:

    Update Variable of Substitution by planning web form.

    1. the user enters the data in the form of the planning web and saves it.

    2. the calc script attached to the web form, extracts data and records the flat file on Essbase server.

    3. earlier we were executing the script batch on the web server as the workflow will identify the lots on the web server and not on Essbase server, but after the development of this CDF to run the batch job, the batch files can be run directly Essbase server.

    4. the idea is to keep the user limited to the tasks list, so that it does not jump to the to-do list to SubVar web form, workflow and then return to the task list for a simple job to change SubVar.

    There were a few challenges that I encountered during the development of this JAVA function, namely:

    1 function CDF records do not : I tested JAVA code separately using command line and the executable Jar file will execute the batch, as expected. But I couldn't get why my CDF is not have recorded trace. After a lot of searching on Google and analysis, I found that it was the difference between the Version of JAVA (the JAVA compiler I used to compile and create my JAR file) and JAVA (JVM Essbase) virtual machine. I used JDK 1.7 update 65 to compile and create my POT so that the JVM used in the Essbase Server Update 1.6 is 35. I uninstalled JDK 1.7 of my machine, downloaded Update 1.6 35 archives of the Oracle and recompiled the code. Guess what! My CDF function was recorded first.

    So always check the compatibility of the Version of the JDK you used to compile and create the JAR file and JVM on your Essbase server.

    You can check the version of the JVM in console EAS-> EssbaseCluster-> right click-> Edit-> properties-> tab environment. There is a line that appears something like:

    ; JvmModuleLocation $J (EPM_ORACLE_HOME)-...-jdk160_35\jre\bin\server\jvm.dll (the bold is your version of the JVM).

    2. "main class not found" error after successful registration of CDF:

    I haven't had that one category of Public in my JAVA code and this error took me by surprise. I also checked the "public static void main" section in my code and everything seems to be OK. Please note that JAVA is case sensitive - 'hand' and 'Hand' aren't even in JAVA.

    I did some further research and one of John's response to a CDF request, I came to know that I need to include another argument (context) in the main section of my Java code and recompile with classpath "essbase.jar" (I will explain the controls in the next steps). I changed the main section of my JAVA code and included the argument:

    Public Shared Sub main (paramContext context, String [] paramArrayOfString)

    The following JAVA code to perform the batch in Essbase Server:

    import com.hyperion.essbase.calculator.Context;

    import java.io.BufferedReader;

    import java.io.InputStream;

    import java.io.InputStreamReader;

    import java.io.OutputStream;

    import java.io.PrintStream;

    public class BatEx

    {

    Public Shared Sub main (context, paramContext, String [] paramArrayOfString)

    {

    Try

    {

    String str1 = paramArrayOfString [0];

    LocalProcess process = Runtime.getRuntime () .exec (str1);

    InputStream localInputStream1 = localProcess.getInputStream ();

    OutputStream localOutputStream = localProcess.getOutputStream ();

    InputStream localInputStream2 = localProcess.getErrorStream ();

    BufferedReader in = new BufferedReader (new InputStreamReader (localInputStream1)) localBufferedReader;

    String str2;

    While ((str2 = localBufferedReader.readLine ())! = null) {}

    System.out.println (str2);

    }

    System.out.println ("package executed successfully.");

    }

    catch (Exception localException)

    {

    System.out.println ("error!:" + localException);

    localException.printStackTrace ();

    }

    }

    }

    Install the (compatible to Essbase JVM) compatible version of the JDK on your machine. Compile the above code by using the following command:

    C:\ >javac - classpath essbase.jar BatEx.java - please specify the path to the file "essbase.jar". It generally to the location: : \Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\

    The code should compile without any problem, and a .class file must be created with the same name.

    Now is the time to create the JAR file. Use the following command:

    C:\ >jar cf BatEx.jar BatEx.class

    Now the executable JAR file must also be created.

    Place this JAR file: : \Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\udf\

    Restart the service of Essbase and application (the only Application Restarting should work, but I didn't take any chances to restart both).

    Check the log of function CDF recording applications. The application log should be at the location:

    : \Oracle\Middleware\user_projects\epmsystem3\diagnostics\logs\essbase\essbase\app\-

    The CDF enrollment message should be something like:

    External function of [GLOBAL] [@BatEx] saved OK

    I used the following MaxL to register my function in Essbase:

    create or replace function '@BatEx' as

    "BatEx.

    Spec '@BatEx (StringArray).

    Comment "Functions A CDF that runs the batch file in Essbase Server"

    I used the following script to calc to run my CDF (fairly simple however):

    ESS_LOCALE English_UnitedStates.Latin1@Binary

    RUNJAVA BatEx "": / Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat ";" -Note: please replace with the name of the physical drive.

    I went and checked the logs that the Test.bat written and "wallah! The log file had some content and 1 KB in size. I deleted the contents of the log file and checked again, the result was the same.

    Hope this answer helps all of us who work on CDF that is clean.

    Please like this post if this can help you in some way.

    Thanks again to Amit, Jake and John for helping me solve this puzzle.

    Kind regards

    Amit Kumar Singh

Maybe you are looking for

  • Query plugin PPAPI...

    I noticed that this plugin PPAPI is not installed. Around in the autumn of last year, I heard one that adobe Flash Player is a question of threat/malware on Google Chrome, so I uninstalled. I use both Safari and Google Chrome for browsing. Should I p

  • I can't adjust the volume on my computer. Help!

    The shortcut [command + option + up/down arrow] no longer works. My mac has currently no Skype shortcuts to the folder, I can't find them anywhere, not in the keyboard shortcuts, shortcuts to application... nothing. This has happened a few weeks afte

  • Local connection won't open browser

    I can't connect on a hotspot with a browser, even if the hotspot says I'm connected in local mode. Browser says that I am not connected. The hot spot has said they have not seen that happen before. They and I have tried all the usual things without s

  • Error in getLocation()

    Hello I'm trying to get the location using the class LocationProvider getLocation method. But its rising an exception "getLocation() cannot be called from the thread of the event". the function I use is private vector testGPSLocation(){Thread t = new

  • ASA 5505 - several VPN subnet

    I'm trying to set up a VPN for use with the Cisco VPN Client.  I currently have operational VPN, but I cannot allow access to several subnets connected to the ASA.  My current stock of VPN DHCP is 10.0.0.0/24.  I want to VPN users to talk to one of m