Historical data retention scripts

Review the parameters that you can specify when running the historical data retention scripts to make changes such as the history configuration file path or the remote Db2® server name.

get_metrics_retention.sh

The get_metrics_retention.sh script creates a historical configuration file that you can use to review the current data retention settings or the settings that you plan to apply. The historical configuration file is required if you plan to customize the data retention values of individual data sets for agents or data collectors.
-db_inst database_instance
If you used a Db2 database instance name that is different from the default db2apm, use this parameter to specify the name.
-db_name database_name
Specify an alternative name of the Db2 historical database.
-db_port database_port
Specify the Db2 port when it is different from the default 50000.
-h installdir
Specify a different directory from the /opt/ibm default Cloud APM server installation directory.
-help
Display the get_metrics_retention.sh parameters.
-history history_config_file
Specify a different path and name for the history configuration file from the default tmp/history_file.cfg, such as /root/myfile.cfg.
-logName log_name
Specify a different log file name from the default get_metrics_retention.sh_YYYYMMDDHHMM.log.
-logPath log_path
Specify a different directory for storing the log file from the default /tmp.
-pw instance_pw
This is the password for the db2apm instance user, such as db2Usrpasswd@08. If you are using the -db_inst parameter to specify a different instance from db2apm, use the password for that instance. For the get_metrics_retention.sh script, the Db2 instance user password is required only when you specify -retention CURRENT.
-quiet Y|N
The default setting is N. To turn off the Do you want to continue ? (y/n) prompt, use -quiet Y. If you are invoking this script from another script or through automation, you might want to turn off the interactive prompt. You can see the output in the get_metrics_retention.sh_YYYYMMDDHHMM.log.
-retention BEST_PRACTICES|8DAYS|2DAYS|CURRENT
Generates the history configuration file with the best practices, 8 days, 2 days, or current settings.
-server database_server_hostname
When your Cloud APM server connects to a remote Db2 server rather than the default local Db2 server, specify the IP address or fully qualified host name of the Db2 server.
Examples:
This command enters the db2apm default user password and creates a hist/history_file.cfg file with the current settings:
./get_metrics_retention.sh -pw db2Usrpasswd@08 -h /opt/ibm/ccm/hist -retention CURRENT
This command creates a /root/my_config_file.txt history configuration file with the best practices settings:
./get_metrics_retention.sh -history /root/my_config_file.txt -retention BEST_PRACTICES

set_metrics_retention.sh

The set_metrics_retention.sh script creates a historical configuration file that you can use to change the data retention of agent and data collector data sets to adopt the best practices settings, the changes you specify, or to return to the default 8 days data retention values.
-db_inst database_instance
If you used a Db2 database instance name that is different from the default db2apm, use this parameter to specify the name.
-db_name database_name
Specify an alternative name of the Db2 historical database.
-db_port database_port
Specify the Db2 port when it is different from the default 5000.
-h installdir
Specify a different directory from the /opt/ibm default Cloud APM server installation directory.
-help
Display the set_metrics_retention.sh parameters.
-history history_config_file
Specify the name of the history configuration file that you customized and apply to the Db2 historical database (WAREHOUS).
-ksy ksy_home_path
Specify the home path of the Summarization and Pruning Agent for maintaining database partitions and pruning monitoring data in the Db2 server. The default path is installdir/sy.
-logName log_name
Specify a different log file name from the default set_metrics_retention.sh_YYYYMMDDHHMM.log.
-logPath log_path
Specify a different directory for storing the log file from the default tmp.
-override ON|OFF|RESET
By default, -override is set to ON, which means the settings that you apply with the set_metrics_retention.shscript to the Db2 historical database are not changed by Cloud APM updates during upgrades. Unless you include the -override OFF parameter when you run the set_metrics_retention.sh script, or included it when you ran the script previously, the updated historical settings are saved in a WAREHOUSESUMPRUNE_OVERRIDE table to indicate that those values will prevail over any future upgrades.
Setting -override OFF means that the values are valid only until the next Cloud APM upgrade; they will be overwritten by the default Db2 historical database (WAREHOUS) values.
Setting -override RESET remove the entries in the WAREHOUSESUMPRUNE_OVERRIDE table.
-pw instance_pw
This is the password for the db2apm instance user, such as db2Usrpasswd@08. If you are using the -db_inst parameter to specify a different instance from db2apm, use the password for that instance.
-quiet Y|N
The default setting is N. To turn off the Do you want to continue ? (y/n) prompt, use -quiet Y. If you are invoking this script from another script or through automation, you might want to turn off the interactive prompt. You can see the output in the get_metrics_retention.sh_YYYYMMDDHHMM.log.
-retention BEST_PRACTICES|8DAYS|2DAYS|CURRENT
Apply the best practices, 8-day, or 2-day data retention values to the historical database. This parameter is not used if you are specifying the -history parameter.
-server database_server_hostname
When your Cloud APM server connects to a remote Db2 server rather than the default local Db2 server, specify the IP address or fully qualified host name of the Db2 server.