Page 1 of 1

How can I delete tables with Control-M utility?

Posted: 30 Jan 2009 3:20
by SteveR
Due to testing requirements we have in our testing environment 10 times the productive Control-M jobnet with about 250 jobs each (everyone with unique application, table, condition, etc. name). Up to today we are updating them manually.
I created a small jobnet which copies the productive jobnet automatically by exporting it as xml-file (with utility exportdeftable), updating to corresponding values with some individual changes for each jobnet (with stream editor), which creates each time a new jobnet and importing the new tables to Control-M (with utility deftable), which works fine so far. 8)

However, I could not find a way to overwrite or delete existing tables which gets the deftable utility to abort ("table xy already exists in database"). So each time I have to manually delete all old tables in the scheduling table manager to get a successful run. :(

Is there a utilty or a way to delete existing tables in a datacenter without deleting them in scheduling table manager?

Thanks for your help
Steve

Posted: 30 Jan 2009 4:29
by schidl
Hi,

you can use the deftable switch /o:

/o Overwrite. The /o switch directs the utility to overwrite any existing tables.

Works since release 6.2.x.

Regards,
schidl

Posted: 03 Feb 2009 1:50
by philmalmaison
%ctmem63> deftable

Description: deftable
The deftable utility imports scheduling tables and groups into the
CONTROL-M/EM database, according to definitions supplied in an XML file.

Usage:
deftable [-USERNAME <user> [-PASSWORD <password>] | -PASSWORD_FILE <password>] -HOST <GUI> -SRC_FILE <XML> [/a][/o]

- or -
deftable [-u <user> [-p <password>] | -pf <password>] -s <GUI> -src <XML> [/a][/o]

Switches can be specified in any order.

OPTIONS:
/? Displays utility's description and available options.
/a Accept all. Directs the utility to automatically reset the Author parameter
to the current CONTROL-M/EM user when these two values do not match.
If not specified, the utility skips every job definition whose Author does
not match the currently logged in user.
/v Verbose messages.
/o Overwrites an existing table definitions in CONTROL-M/EM database,
or creates a new one if absence.

/t Operate on a single table at a time, to reduce process' memory.

Posted: 03 Apr 2009 7:05
by mauriziog
I use the deftable option /o (and often the /a):

/a Accept all. The /a switch directs the utility to automatically reset the Author parameter to the current CONTROL-M/EM user when these two values do not match. If not specified, the utility skips (that is, does not process) job definitions whose Author does not match the currently logged in user.

/o Overwrite. The /o switch directs the utility to overwrite any existing tables.

Posted: 21 Apr 2010 5:19
by arno76
I'd like to remove table from controlM with the CLI, does anyone know how i can do?

because /o Overwrite mean that the table already exist

thanks

Posted: 21 Apr 2010 6:16
by Walty
Hi,

It seems to me that the utility <cli> can't delete a Scheduling Table.
Try the <ctmpsm> utility with this syntax:

ctmpsm -SCHEDTAB -REMOVE <your Scheduling Table>

You received message like this when utility was executed:

Deleting Scheduling Table name '<your Scheduling Table>'

Note: Your table is deleted only from Control-M/Server , you can access them from the 'Scheduling Table Manager'.

Posted: 22 Apr 2010 10:22
by arno76
thanks for answer but not applicable for my probleme
is there an sql request which can do this delete everywhere?

Posted: 22 Apr 2010 11:45
by Walty
Hi,

I don't know exactly what is your situation but you can try:

1) Check if Scheduling Table exist in Control-M/S
ctmpsm -SCHEDTAB -LISTTABLE <your Scheduling Table>

2) If exist and you want to delete
ctmpsm -SCHEDTAB -REMOVE <your Scheduling Table>

3) Check if Scheduling Table exist by SQL in Control-M/EM Database (DEF_TABLES)
select DATA_CENTER, SCHED_TABLE, TABLE_ID from DEF_TABLES where SCHED_TABLE='<your Scheduling Table>'

4) If exist and you want to delete by SQL
delete from DEF_TABLES where SCHED_TABLE='<your Scheduling Table>' and TABLE_ID='<your_table_id>'

Note: The delete by SQL is not necessarily recommended, be careful