company logo

DatabaseHandle :: InitMainBase - Initialize main base

The function allows initializing a new main base. Main bases must be created in consecutive order. The first main base to be created would be main base 0, the next main base 1 etc. A main base 0 is created automatically, when creating a database.

Creating a main base automatically creates a data area 0. Data area size (dasize) and file name refer to data area 0.

Main bases are generating local identities: 0xMMMMNNNNNNNNNNNN. MMMM is the part of the identity that contains the main base number and ranges from 0 to 4 094.

Because of different integer presentations on different platforms databases are platform dependent and must be converted when changing the platform. It is, however, also possible to store data in platform independent format when passing true (YES) for the pindep parameter.

Return value:  Success ( logical  )

Implementation details

logical DatabaseHandle  :: InitMainBase ( int16 mbnumber, NPath &file_path, int64 dasize=0, logical pindep=NO )
  • mbnumber - Main base number

    When defining distributes databases, the main base number allows allocating a specific main base for storing instances created in the context of an owning collection.

    The main base number for instances and index entries is set automatically, when allocating a main base to the extent.

    Main base numbers should not be defined together with the cluster option, since in this case, the cluster creating instance determines the main base for storing data.

    The main base number determines the main base for storing indexes for the collection. Instances owned by the extent are stored in the defined main base, too. Indexes and instances owned by other instances are stored in the same main base as the owning instance, i.e. in the main base of the owning extent. Since the owner hierarchy is unique, the main base for an instance can always be obtained from the schema definition.

  • file_path - - internal feature (not documented)
  • dasize - Size for data area

    When no data area size had been defined (0), the data area expands whenever more space is needed.

    The maximum size for data areas in a 32-bit versions is 4,026,531,840 (0xF0000000) bytes or nearly 4GB. For 64-bit versions, the maximum size is 281,474,976,710,656 or 256 TB.

    Default: 0
  • pindep - Platform independence option

    The platform independence option indicates that integer numbers are to be stored in platform independent format. This information is stored in the database header after creating the database.

    Default: NO