How to check which jobs use a particular IN condition in Control-M - jobs

I am using Control M Enterprise manager to track jobs.
I have a job with OUT-condition as 'X_OK'.
i am not sure if/where a job is using this as IN-condition.
Is there any way i can search for jobs which have this particular condition as IN-condition.
Thanks.

In the latest Control M workload automation there is an option for searching for jobs having particular IN or OUT condition. Just type the condition and search.

Download the physical data model of your version of Control-M: ftp://ftp.bmc.com/pub/control-m/opensystem/DB_Schemas/
Connect to your Control-M database
To search input conditions look in the tables def_job and def_lnki_p
To search output conditions look in the tables def_job and def_lnko_p
Example:
-- Display all job names that use the IN condition "aaabbbccc"
SELECT
job_name
FROM
emuser.def_lnki_p,
emuser.def_job
WHERE
def_lnki_p.table_id = def_job.table_id AND
def_lnki_p.job_id = def_job.job_id AND
def_lnki_p.version_serial = def_job.version_serial AND
LOWER(def_lnki_p.condition) LIKE '%aaabbbccc%';

All the jobs that are set up in Control M will show the arrows that are connected to each other. So, If X is connected to different jobs, then that will be shown through the out going arrows from X.
Also, if you are finding it difficult to find out this way, do the followign on job X, and you can find out jobs that use the X's OUT condition as their IN condition -
Right Click (on Job X) -> Branch Menu -> Successor -> (The jobs displayed here use the X's OUT-condition as their IN-condition)

Use Neighborhood option . It will give u list of Successor and predecessor jobs

Related

Using Linq to bind dependent SQL rows

enter image description here
I'm trying to find an efficient way to select all dependencies. The idea behind this table is:
Each taskID is a task that will be display to the user.
When taskid 22180 is selected by the user and completed it will
automatically enable the other tasks (activateTaskId = 22180) to
become available to the user hence inactive = 0. Up to that point
everything is fine.
What i need help at is when you have subsequent tasks.
So when taskid (22180) is selected and completed by the user the following tasks become available (22181,22182,22185 and 22186). As you can see if the user selects 22182 then the task dependent on it is 22183 and subsequently 22184 will .
how would i efficiently select all the task that branch off the initial one (22182) no matter how many may exist ?
Thank you

Finding the query that created a table in BigQuery

I am a new employee at the company. The person before me had built some tables in BigQuery. I want to investigate the create table query for that particular table.
Things I would want to check using the query is:
What joins were used?
What are the other tables used to make the table in question?
I have not worked with BigQuery before but I did my due diligence by reading tutorials and the documentation. I could not find anything related there.
Brief outline of your actions below:
Step 1 - gather all query jobs of that user using Jobs.list API - you must have Is Owner permission for respective projects to get someone else's jobs
Step 2 - extract only those jobs run by the user you mentioned and referencing your table of interest - using destination table attribute
Step 3 - for those extracted jobs - just simply check respective queries which allow you to learn how that table was populated
Hth!
I have been looking for an answer since a long time.
Finally found it :
Go to the three bars tab on the left hand side top
From there go to the Analytics tab.
Select BigQuery under which you will find Scheduled queries option,click on that.
In the filter tab you can enter the keywords and get the required query of the table.
For me, I was able to go through my query history and find the query I used.
Step 1.
Go to the Bigquery UI, on the bottom there are personal history and project history tabs. If you can use the same account used to execute the query I recommend personal history.
Step 2.
Click on the tab and there will be a list of queries ordered from most recently run. Check the time the table was created and find a query that ran before the table creation time.
Since the query will run first and create the table there will be slight differences. For me it stayed between a few seconds.
Step 3.
After you find the query used to create the table, simply copy it. And you're done.

Redshift not logging to STL_WLM_RULE_ACTION

I have a Redshift cluster associated with a parameter group that monitors queries via workload management (WLM). I have rules that perform the "log" action whenever the number of rows scanned crosses a threshold (e.g. 100).
However, when I execute the SQL queries that satisfy the rule and then check the STL_WLM_RULE_ACTION table, where the query is supposed to be logged, the table comes up empty. Why is this happening? Am I missing something?
Are you connecting as a Superuser? Only superusers can see all the data in STL_WLM_RULE_ACTION, other users will only see rows for their own queries. If you are executing a query as one user then checking STL_WLM_RULE_ACTION while connected as another (non super-) user you will potentially not see any rows.
Nathan's answer (about data visibility in STL_WLM_RULE_ACTION) is a good one.
You should also double check that your Parameter Group has been applied:
In the AWS Redshift Console, select the your cluster on Clusters page
On the Configuration tab, under Cluster Properties, is Cluster Parameter Group set to the correct group?
You can click on parameter group name to go to it and confirm.
If the parameter group you wanted has not been applied then:
On the Configuration tab, click the Cluster drop down and choose Modify.
Use the Cluster Parameter Group to select the correct group.
Carefully review the other options to avoid unintended changes.
Click Modify to apply the new parameter group.
If Parameter Group Apply Status says "Reboot required" then click the Cluster drop down and choose Reboot.

How to create a Priority queue schedule in Autosys?

Technologies available: Autosys, Informatica, Unix scripting, Database (available via informatica)
How our batch currently works is with filewatchers looking for a file called "control.txt" which gets deleted when a feed starts processing. It gets recreated once completed which allows all "control" autosys jobs waiting, to have one pick up the control file and begin processing data feeds one by one.
However, the system has grown large, and some feeds have become more important than others, and we're looking at ways to improve our scheduler to prioritize feeds over others.
With the current design, of one a file deciding when the next feed runs, it can't be done, and I haven't been able to come up with a simple solution to make it happen.
Example:
1. Feed A is processing
2. Feed B, Feed C, Feed X, Feed F come in while Feed A is processing
3. Need to ensure that Feed B is processed next, even though C, X, F are ready.
4. C, X, F have a lower priority than A and B, but have the same priority and can process in any order
A very interesting question. One thing that I can think of is to have an extra Autosys job with a shell script that copies the file in certain order. Like:
Create input folder e.g. StageFolder
Let's call your current Autosys input folder "the InputFolder"
Have Autosys monitor it and for any file run a OrderedFileCopyScript.sh, every minute
OrderedFileCopyScript.sh should copy one file from StageFolder to InputFolder in desired order only if InputFolder is empty
I hope I made myself clear.
I oppose use of Autosys for this requirement ! Wrong tool !
I don't know all the details but considering an application with the usual reference tables.
In this case you should make use of feed reference table to include relative priorities.
I would suggest to create(or reuse) a table to loaded by the successor job of the file watcher.
1) Table to contain the unprocessed file with the corresponding priority and then use this table to process the files based on the priority.
2) Remove/archive the entries once done.
3) Have another job of this and run like a daemon with start_times/run_window.
This gives the flexibility to deal with change in priorities and keeps overall design simple.
This gives

How to handle reoccurring calendar events and tasks (SQL Server tables & C#)

I need to scheduled events, tasks, appointments, etc. in my DB. Some of them will be one time appointments, and some will be reoccurring "To-Dos" which must be checked off. After looking a google's calendar layout and others, plus doing a lot of reading here is what I have so far.
Calendar table (Could be called schedule table I guess): Basic_Event Title, start/end, reoccurs info.
Calendar occurrence table: ties to schedule table, occurrence specific text, next occurrence date / time????
Looked here at how SQL Server does its jobs: http://technet.microsoft.com/en-us/library/ms178644.aspx
but this is slightly different.
Why two tables: I need to track status of each instance of the reoccurring task. Otherwise this would be much simpler...
so... on to the questions:
1) Does this seem like the proper way to go about it? Is there a better way to handle the multiple occurrence issue?
2) How often / how should I trigger creation of the occurrences? I really don't want to create a bunch of occurrences... BUT... What if the user wants to view next year's calendar...
Makes sense to have your schedule definition for a task in one table and then a separate table to record each instance of that separately - that's the approach I've taken in the past.
And with regards to creating the occurrences, there's probably no need to create them all up front. Especially when you consider tasks that repeat indefinitely! Again, the approach I've used in the past is to only create the next occurrence. When that instance is actioned, the next instance is then calculated and created.
This leaves the issue of viewing future occurrences. For this, you can start of with the initial/next scheduled occurrence and just calculate the future occurrences on-the-fly at display time.
While this isn't an exact answer to your question I've solved this problem before in SQL Server (though database here is irrelevant) by modeling a solution based on Unix's cron.
Instead of string parsing we used integer columns in a table to store the various time units.
We had events which could be scheduled; they could either point to a one-time schedule table that represented a distinct point in time (a date/time) or to the recurring schedule table which is modelled after cron.
Additionally remember to model your solution correctly. An event has a duration but the duration is unrelated to the schedule (but an event's duration may impact the schedule by causing conflicts). Do not try to model duration as part of your schedule.
In the past when we've done this, we had 2 tables:
1) Schedules -> Includes recurrence information
2) Exceptions -> Edit/changes to specific instances
Using SQL, it's possible to get the list of "Schedules" that have at least one instance in a given date range. Then you can expand in the GUI where each instance lies.