Running the Analytics Archive

The Analytics Archive process needs to be run only when Analytics data is to be taken offline. This process does not require any special setup, but does require a location in the file system where the data can be exported.

NOTE: Administrators may optionally move the exported Analytics data to tape or other archive media if desired. Moving to archive media is not within the scope of the Analytics Archive process.

A tool consisting of SQL and Bourne shell scripts has been provided to perform the Analytics Archive export and Analytics Archive restore operations. Those administrators on Windows are required to use an implementation of Bourne shell (or compatible) such as the sh.exe that is installed with the Questra IDM Application Suite Enterprise software in the "qss\db\bin" directory. The tool is described in detail in the following sections.

Required environment

The Analytics Archive tool requires the database client to be installed and configured on the system that is performing the Analytics Archive. This includes the environment variables that are required for the client (e.g., ORACLE_HOME).

The tool also requires two environment variables to be defined:

NOTE: The path and file names for these variables must have UNIX forward slash ("/") rather than DOS or Windows backslash ("\"). For example, use "D:/QSS/ANLExport" rather than "D:\QSS\ANLExport". In addition to the variables, the current working directory must be set to the location where the scripts are located (same as A2B_ANL_ARCH_HOME). Use the CD command to change the current working directory.

Analytics Archive data categories

The Analytics Archive process operates on specific categories of data (whose specific tables are defined in the anl_arch.ini file):

Export operation

The Analytics Archive export operation exports data from the Analytics database and removes the exported data from the database. The usage for the script that performs this operation may be viewed by running the "anl_arch.sh" command with no arguments and is shown below.

Usage: anl_arch.sh <dbvendor> <category> <anldbhost> <anldbname> <anldbuser> <anldbpasswd> <startdate> <enddate>

  <dbvendor>         - DB Vendor: "ora" or "sql"

  <category>         - Archiving Category: "all", "doc",

                       "read", "alarm", "misc"

  <anldbhost>        - Analytics DB server hostname

  <anldbname>        - Analytics DB name

  <anldbuser>        - Analytics DB username

  <anldbpasswd>      - Anayltics DB user password

  <startdate>        - Start date of archiving date

                       range (mm-dd-yyyy)

  <enddate>          - End date of archiving date

                       range (mm-dd-yyyy)

The following example illustrates running the command to export all data for the month of January for an Oracle-based system:

sh anl_arch.sh ora all db.mydomain.com_MYSID myuser mypassword 01-01-2005 01-31-2005

The shell script reports general success or failure of the operation and the details are logged in the Analytics database ANL_ARCH_LOG table.

NOTE: It is highly recommended to run the "analyze statistics" process on Oracle systems after running an Analytics Archive export operation to optimize Analytics database queries.

Restore operation

The Analytics Archive restore operation imports data from a previously exported data set. The usage for the script that performs this operation may be viewed by running the "anl_rstr.sh" command with no arguments and is shown below.

Usage: anl_rstr.sh <dbvendor> <category> <anldbhost> <anldbname> <anldbuser> <anldbpasswd> <startdate> <enddate>

  <dbvendor>         - DB Vendor: "ora" or "sql"

  <category>         - Archiving Category: "all", "doc",

                       "read", "alarm", "misc"

  <anldbhost>        - Analytics DB server hostname

  <anldbname>        - Analytics DB Oracle SID

  <anldbuser>        - Analytics DB username

  <anldbpasswd>      - Anayltics DB user password

  <startdate>        - Start date of archiving date

                       range (mm-dd-yyyy)

  <enddate>          - End date of archiving date

                       range (mm-dd-yyyy)

The following example illustrates running the command to restore all data for the month of January for an Oracle-based system:

sh anl_rstr.sh ora all db.mydomain.com_MYSID myuser mypassword 01-01-2005 01-31-2005

The shell script reports general success or failure of the operation and the details are logged in the Analytics database ANL_ARCH_LOG table.

NOTE: It is highly recommended to run the "analyze statistics" process on Oracle systems after running an Analytics Archive restore operation to optimize Analytics database queries.

Directory structure

While the Analytics Archive tool generates and consumes the contents of the exported data, it may be necessary to understand the underlying directory structure in the file system for the purposes of moving the data to offline media.

A new directory is created for each run of the tool. The directory is named:

$A2B_ANL_ARCH_DATA/startdate-enddate

If you plan to run the tool multiple times with the same date range, you will need to create a hierarchy (and reset the A2B_ANL_ARCH_DATA variable) that isolates the data based on database instance and/or data category. The files that are created within the directory follow this convention:

$A2B_ANL_ARCH_DATA/startdate-enddate/tablename_startdate-enddate.dmp