Query command for common metadata assets
Use the istool query command with the -cm, -lm, or -dca parameters to list common metadata assets that are stored in the metadata repository.
Purpose
You can use the query command to get the repository ID and identity string of one or more assets. You can write the results to a file.
Asset type | Query parameter |
---|---|
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 |
If you want to delete the queried assets, you can use the output file as input to the deletecm command.
When you have many assets in the repository, it might be more efficient to do successive queries. For example, you could first run a query to find all the schemas in the repository, and then run a second query on only those schemas that have database tables that you want to delete.
Prerequisites
You must have the Suite User role.
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, [ ].
The symbols &|
used
together indicate and/or.
query
authentication parameters
[generic parameters]
[-outputfile ["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, or to use a script to run commands.
- -outputfile | -of ["file_name_and_path"]
- Specifies that the query results are written to a file. Each type
of metadata that you specify in the command is written to a separate
file, with an identifying suffix. For example, if you export all three
types of metadata with the same command, and specify inventory.txt as
the output file name, the files are named inventory_commonmetadata.txt,
inventory_logicalmetadata.txt, and inventory_dataclassanalysis.txt.
If you do not specify a file name and path, the results are written
to a file named query_output_metadata_type.txt in
the current directory; for example, query_output_logicalmetadata.txt.
The results include the repository ID (RID) of each asset and the
identity string of each asset.
The output file is not created if the file path contains a period (.) in addition to the period before the file extension.
If the query result contains an asset that does not have required attributes in the identity string, such as database name, Invalid Identity is written to the output in place of the identity string.
- -commonmetadata | -cm '' &| -logicalmetadata | -lm '' &| -dataclassanalysis | -dca ''
- Required. You must use one or more of the parameters to specify types of common metadata assets to query. Use 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.
Example
The following command writes the identity string and repository ID of the database db1 to the file c:\to_delete_commonmetadata.txt.query –dom ABC:9443 –u xmetauser –p xmetapwd -outputfile "c:\to_delete.txt" –commonmetadata '/host1/db1.db'The following command writes a list of BI reports whose names begin with
repto the file.
query –dom ABC:9443 –u xmetauser –p xmetapwd -of "c:\to_delete.txt" –cm '/bi_server1/bi_folder1/rep*.rdf'The following command selects the tables that begin with
tablein schema1, and writes them to the file query_output_commonmetadata.txt.
query –dom ABC:9443 –u xmetauser –p xmetapwd –commonmetadata '/host1/db/schema1/table*.tbl'The following command queries which hosts, databases, and database schemas the specified repository contains, and writes the result to the file query_results_commonmetadata.txt.
query –dom ABC:9443 –u xmetauser –p xmetapwd -cm '/*.hst /*/*.db /*/*/*.sch' -of "C:\query_results.txt"The following command uses the -base option to write the details of all the tables that belong to schema1 and schema2 in database db1 to the file.
query –dom ABC:9443 –u xmetauser –p xmetapwd -cm '-base "/hostname/db1" schema1/*.tbl schema2/*.tbl' -of "C:\query_results.txt"The following command writes all data class and data collection analysis assets to the file dc_dataclassanalysis.txt.
query -domain ABC:9443 -username isadmin -password isadmin -outputfile c:\dc.txt -dca '/*/*.dc /*.als'
- All database schemas in the metadata repository to the file all_commonmetadata.txt
- All logical models to the file all_logicalmetadata.txt
- All data classes in Namespace1, and all data collection analysis assets in the InfoSphere Information Analyzer project Analyses1, to the file all_dataclassanalysis.txt
query -domain ABC:9443 -username isadmin -password isadmin -outputfile c:\all.txt -cm '/*/*/*.sch' -lm '/*/*.lm' -dca '/Namespace1/*.dc /Analyses1.als'