cancel
Showing results for 
Search instead for 
Did you mean: 

Kill Schema Load using CLI

srini_ch
Astronaut
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
5 REPLIES 5

dylanwan
Employee
Employee

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

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?

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.    

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.