Using optimizeIMDB to Optimize and Report on Metadata Server Memory Usage

About the Metadata Server optimizeIMDB Command Option

To optimize the usage of memory on the metadata server, you should occasionally use the optimizeIMDB command option of the metadata server script. This option analyzes the handling of character variables, checking for items such as unnecessary indexes, long character variables that can be stored as variable-length strings, and duplicate strings. A report is produced showing the expected amount of memory that will be required for each repository after the optimizations are applied. The optimizations are then applied the next time you pause and resume (or restart) the metadata server.
The optimizeIMDB command option is new with SAS 9.3. It replaces the %OMARUNAN macro and the RUNANALYSIS option of %OMABAKUP, which provided similar functionality in previous releases.

When to Optimize Memory Usage

It is not necessary to perform memory optimization on a regular basis. Variable usage is unlikely to change much unless you add or delete a significant percentage of the total metadata in a repository. Optimization is most useful after metadata is first loaded into SAS metadata repositories and after significant updates are applied.

How Memory Optimization Works

The following processing occurs when you use the optimizeIMDB command option:
  • The subprogram accesses the repository data sets in the backup destination. In each data set, it analyzes the handling of character variables. The analysis checks for such items as unnecessary indexes, long character variables that can be stored as variable-length strings, and duplicate strings.
  • If the subprogram identifies optimizations for a repository, it stores the results of the analysis in a data set called DS_VCHAR. This data set is stored in the directory that contains the repository files (for example, MetadataRepositories/Foundation) and in the directory that contains the most recent backup of the repository files.
  • The next time the metadata server is paused and resumed or restarted, it merges the information in each repository's DS_VCHAR data set with the repository's METAIMDB data set. The updated information in the METAIMDB data set is then used to optimize memory usage. The optimizations are not applied to repository data sets on disk.
    After the changes are applied, the DS_VCHAR data sets are deleted from the repository directories (but not from the backup directories).
    The metadata server recovery facility deletes the DS_VCHAR data sets from the backup directories before it restores the repositories to their registered locations.
    Therefore, the optimizations will be lost if you run a metadata server recovery before pausing and resuming (or restarting) the server.

Running the optimizeIMDB Command Option

You should be aware of the following considerations before using the optimizeIMDB command option:
  • Because optimizeIMDB analyzes backup copies of your metadata repositories, a backup copy of the repositories must have been created by using the metadata server backup facility.
  • If your backup directory is on the same machine as the metadata server, then you might want to run optimizeIMDB during a period of low activity to minimize the impact on client applications.
  • The backup facility creates the OMA_Varan.sas7bcat catalog that is used by optimizeIMDB command option. The information in OMA_Varan.sas7bcat reflects the last backup that was made. Therefore, optimizeIMDB analyzes all repositories that were registered at the time of the backup.
  • Because optimizeIMDB does not interact directly with the metadata server, no special user IDs or server privileges are required. However, the user executing the command needs full operating system access to the SAS Metadata Server backup destination path and all subdirectories.
To run the optimizeIMDB command option:
  1. Open a command prompt and navigate to the metadata server start-up directory, which is in the following path: SAS-configuration-directory/Lev1/SASMeta/MetadataServer.
  2. Type one of the following commands:
    • On Windows: MetadataServer -optimizeIMDB
    • On UNIX or z/OS: -optimizeIMDB
  3. When the command is finished, you can review the following reports that are written to the backup directory:
    • Repository_memory_usage_on_date and time.html, which shows the amount of memory that is expected to be required for each repository after the optimizations are applied.
    • reports called repository_id_metaimdb_changes.txt, which list the specific memory optimizations that were identified for each repository
  4. Be sure to pause and resume (or restart) the metadata server to apply the results of the analysis.