0

Kill Schema Load using CLI

Hello Community!!

Can you please provide any info on how to kill any particular running schema load jobs using CLI? Our ultimate goal is for automating to kill any loading jobs for particular schema if it exceeds the threshold time while extraction or enriching states without having any manual intervention.

Thanks,

Srinivas Chava

7replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • You should be able to see a sample CLI with the name "force_stop_schema_load_sample.sh" in the<Incorta Home>/IncortaNode/bin.
     

    It was introduced since 4.7.5

    Like
      • Srinivas C
      • FBP
      • Srinivas_C
      • 2 wk ago
      • Reported - view

      Dylan Wan Thanks for the response!! Above script is very helpful, but it still solves only one aspect of intended solution. I couldn't find any similar scripts to get the active schema load jobs running and the time elapsed since job start. Can you please help me with this?

      Like
    • Srinivas C  As mentioned by Senthil, you can get the active schema load jobs running and the time elapsed by querying the Incorta Metadata tables.  Please note that the incorta metadata table schema changed a  lot during Incorta 4.9.  In an earlier release, you can use LDR_JOBS (Schema Level) and LDR_JOB_DETAILS (Table level).  Since the Incorta 4.9, we shared IncortaMetadata Dashboards and it uses the business view that access the table called JOB.  The new JOB table include both job history and current running job and include both schema and table level in one table. Querying IncortaMetadata database is not a supported feature unless you go through the incorta business schema _incorta, as shipped in community. 

      A non-published API getSchemaStatus is available but we cannot guarantee that it will be supported in the future, either.
       

      def getSchemaStatus(session, schemaId):
          resp = get(session, "/service/schema/getSchemaStatus?schemaId=" + str(schemaId))
          check_result(resp, 200, None)
          return resp.json()

      The meaning of the status value also changed in 4.9.    

      Like
  • Dylan,

    We are using 4.8.1 version.  I don't find this script under IncortaNode/bin directory.  Can you please share this script?  

    Srinivas,

    We have built custom scripts by retrieving details from  Incorta metadb (oracle) table -> LDR_JOB_DETAILS  to find active schema load jobs.  Our requirement is to alert the support team rather than killing the active job.  This approach is very effective and we are able to get the duration of the active schema job and act accordingly.

    Like
      • Srinivas C
      • FBP
      • Srinivas_C
      • 2 wk ago
      • Reported - view

      SenthilKumar Sivakumar , Thanks for the info. We already have alert system in place. This feature is the extension of that alert solution.

      Like
    • SenthilKumar Sivakumar 

       

      # ************************************************************************
      # Incorta bash api sample force stop schema load job
      # ************************************************************************
      
      cur_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
      incorta_cmd="python $cur_dir/incorta.py"
      
      # login to incorta
      # you have to save the session to be used in every other call
      session=`$incorta_cmd login <INCORTA_URL> <TENANT_NAME> <SUPER_USER> <SUPER_PASSWORD> <VERIFY_CERTIFICATE>`
      # e.g. session=`$incorta_cmd login http://localhost:8080/incorta demo super super`
      
      # Stop if login failed
      if [ -z "$session" ]; then
          exit 1
      fi
      
      #force stop loading job for specified schema
      $incorta_cmd force_stop_schema_load $session schema_name
      # e.g. $incorta_cmd force_stop_schema_load $session 'SALES'
      
      # log out from the server
      $incorta_cmd logout $session
      Like
    • Thank you Dylan.

      Like
Like Follow
  • Status Answered
  • 2 wk agoLast active
  • 7Replies
  • 30Views
  • 3 Following

Product Announcement

Incorta 5 is now Generally Available