About the Metabase

This topic includes the following information:

  • What is the IIS Metabase?
  • Benefits of Plain Text, XML-Formatted Files
  • Starting or Stopping IIS
  • Metabase Features

What Is the IIS Metabase?

The metabase is a hierarchical store of configuration information and schema that are used to configure IIS. The metabase configuration and schema for IIS4.0 and IIS5.0 were stored in a binary file, which was not easily readable or editable. IIS6.0 replaces the single binary file (MetaBase.bin), with plain text, Extensible Markup Language (XML)-formatted files named MetaBase.xml and MBSchema.xml. These files are stored on your computer in the systemroot\System32\Inetsrv folder. Only users who are members of the Administrators group can view and modify these files.The benefits of the plain text, XML-formatted metabase files are discussed later in this topic.

In physical terms, the metabase is a combination of the MetaBase.xml and MBSchema.xml files and the in-memory metabase. The IIS configuration information is stored in the MetaBase.xml file, while the metabase schema is stored in the MBSchema.xml file. When IIS is started, these files are read by the storage layer and then written to the in-memory metabase through Admin Base Objects (ABO), as shown in the following illustration.

Shows the interfaces to the In-memory metabase.

The metabase configuration and schema are stored in separate nodes in the in-memory metabase. The in-memory metabase itself resides in the IIS file cache in the random access memory (RAM) of your computer. For information about starting or restarting IIS, see Starting IIS. While IIS is running, changes that are made to the in-memory metabase are periodically saved to disk. The in-memory metabase also is saved to disk when IIS is stopped. For information about stopping IIS, see Stopping IIS.

Benefits of Plain-Text, XML-Formatted Files

Plain-text, XML-formatted metabase files offer the following benefits:

  • Metabase files can be edited directly using common text editors.
    The metabase configuration file, MetaBase.xml, can be easily read and edited using common text editors, such as Microsoft Notepad. Editing the metabase configuration file directly is primarily for administrators who do not want to use scripts or code to administer IIS. Also, editing the metabase configuration file directly is faster than using IIS Manager when administering IIS over a slow network connection. For information about editing the metabase configuration file, see About Editing the MetaBase.xml File While IIS Is Running.
  • Improved metabase corruption recovery and troubleshooting.
    The metabase makes diagnosis of potential metabase corruption easier because the metabase is stored in a plain-text file and it can be analyzed using tools such as the Windows Resource Kit utility, Windiff. As the metabase is edited and saved to disk, IIS makes copies of each version of the MetaBase.xml and MBSchema.xml files in the history folder. Think of the metabase history feature as an automatic backup mechanism. You can use these plain text history files to compare changes that are made to MetaBase.xml and MBSchema.xml files. For more information, see The Metabase History Feature.
  • Improved metabase backup and restore capabilities on computers that may experience critical failures.
    By using the backup and restore capabilities, administrators can back up the metabase and encrypt it with any password. If a critical failure occurs, the metabase can be restored on a different computer or on a different installation of a member of the Microsoft Windows.NET Server family. Additionally, the metabase can be restored with a previous version of the MetaBase.xml and MBSchema.xml file from the history folder. For more information, see Metabase Reliability.

Starting or Stopping IIS

Starting IIS

When IIS is started or restarted, the metabase configuration that is stored in MetaBase.xml and the schema information that is stored in MBSchema.xml is read by the storage layer and then written to the in-memory metabase through ABOs, as shown in the illustration at the top of this page.

Administrators can modify the MBSchema.xml file when IIS is not running, using programmatic interfaces only. Editing the MBSchema.xml file directly, using a text editor, is not supported. For information about modifying the MBSchema.xml file, see Extending the Metabase Schema.

When IIS is started, the metabase storage layer reads all information from the MetaBase.xml and MBSchema.xml files and copies it to the in-memory metabase through the ABOs.

If the MetaBase.xml file cannot be parsed when IIS is started or restarted, the following happens:

  • An error is sent to the event log.
  • IIS does not start.

The reasons that MetaBase.xml might not be parsed correctly include, but are not limited to, missing XML tags, misspelled property names, or corruption of the MetaBase.xml file. In an attempt to determine the cause of failure, an administrator can use the last history file to determine what has changed in the MetaBase.xml file. If the metabase cannot be parsed, you can also restore the last manual backup or rollback metabase changes using a metabase history file. For more information, see Metabase Reliability.

Stopping IIS

When IIS is stopped, it checks to determine whether the configuration node or the schema node have changed in the in-memory metabase since the last time the in-memory metabase was written to disk. The configuration node contains the metabase configuration, which is stored in the MetaBase.xml file. The schema node contains the metabase schema, which is stored in the MBSchema.xml file.

To minimize the amount of time that is required to stop IIS, the MetaBase.xml file is not written to disk if the configuration node in the in-memory metabase has not changed. If the configuration node in the in-memory metabase has changed since the last time the in-memory metabase was saved to disk, the MetaBase.xml file is overwritten with the contents of the configuration node, and a new history file is created named in the following format.

MetaBase_<majorversion>_<minorversion>.xml

where <majorversion> is set to the next available major version number and <minorversion> is set to zero.

To minimize the amount of time that is required to stop IIS, the MBSchema.xml file is not written to disk if the schema node in the in-memory metabase has not changed. If the schema node in the in-memory schema has changed since the last time the in-memory metabase was saved to disk, the MBSchema.xml file is overwritten with the contents of the schema node and a new history file is created named in the following format.

MBSchema_<majorversion>_<minorversion>.xml

where the major and minor version numbers are the same as the MetaBase_<majorversion>_<minorversion>.xml history file.

Metabase Features

The metabase includes the following features:

  • The metabase schema can be modified by an administrator.
    The metabase schema enforces which properties can be written at a particular key in the metabase. The schema also enforces the data types that can be used for a particular property attribute. You can modify the metabase schema using ADSI to customize this enforcement, or to allow properties that are not well known to be written in the metabase. For detailed information about the well-known properties, see the Metabase Property Reference. For more information about metabase schema, see Metabase Schema.
  • The metabase is 100 percent compatible with IIS5.0 metabase APIs and ADSI.
    Because the XML metabase is fully compatible with IIS5.0 metabase APIs and ADSI, existing scripts and code will continue to work. For more information about the interfaces to the metabase, see About Configuring the Metabase.
  • Metabase performance and scalability are improved.
    The metabase improves performance and scalability over previous versions of IIS in the following ways:
    • Comparable or better disk footprint size compared to the IIS5.0 metabase.
    • Faster read times on Web server startup than the IIS5.0 binary metabase.
    • Equivalent write performance to the IIS5.0 binary metabase.
  • The metabase incorporates rich functionality.
    The metabase incorporates rich functionality with the following features:

Related Topics