Delete command for common metadata assets

Use the istool deletecm command to delete common metadata assets from the metadata repository.

Purpose

When the metadata repository contains assets that you no longer need, you can the delete the assets by specifying them as input to the deletecm command.

The following types of common metadata assets are supported for command-line deletion.
Table 1. Supported common metadata asset types and their command-line deletion parameters
Asset type Parameter for query command

Business intelligence assets
Data connections
Implemented data resources
MDM models
Physical data models

-cm
Logical data models -lm
Data class and data collection analysis assets -dca

You can alternately use the query command to create a file that contains the assets that you want to delete. You can specify that file as input to the deletecm command. You can edit the file to remove assets before you run the deletecm command.

Except for hosts, when you delete an asset, its contained assets are also deleted. You can delete hosts only if they contain no databases, data file folders, connectors, projects, or jobs.

You cannot delete custom attributes and contract libraries by using the command line.

Instead of using a query, you can determine the identity string of a particular asset in the following ways:
  • In InfoSphere® Metadata Asset Manager on the Repository Management tab, browse or search for assets and review properties in the Properties section.
  • In InfoSphere Information Governance Catalog you can take the following actions:
    • Browse the hosts on the Browse tab to find databases and data files.
    • Search or query to find BI assets. When your cursor hovers over the name of an asset in a list, the names of the containing assets are displayed.
    • Search for a type of implemented data resource or BI asset. In the resulting list of assets, the Context column displays the elements of the identity string.

If the delete operation fails to delete one of the assets that are identified, then the entire delete operation is rolled back.

Prerequisites

You must have the Common Metadata Administrator role to delete common metadata assets.

If you use a file as input to the deletecm command, prepare the file correctly:
  • Run the query command with the -outputfile parameter to obtain a properly formatted file that includes both the identity string and the repository ID.
  • Do not combine any of the following types of assets in the same file:
    • BI assets
    • Implemented data resources
    • Physical data model assets

The preferred way to run this command is in the istool command-line window. If you run this command in your operating system command-line window or in scripts, you must add istool before the command name.

Command syntax

Optional parameters and values in the syntax are enclosed in brackets, [ ].

deletecm 
authentication parameters
[generic parameters]
[-preview]
[–force] 
[-inputfile "file_name_and_path"]
-commonmetadata '[-base "base_identity_string"] asset1 [asset2 asset3 ...]' | 
-logicalmetadata '[-base "base_identity_string"] asset1 [asset2 asset3 ...]' | 
-dataclassanalysis '[-base "base_identity_string"] asset1 [asset2 asset3 ...]''

Parameters

authentication parameters
Required. All asset interchange commands use authentication parameters to connect to a specific installation of InfoSphere Information Server.
generic parameters
The generic parameters are available to all asset interchange commands. Use the generic parameters to request help on command syntax, to specify silent or verbose operation, and to use a script to run commands.
-force | -f
Suppresses prompting for confirmation. The command deletes assets without requesting confirmation. Otherwise, you are prompted to confirm deletion of each individual asset.
-preview | -pre
Previews the deletion. The preview lists the identity strings and the repository IDs of the assets that will be deleted when you run the deletecm command. You can use the preview option to ensure that the scope of the deletion is what you expect. Use the -force parameter to suppress the confirmation prompts when you run a preview. No assets are deleted by the preview option.
-inputfile | -if "file_name_and_path"
Specifies a file that contains the assets to delete. The input file must have been created by running the query command.
-commonmetadata | -cm ''| -logical metadata | -lm ''| -dataclassanalysis | -dca ''
Required. You must use one of the parameters to specify types of common metadata assets to query. Specify the -lm parameter to specify logical model assets, the -dca parameter to specify data class and data collection analysis assets, and the -cm parameter to specify all other supported common metadata asset types. If you specify a file by using the -inputfile parameter, you must specify one of the parameters: -cm, -lm, -dca, followed by two single quotation marks (').
You can specify the identity strings of one or more assets to delete. The format of the identity string is described in Common metadata asset types and identity strings for the command line. You can use wildcards to specify multiple assets.
Use a single space to separate each asset that you specify. Identity strings and options must be contained within the single set of single quotation marks (' ') that follows the parameter that indicates which type of metadata is being deleted. You can use the following option:
-base "beginning_section_of_identity_string"
Specifies the beginning section of an identity string that applies to all the assets that you specify in the command. The -base option can be used as a shortcut when each asset is contained in the same identity hierarchy. Surround the value with double quotation marks ("). Specify the remainder of each identity string separately for each asset, separating each with a single space.
Note: Do not specify the final forward slash (/) in the value of the -base option, and do not add that forward slash to the beginning of the values of the remainders of the identity string.
For example, to delete three database tables that are in the same schema, you can specify -base "/host_name/database_name/schema_name" and then specify just the name and extension for each database table: table1.tbl table2.tbl table3.tbl.

Example

The following command creates a preview of the assets to be deleted in the file c:\to_delete_commonmetadata.txt.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd 
-preview -inputfile "c:\to_delete_commonmetadata.txt"
 –cm ''
The following command deletes all the supported logical metadata assets in the file c:\to_delete_logicalmetadata.txt.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd 
-inputfile "c:\to_delete_commonmetadata.txt"
 –lm '' 
The following command deletes the database tables table1 and table2 in the databases db1 and db2.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd 
 –cm '/myhost/db1/schema1/table1.tbl /myhost/db2/schema1/table2.tbl' 
The following command deletes the table7 and table8 database tables in the database db1.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd 
 –cm '-base "/myhost/db1/schema1" table7.tbl table8.tbl' 
The following command deletes the BI report queries that are contained by the BI report bi_report1.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd –cm 
'/bi_server1/bi_folder_name1/bi_report1/*/*.rds'
The following command uses the -base option to delete two BI collections.
deletecm –dom ABC:9443 –u xmetauser –p xmetapwd –cm 
'base="/bi_server1/bi_folder1/model_name2/collection_namespace1" 
collection_name01.ocl collection_name02.ocl'
The following command deletes the data class and data collection analysis assets that are in the file c:\dca_dataclassanalysis.txt. Prompts for confirmation are suppressed.
deletecm -domain ABC:9443 -username isadmin -password isadmin -inputfile c:\dca_dataclassanalysis.txt -dca '' -force