Purging Database Tables and Modifying Retention > Configure Multi-Tenancy Data Purging Retention Periods
  
Version 10.1.01
Configure Multi-Tenancy Data Purging Retention Periods
In multi-tenancy environments, where StorageConsole 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 that are not multi-tenancy, see Configure Data Purging for SDK User-Defined Database Objects. For systems collected by traditional Data Collectors, use the procedure described in: Configure Data Retention Periods.
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/<portal_password>
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 and Example of a Retention Period Update for Multi-Tenancy Environments.
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 in Data Retention Periods for Historical and Performance Data.
Example of a Retention Period Update for Multi-Tenancy Environments
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, 100001, SYSDATE, SYSDATE
FROM apt_purge_rules
WHERE domain_id IS NULL
AND table_name = 'SDK_PURE_STORAGEARRAY_PERF';
Commit;