4 Replies Latest reply on Aug 26, 2019 3:56 PM by pgeorge1

    Session & Workflow log creation through pmcmd command

    mini mishra Seasoned Veteran

      Hi Frnds,

       

      My requirement is that I am trying to generate session log and workflow log through pmcmd commands using one shell script and finally displaying the same on Autosys screen because as a part of a development team we don't have access to UNIX batch box server or Informatica PowerCenter Application in Production so we can't login and retrieve session logs from there. So, we want some way through which we can generate these logs in some file and then finally display this file on Autosys using cat command,.

       

      I am using below two comands to generate workflow & session logs:

       

      INFMT_CMD2="pmcmd getworkflowdetails -sv $INFMT_SERVICE -d $INFMT_DOMAIN -u $INFMT_USER -p $INFMT_PASS -usd $INFMT_SEC_DOMAIN -f  $INFMT_FOLDER_NAME $WORKFLOW"

      INFMT_CMD3="pmcmd getsessionstatistics -sv $INFMT_SERVICE -d $INFMT_DOMAIN -u $INFMT_USER -p $INFMT_PASS -usd $INFMT_SEC_DOMAIN -f  $INFMT_FOLDER_NAME -w $WORKFLOW s_m_$(echo $WORKFLOW | cut -c4-${#WORKFLOW})"

       

      echo "-- WorkFlow Details are displayed below:" >> $INFMT_LOG

      $INFMT_CMD2 >> $INFMT_LOG

      echo "-- SESSION Details are displayed below:" >> $INFMT_LOG

      $INFMT_CMD3 >> $INFMT_LOG

       

      cat $INFMT_LOG

       

      but problem is that through pmcmd getworkflowdetails I am getting only workflow success or failure statement. I am not getting exact error why the workflow has failed.

       

      For eg: I am able to see only this much part.

      Workflow: [wf_TS_ACT_ORDER_NEW] version [1].

      Workflow run status: [Failed]

      Workflow run error code: [36331]

      Workflow run error message: [WARNING: Session task instance [s_m_TS_ACT_ORDER_NEW] failed and its "fail parent if this task fails" setting is turned on.  So, Workflow [wf_TS_ACT_ORDER_NEW] will be failed.]

      Workflow run id [1294331].

       

      I am NOT getting this exact error which I am able to see in PowerCenter Workflow Monitor:

       

       

      Similarly,by using pmcmd getsessionstatistics command I am able to get stats of rows inserted/updated/deleted and the main error but I am not able to get complete (end to end) session log.

       

      For eg:

      First error code [8229]

      First error message: [WRT_8229 Database errors occurred:

      ORA-00001: unique constraint (ACT_UDM_CDS.PK_TS_ORDER) violated

       

       

      Database driver error...

      Function Name : Execute

      SQL Stmt : INSERT INTO ACT_UDM_CDS.TS_ORDER(BATCH_ID,TENANT_CD,ORD_ID,ORDER_KEY,ORD_DT,SOLICITED_IN,QTY_AM,QTY_ORD_AM,PR_AM,LMT_PR_AM,IMNT_ID,SUFFIX_ID,INVSTR_ID,INVESTOR_NM,CREATOR_ID,CREATOR_NM,ACL_ID,ACL_NM,DURTN_CD,DURTN_NM,ORD_STS_CD,ORD_STS_NM,PLATFORM,REGION,ORD_SRC_CD,IMNT_CCY_ID,BY_SL_CD,QTY_AMT_CD,STP_IN,EXEC_TS,BUSINESS_DATE,LOAD_DATE)  VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ]

      Source success rows: [541]

      Source failed rows: [0]

      Target success rows: [0]

      Target failed rows: [0]

      Number of transformation errors: [0]

      Disconnecting from Integration Service

       

      I am not able to see the record for which this error came.

       

      So, my question is: are there any another commands to get complete (end to end) workflow logs and session logs  instead of pmcmd getsessionstatistics/ pmcmd getworkflowdetails ?

       

      Thanks in advance ...!!!

       

      Regards,

      Komal.

        • 1. Re: Session & Workflow log creation through pmcmd command
          Nico Heinze Guru

          I don't know of any other way EXCEPT if you're willing to program in C.

          There's an API for PowerCenter (the Session Log API, part of the so-called "Informatica Developer Platform" which is the API collection for PowerCenter - despite its Name -) which you can use to process all session log entries at will while the session is running.

          So, what you could do (from a technical perspective) is to take each session log entry and "forward" it from the session to some other computer e.g. using FTP (to name just one example).

           

          My current customer has built a quite nifty system consisting of a Perl program which takes a binary session or workflow log file, "translates" that into plain text (not as good as "infacmd.sh ConvertLogFile" but really fast), and transmits this to a common network share which can be accessed by operators, developers, and admins alike.

           

          Your admin team should be able to provide you with a network share where they can mirror the log files to. But yes, of course that's a matter of policies and endless discussions... Good luck.

           

          Regards,

          Nico

          • 2. Re: Session & Workflow log creation through pmcmd command
            Deepika Srivastava New Member

            Getting the exact value for which it is failing is only possible if your session/workflow is running in Verbose data mode. If it is running in normal mode then values will not be printed.

            • 3. Re: Session & Workflow log creation through pmcmd command
              Nico Heinze Guru

              Not 100% correct (sorry to be so pernickety).

              Whenever a transformation error occurs and the logging level is not set to Terse, the "offending" row will be printed to the session log. But each string field will be abbreviated to at most 255 characters, so chances are that long strings might not be safely identifiable.

               

              But - as of my understanding - this was not the original question. The original question was: how can I get the complete workflow and session log to my local PC if I don't have access rights to the SessLogs/ and WorkflowLogs/ directories.

              And this is a question that can only be answered this way: your network admins should be able to provide you with access. If there are any policies against such access, maybe we can question the reasons for these policies and change them. Maybe.

               

              Regards,

              Nico

              • 4. Re: Session & Workflow log creation through pmcmd command
                pgeorge1 Guru

                Short answer to "are there any another commands to get complete (end to end) workflow logs and session logs  ":

                infacmd GetSessionLog

                infacmd GetWorkflowLog

                Note: this is assuming that you have pmcmd access to the Prod environment that you should also be able to use infacmd with this environment as well.

                 

                From there you will need to parse the file using grep, etc., if you want specific line items, etc.

                 

                Also, on a side note, if there is a row rejection at the target database level, the data will be in the log generally, you do not need Verbose Data for that.