C H A P T E R  3

Database Maintenance

The Content Delivery Server database contains a record of all transactions performed by the Content Delivery Server. Over time, the tables containing these transactions can become large and could degrade performance. Periodically remove inactive items from tables in the database.

This section provides information on managing the amount of data in your database. You can delete data that is no longer needed or archive selected data for historical purposes.


3.1 Table Maintenance

Monitor the Content Delivery Server database tables identified in this section and remove items as needed. In addition, perform standard maintenance procedures on the database as recommended by Oracle.

3.1.1 Transaction Tables

The following tables increase in size due to the number of transactions that occur in the Content Delivery Server. You can archive some of the data in these tables to keep the tables a manageable size.

Data can be purged from this table when subscribers or content that they have purchased are no longer active.

Data can be purged from this table when subscribers or content that they have purchased are no longer active.

Data can be purged from this table if the Postpaid Service is used and the data has been processed, or if the reporting service is enabled and up to date.

Data can be purged from this table after a campaign expires.

Data can be purged from this table after a subscriber is deactivated.

3.1.2 Entity Tables

The following tables maintain data entities, such as subscribers and downloadable content. Unused records can be eliminated from these tables and their related tables when the entities become inactive.


3.2 Archiving Data

Tables in the Content Delivery Server database that store records that provide information on system activity can grow quickly. Tables with large amounts of data can adversely affect performance. Use the Oracle export tool exp to back up data, then remove the data from the Content Delivery Server database. See the documentation for your Oracle database for information on the export tool.

To reduce the size of the database, archive the data in the following tables on a regular basis:

Periodically remove the historical data from the table in each Catalog Manager and Vending Manager database. The following code shows sample commands that archive data up to the date specified.


# exp USERID=user-ID/password OWNER=prefix_component_owner FILE=file-name \
  QUERY='WHERE cds_event_date < \'date\'' TABLES='CDS_EVENT'
# sqlplus system/system
SQL> DELETE FROM prefix_component_owner.cds_event where cds_event_date < 'date';
SQL> commit;
SQL> exit
# 

user-ID is a user ID with system privileges for the Oracle database. password is the password associated with the user ID that you are using. prefix is the prefix that you specified in the database configuration file when you created the database that you are archiving. component is ps for the Catalog Manager database and vs for the Vending Manager database. file-name is the name of the file to which data is archived. date is the date up to which data is archived in a date format recognized by the Oracle database.

Periodically remove the historical data from the table in each Vending Manager database. The following code shows sample commands that archive data up to the date specified.


# exp USERID=user-ID/password OWNER=prefix_vs_owner FILE=file-name \
  QUERY='WHERE TRANSACTION_DATE < \'date\'' TABLES='REPORT_DOWNLOAD'
# sqlplus system/system
SQL> DELETE FROM prefix_es_owner.report_download
  2 where transaction_date < 'date';
SQL> commit;
SQL> exit
# 

user-ID is a user ID with system privileges for the Oracle database. password is the password associated with the user ID that you are using. prefix is the prefix that you specified in the database configuration file when you created the database that you are archiving. file-name is the name of the file to which data is archived. date is the date up to which data is archived in a date format recognized by the Oracle database.

Periodically remove the messages that were successfully received from the table in each Vending Manager database using the following commands.


# exp USERID=user-ID/password OWNER=prefix_vs_owner FILE=file-name \
  QUERY='EXTERNAL_MESSAGE_KEY = \'status\'' TABLES='MMS_MESSAGE'
# sqlplus system/system
SQL> DELETE FROM cds_vs_owner.mms_message
 2 where external_message_key = 'status';
SQL> commit;
SQL> exit
# 

user-ID is a user ID with system privileges for the Oracle database. password is the password associated with the user ID that you are using. prefix is the prefix that you specified in the database configuration file when you created the database that you are archiving. file-name is the name of the file to which data is archived. status is the value used by your MMS gateway to indicate that a message was successfully received.