Update Quantitative Resssources on CTEM server

Some examples running with Control-M and Control-EM database.
Post Reply
User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Update Quantitative Resssources on CTEM server

Post by fyot » 30 Oct 2006 4:36

There is SQL script example to list difference between QR declared and QR really used.

declare @qr varchar(15)
declare @maxqr int
declare @useqr1 int
declare @useqr2 int
select @qr='QR1'


Select QR definition
MAX_RES is the maximum defined for the QR
QUANT is the available quantity for that quantitative ressources

You need to know ACTIVE NET, use the following script to find it and replace ACTIVE_NET by your result.

select @maxqr=MAX_RES, @useqr1=QUANT from ACTIVE_NETRES_Q where TYPE='D' and RESOURCE_=@qr

Select QR used by Control-M Job at the plan.

select @useqr2=count(*) from ACTIVE_NETRES_Q where TYPE='Q' and RESOURCE_=@qr

Display the result
select @qr as QR ,@maxqr as 'QR MAX', @useqr1 as 'QR Available', @useqr2 as 'QR Really USED'

Result:
QR______QR MAX __QR Available__QR Really USED
-----------------------------------------------------------
QR1_____100______99___________1

Following scripts could be used to update ACTIVE_NETRES_Q table or to suppress old existing QR Used.
Be carefull, don't forget to update Control-M Server database too.

Update QR in xxxxxxxxxRES_Q
update ACTIVE_NETRES_Q set QUANT=MAX_RES where TYPE='D' and RESOURCE_='QR'

Update QR in xxxxxxxxxRES_Q and released old QR used
update ACTIVE_NETRES_Q set QUANT=MAX_RES where TYPE='D' and RESOURCE_='QR'
delete from ACTIVE_NETRES_Q where TYPE='Q' and RESOURCE_='QR'


Be carefull, don't forget to update Control-M Server database too.

Post Reply