Deleting data by using the istool ODBAdmin command
Use the istool ODBAdmin command with the purgedb parameter to delete historical data from the operations database.
The operations database schema is defined so that the deletion of a row that is referenced in other associated tables by a foreign key causes the rows that refer to that row to also be deleted. For more information, see Deleting historical data from the operations database.
istool ODBAdmin purgedb server area selector time_range timeout output
where:- server specifies the system that is used to run the command.
For example:
-server servername
.The server parameter defaults to the engine name specified in the selector parameter. If the selector parameter is not specified, the server parameter must be specified.
- area specifies what type of data is to be deleted. Specify one of these values:
- –runs to delete job run data.
- –resource to delete resource usage data.
- –full to delete job run and resource usage data, and to delete redundant locators.
- –host hostname to delete a single host row. This command returns an error if any job run or resource usage data exists for the host.
- (Optional) selector restricts the deletion of data. Different values are
applicable to each value of the area parameter. If the area parameter is -runs, you can specify one of these values:
- –engine enginename. This option restricts the deletion of data to runs on the named engine. The purge action takes place on this machine, unless the server parameter is specified.
- –project projectname. This option requires that the –engine option is also specified. This option restricts the deletion of data to runs in the named project on the named engine.
If the area parameter is -resources, you can specify one of these values:- –engine enginename. This option restricts the deletion of data to resource usage where the named engine is the head node. The purge action takes place on this machine, unless the server parameter is specified.
- -node nodename. This option requires that the –engine option is also specified. This option restricts the deletion of data to resource usage associated with the named node as managed by the named engine.
If the area parameter is -full, you can specify this value:- –engine enginename. This option restricts the deletion of data to resource usage to the named engine.
If the area parameter is -host, this parameter does not apply.
- time_range restricts the time period that is reported. Only data that was
recorded before this time period is deleted. The time_range parameter takes one of the following formats:
- -upto Number -hours | -days | -months | -years
The -upto parameter treats the current period, which by definition is not yet complete, as one of the Number of periods.
For example, to delete all data recorded before the last two days:-upto 2 days
- -all
- -upto Number -hours | -days | -months | -years
- (Optional) timeout specifies maximum number of minutes before the command
times out. Without the timeout option, the default timeout period for istool ODBAdmin
purgedb command is 5 minutes. If the time taken running the query from the
purgedb command exceeds 5 minutes, you can increase the timeout value.
For example:
-timeout 10
- (Optional) output specifies the file to which the report is written.
For example:
-text filename.txt
Exit status
A return value of 0 indicates successful completion, any other value indicates failure. The list of exit codes is shown in the command help. Enter istool ODBAdmin purgedb -help to see the list of possible exit codes for the purgedb command.
Purge, from server E, all runs within project P on engine E that finished yesterday or earlier
This command purges, from server E, all runs within project P on engine E that finished yesterday or earlier.
istool ODBAdmin purgedb -domain D -authfile af.txt
-runs -engine E -project P –upto 1 -days
Purge, from server E, all runs on engine E that finished more than 24 hours ago
This command purges, from server E, all runs on engine E that finished more than 24 hours ago.
istool ODBAdmin purgedb -domain D -authfile af.txt -runs -engine E –upto 24 -hours
Purge, from server E, all runs and resource usage data that are more than a week old, and all redundant locators
This command purges, from server E, all runs and resource usage data that are more than a week old, and all redundant locators.
istool ODBAdmin purgedb -domain D -authfile af.txt -full –engine E –upto 7 -days
Purge, from server E, all resource usage data for node N on engine E
This command purges, from server E, all resource usage data for node N on engine E.
istool ODBAdmin purgedb -domain D -authfile af.txt –resource -node N –engine E –all
Purge, from server E, all runs and resource usage data for engine E, and all redundant locators
This command purges, from server E, all runs and resource usage data for engine E, and all redundant locators.
istool ODBAdmin purgedb -domain D -authfile af.txt –full –engine E –all
Purge, from server E, engine E from the Host table, assuming all its runs and resource usage data have been deleted, as shown in the previous command
This command purges, from server E, engine E from the Host table, assuming all its runs and resource usage data have been deleted, as shown in the previous command.
istool ODBAdmin purgedb -domain D -authfile af.txt –host E