13 Replies Latest reply on Mar 3, 2014 5:18 PM by user2769371

    Unable call maxl script via windows batch job

    user2769371


      Hi All,

       

      I am creating simple batch job to run calc script. some reason system not reading maxl script from batch. please see below

       

      ***Bat file***

      Set MAXL=E:\Essbase\DEV_apps\us\scripts\maxl

      StartMaxl -l %MAXL%\test1.mxl

       

      ***Maxl test1.mxl file****

      login admin123 ******* on test1;

      SPOOL ON TO 'log.txt':

      alter application plan disable connects;

      excecute calculation plan.plan1.testclc;

      logout;

      SPOOL;

      exit;

       

      Please let me know if anyone has come a cross this issue.

       

      Thanking in advance,

        • 1. Re: Unable call maxl script via windows batch job
          $anty

          I think, you should have path upto the location of StartMaxl.bat, in your environment variable "PATH".

           

          For e.g.

          You can provide that in windows batch file at the start, as below:

           

          set PATH=C:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin;%PATH%

           

           

          Hope this helps.

           

          Regards,

          Santy.

          • 2. Re: Unable call maxl script via windows batch job
            955124

            set ESSBASEPATH=E:\Oracle\Middleware\EPMSystem11R1\common\EssbaseRTC-64\11.1.2.0

             

             

            set ARBORPATH=%ESSBASEPATH%

             

             

            essmsh -D E:\Essbase\DEV_apps\us\scripts\maxl  DecryptKey1ID,Key2Password  /* This invokes the Maxl shell command */

             

            Make sure you get the encryption and decryption keys for this Operation.

            • 3. Re: Unable call maxl script via windows batch job
              David Grunwald-Oracle

              For batching you need to:

               

              1.  Confirm that the startMaxL script returns the command line successfully.

               

              IF SO

               

              Make your batch:

               

              1.  Make a copy of *your* working startMaxL.bat - name it test.bat or whatever.

               

               

              Sample

              @ECHO OFF

              REM --------------------------------------------------------------

              REM --                                 --

              REM --                        --

              REM --                                 --

              REM --                                 --   

              REM --------------------------------------------------------------

              @REM This file is created to use essmsh in batch

              @REM Set ESSBASEPATH to the setEssbaseEnv in your system

              call "C:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\bin\setEssbaseEnv.bat"

              set PATH=%ESSBASEPATH%;%PATH%

               

              %ESSBASEPATH%\bin\essmsh.exe  E:\Essbase\DEV_apps\us\scripts\maxl\test1.mxl

               

               

              ------------------------

               

              NOTE:

              The startMaxL script is designed to launch the command line and not run multiple batch file.

              • 4. Re: Unable call maxl script via windows batch job
                user2769371

                Thank you all for you replies, I have made changes to the scripts as your suggestions. But no luck so far. It is opening the maxl command but reading the maxl files. I have already created environment variables and I am running it on 11.1.2.3 version. I have tested in system9 and it is working fine. I am really stuck on this task now.......

                 

                Any other suggestions???

                 

                Thanks

                KK

                • 5. Re: Unable call maxl script via windows batch job
                  user2769371


                  Essbase MaxL Shell 64-bit - Release 11.1.2 (ESB11.1.2.3.003B007)
                  Copyright (c) 2000, 2013, Oracle and/or its affiliates.
                  All rights reserved.

                  ""
                     ERROR -     103 - Unexpected Essbase error 1051293.
                     ERROR - 1051293 - Login fails due to invalid login credentials.

                  MAXL>

                   

                  ID and PW are correct but still getting this error. when I try manually in prompt, it is connecting to the essbase server without any issue. any suggestions?

                   

                  thanks,

                  KK

                  • 6. Re: Unable call maxl script via windows batch job
                    955124

                    The above Error means something is broken somewhere , most of the time it does not mean ID and Password are Invalid . Sometimes if partition is corrupt or any other files related to the application is corrupt we get this error.

                    • 7. Re: Unable call maxl script via windows batch job
                      TimG

                      First, I'd suggest not introducing encryption into this problem (unless you specifically need it), and second, there is nothing wrong with using startMaxl to call MaxL with batch files.

                       

                      The problem is (almost certainly) that you are using the -l switch in your .bat file.  The -l switch tells MaxL to expect a username and password as the next two parameters.  You are not passing a username and password into MaxL, they are contained in your script.  Just get rid of the -l switch.

                      • 8. Re: Unable call maxl script via windows batch job
                        user2769371

                        I already tried without -l, cmd window closing immediately as soon as I run the .bat file.

                         

                        Thanks,

                        KK

                        • 9. Re: Unable call maxl script via windows batch job
                          TimG

                          Are you 100% sure it's not actually running (depending on what that calc does, the whole script may execute very quickly)?

                           

                          If it's not I'd suggest opening a command window, navigating to the directory that contains startMaxL.bat and then entering:

                           

                          startMaxL E:\Essbase\DEV_apps\us\scripts\maxl\test1.mxl

                           

                          Then paste the output here.

                          • 10. Re: Unable call maxl script via windows batch job
                            David Grunwald-Oracle

                            Start with a simple script to get the batch working first.  Perform the suggested following:

                             

                            1.  Open a command line, login via startMaxL

                            2.  Issue desired commands, check for success

                            3.  Create same commands in a script, launch via .bat, check for success

                             

                            The same process must be followed for the encrypted approach to make sure each step works before ultimately moving the whole process into a working batch file.

                            • 11. Re: Unable call maxl script via windows batch job
                              user2769371

                              here is the output - thanks

                               


                              E:\essbase\DEV_apps\us\scripts>startMaxL E:\Essbase\DEV_apps\us\scripts\maxl\tes
                              t1.mxl

                                    essmsh error: Could not open file for reading: E:\Essbase\DEV_apps\us\scri
                              pts\maxl\test1.mxl

                                    essmsh error:
                                    MaxL Shell usage:
                                    msh [-hlsmupED -gk -ep -la] [<file-name> | -a | -i] [<argument> ...]
                                    Meanings of flags:
                                    none : If no <file-name> is given, an interactive MaxL
                                           Command Shell is invoked. Otherwise, statements
                                           are read from <file-name>, in which case a list
                                           of positional parameters may be specified.
                                    -i   : Read statements from standard input. A list of
                                           positional parameters may be specified.
                                    -h   : Prints the whole man page. Any other flags or
                                           arguments are ignored
                                    -l   : Login user before executing the first command.
                                           Assumes the two subsequent tokens to be the user
                                           name and password.
                                    -u   : Login user before executing the first command.
                                           Assumes one subsequent token to be the user name.
                                    -p   : Login user before executing the first command.
                                           Assumes one subsequent token to be password of the user
                                           specified by the '-u' flag.
                                    -s   : Login the user specified by -l or [-u -p -la] flags into the
                                           server specified here.  Assumes one subsequent token
                                           to be the server name.
                                    -m   : Sets the level of messages returned by the shell. Assumes
                                           the following token is the msglevel. Values for <msglevel>
                                           are: default, all (the default), warning, error, fatal.
                                    -a   : Interactive MaxL Shell is invoked, with all
                                           tokens following being interpreted as arguments
                                    -E   : Encrypt MaxL Script. Generates encrypted (or secured)
                                           script at original script's location.
                                           Assumes two subsequent tokens to be script name and public key.
                                           Nested Scripts are encrypted automatically.
                                    -Em   : Encrypt MaxL Script. Generates encrypted (or secured)
                                           script at original script's location.
                                           Assumes two subsequent tokens to be script name and public key.
                                           Nested Scripts have to be encrypted Seperately/Manually.
                                    -D   : Decrypt and execute MaxL Script.
                                           Assumes two subsequent tokens to be secured script name and private
                              key.
                                    -gk  : Generates a new Public - Private Key Pair.
                                    -ep  : Encrypts input data and displays on console.
                                           Assumes two subsequent tokens as data to encrypt and public key.
                                    -la  : Login user, as another user, before executing the
                                           first command. Assumes the three subsequent tokens
                                           to be the username, password and usernameAs.


                              E:\essbase\DEV_apps\us\scripts>
                              E:\essbase\DEV_apps\us\scripts>

                              • 12. Re: Unable call maxl script via windows batch job
                                TimG

                                Thanks for posting that, KK.

                                 

                                Seems like it can't find the .mxl script.  Can you double-check the location, and the spelling, and the file extension (if you've edited it with a text editor you might accidentally have saved it with both the .mxl and a default .txt extension)?  Also, I assume that the location is on the same machine you are running startMaxl from (it certainly looks like it, but in case it's not obvious you can't run a script that is sitting on the Essbase server from a client machine).

                                 

                                If none of that reveals the problem, I suggest that you copy the .mxl script to the same location as startMaxl.bat, then just run (and post that output again):

                                 

                                startMaxl test1.mxl

                                • 13. Re: Unable call maxl script via windows batch job
                                  user2769371

                                  Thank you Tim,

                                   

                                  issue was my test1.mxl was saved as test1.mxl.txt and .txt was hidden. Now is working file once i changed back to test1.mxl.

                                   

                                  Thank you so much for you tips.

                                   

                                  Thank you all for you support.

                                   

                                  KK