Skip to main content

Globals (Tools/APIs)

Manage globals programmatically (import, export, get size, set collation, configure mappings, and so on).

Background Information

InterSystems IRIS® data platform stores all data in its databases in globals. A single set of rules governs the names of globals and the names of their subscripts (that is, different languages do not have different rules). See Introduction to Globals and Using Globals.

You can define global mappings so that you can access data in a non-default location; see Configuring Namespaces. Typically you do this within the Management Portal.

The Management Portal also provides options for examining and managing globals. See Managing Globals.

Available Tools

The fundamental tool for working with globals is the ObjectScript language. In addition, InterSystems provides the following tools:

^%GSIZE routine

Enables you to obtain information on the size of globals. As of release 2024.1, this routine provides options for estimates, which are useful in the case of large globals that are time-consuming to fully examine.

Availability: All namespaces.

This structured system variable returns information about globals.

Availability: All namespaces.

Provides the following class methods:

  • Export()

  • Import()

Availability: All namespaces.

Enables you to see and modify properties of globals. It provides the methods like the following:

  • CheckIntegrity()

  • CollationSet()

  • GetGlobalSize()

  • GetGlobalSizeBySubscript()

  • KillRange()

  • And others

This is a persistent class containing information about all globals. Given a global name, you can use Open() to open an instance of the class and access properties such Directory, IsEmpty, and Collation.

Availability: All namespaces.

Provides the queries that return information about globals such as the namespaces they are available in, the database they are stored in, and whether they have subscripts. The available queries are as follows:

  • DirectoryList()

  • NameSpaceList()

  • NameSpaceListChui()

  • Size()

Availability: All namespaces.

Provides an interface to globals. It includes methods like the following:

  • GlobalListClose()

  • Kill()

  • Set()

  • And others

It also provides a couple of queries.

Availability: All namespaces.

Provides the following methods that you can use with globals:

  • Export()

  • ExportToStream()

  • Load()

Availability: All namespaces.

Maintains extent definitions and globals registered for use by those extents. It includes the following methods:

  • GlobalUses()

  • GlobalsUsed()

The %ExtentMgr tables are visible to SQL and can be queried directly. For details, see the reference for %ExtentMgr.UtilOpens in a new tab.

Availability: All namespaces.

Enables you to modify and obtain information about the [Map.xxx] section of the CPF, which defines global mappings. (Note that you usually perform this configuration via the Management Portal, as noted above.)

The class also provides the List() class query.

The class documentation includes examples and details.

Availability: %SYS namespace.

%Installer.ManifestOpens in a new tab class and other classes in the %Installer package

Enable you to define and use an installation manifest. Among other tasks, you can configure global mappings.

Availability: All namespaces.

Note

The special variable $SYSTEM is bound to the %SYSTEM package. This means that instead of ##class(%SYSTEM.class).method(), you can use $SYSTEM.class.method().

FeedbackOpens in a new tab