Data Retention Periods for SDK Database Objects
  
Version 10.3.00P13
Data Retention Periods for SDK Database Objects
This section covers the procedure for modifying data retention periods for systems collected by Data Collectors deployed via the SDK.
Because data collection continuously adds data to the database, management of the database size becomes an essential task. For objects created via the SDK, a data retention period can be defined along with the database schema, to align with your APTARE IT Analytics reporting requirements. Data retention (purging rules) described in this section apply only to user-defined objects defined by an SDK project; API and database objects are handled by system parameters.
Purging rules (data retention periods) are specific to an object, such as array disk performance, and they are used to maintain corresponding database tables. These rules are configured at the beginning of the object’s definition in the schema template json file.
Best Practice: Configure retention days for objects that accumulate historical data over time, such as array performance. Other objects should not have data retention days.
In multi-tenancy environments, where APTARE IT Analytics domains partition client data, data retention periods can be configured for each domain. The data retention period for a domain applies to that domain and all of its sub-domains. For systems collected by traditional Data Collectors, use the Data Retention tab located: Admin>Advanced>System Configuration.
To enable purging for a user-defined object for a specific domain, take the following steps.
1. Log in to the Portal Server as user aptare.
2. Type the following command:
sqlplus <portal_user>/<portal_password>
where <portal_user> and <portal_password> are portal credentials to connect to the database.
3. At the command line, execute the following SQL statement, substituting relevant values for the variables shown < > in the syntax. See also, Find the Domain ID and Database Table Names, Retention Period Update for Multi-Tenancy Environments Example, and Retention Period Update for SDK User-Defined Objects Example.
INSERT INTO apt_purge_rules (table_name, product_type, table_description, date_column_name, retention_days, default_retention_days, domain_id, creation_date, last_updated)
SELECT table_name, product_type, table_description, date_column_name, <NewRetentionDays>, default_retention_days, <domain_id_value>, SYSDATE, SYSDATE
FROM apt_purge_rules
WHERE domain_id IS NULL
AND table_name = <tableName>;
Commit;
Find the Domain ID and Database Table Names
<domain_id_value>
Most environments have only one Domain ID; however, multi-tenancy environments, such as Managed Service Providers (MSPs), will have a different Domain ID for each of their customers.
To list the currently configured Domain IDs, use the following SQL SELECT statement:
SQL> SELECT * from apt_domain;
<tableName>
Find the relevant database table name for the retention period you want to change SDK User-Defined Database Objects.
Retention Period Update for SDK User-Defined Objects Example
The following example illustrates an update for a Pure Storage performance database table.
INSERT INTO apt_purge_rules (table_name, product_type, table_description, date_column_name, retention_days, default_retention_days, domain_id, creation_date, last_updated)
SELECT table_name, product_type, table_description, date_column_name, 50, default_retention_days, 100007, SYSDATE, SYSDATE
FROM apt_purge_rules
WHERE domain_id IS NULL
AND table_name = 'SDK_PURE_STORAGEARRAY_PERF';
Commit;