Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Monday, February 8, 2016

Select job streams with a specific Time Zone (TZ)

Selecting a job stream with a specific time zone set-up is a bit challenging as there is no out of the box option, the simplest method is to use direct SQL queries as below:
       
alter session set current_schema=<TWS DB user>;

SELECT DISTINCT WKS.WKS_NAME, STREAM.AJS_NAME, TZ.JST_TIMEZONE_ID
   FROM WKS_WORKSTATIONS WKS, AJS_ABSTRACT_JOB_STREAMS STREAM, JST_JOB_STREAMS TZ
WHERE WKS.WKC_ID=STREAM.WKC_ID AND WKS.WKS_NAME like '%<FTA name>%' AND 
      STREAM.AJS_ID=TZ.AJS_ID AND TZ.JST_TIMEZONE_ID = 'Europe/Bucharest'


where:
<TWS DB user> --> the DB user for TWS schema
<FTA name> --> FTA name (eider full or partial, % is a wild card like @)
TZ.JST_TIMEZONE_ID = 'Europe/Bucharest' --> jobs streams with time zone 'Europe/Bucharest'

Select job streams with / without Carry Forward (CF)

Selecting a job stream with carry forward on / off is a bit challenging as there is no out of the box option, the simplest method is to use direct SQL queries as below:
       
alter session set current_schema=<TWS DB user>;

SELECT DISTINCT WKS.WKS_NAME, STREAM.AJS_NAME, CF.JST_CARRY_FORWARD
   FROM WKS_WORKSTATIONS WKS, AJS_ABSTRACT_JOB_STREAMS STREAM, JST_JOB_STREAMS CF
WHERE WKS.WKC_ID=STREAM.WKC_ID AND WKS.WKS_NAME like '%<FTA name>%' AND 
      STREAM.AJS_ID=CF.AJS_ID AND CF.JST_CARRY_FORWARD = 'N'


where:
<TWS DB user> --> the DB user for TWS schema
<FTA name> --> FTA name (eider full or partial, % is a wild card like @)
CF.JST_CARRY_FORWARD = 'N' --> jobs streams without CF, and 'Y' with

Tuesday, April 7, 2015

Plan & Database Audit


TWS Plan & Database updates audit.

We can track the updates on TWS Plan and Database, to switch it on perform the following steps:

   1. Turn on the audit on database:
Change the enDbAudit / da value from 0 to 1 (0=off 1=on).
optman chg enDbAudit=1 or optman chg da=1

   2. Turn on the audit on plan:
Change the enPlanAudit / pa value from 0 to 1 (0=off 1=on).
optman chg enDbAudit=1 or optman chg pa=1

  3. Set-up where to store the audit files:
Set the auditStore / as value to FILE (default) / DB / BOTH (FILE - to be stored in files only, DB - to be stores in TWS DB only, BOTH to be stored in files and TWS DB).
optman chg auditStore=BOTH or optman chg as=BOTH
The audit files can be found in:
On Linux / Unix:
/<TWS_home>/audit/plan or /<TWS_home>/audit/database
On Windows:
<TWS_home>\audit\plan or <TWS_home>\audit\database

!!! NOTE: In the audit file you will find what object was changed, when and by whom, but there is no record of what was changed in that particular object.