sqledbdescext data structure
The extended
database description block (sqledbdescext) structure
is used during a call to the sqlecrea API to specify
permanent values for database attributes.
The extended
database description block creates the default storage group, chooses
a default page size for the database, or specifies values for new
table space attributes that have been introduced. This structure is
used in addition to, not instead of, the database description block
(sqledbdesc) structure.
If this structure is not passed to the sqlecrea API,
the following behavior is used:
- The default storage group, IBMSTOGROUP, is created.
- The default page size for the database is 4096 bytes (4 KB)
- If relevant, Db2® database systems determine the value of the extended table space attributes automatically
Note: Although, you can create
a database specifying the AUTOMATIC STORAGE NO clause, the AUTOMATIC
STORAGE clause is deprecated and might be removed from a future release.
API and data structure syntax
SQL_STRUCTURE sqledbdescext
{
sqluint32 sqlPageSize;
struct sqleAutoStorageCfg *sqlAutoStorage;
struct SQLETSDESCEXT *sqlcattsext;
struct SQLETSDESCEXT *sqlusrtsext;
struct SQLETSDESCEXT *sqltmptsext;
void *reserved;
};
SQL_STRUCTURE sqleAutoStorageCfg
{
char sqlEnableAutoStorage;
char pad[3];
sqluint32 sqlNumStoragePaths;
char **sqlStoragePaths;
};
SQL_STRUCTURE SQLETSDESCEXT
{
sqlint64 sqlInitSize;
sqlint64 sqlIncreaseSize;
sqlint64 sqlMaximumSize;
char sqlAutoResize;
char sqlInitSizeUnit;
char sqlIncreaseSizeUnit;
char sqlMaximumSizeUnit;
};
SQL_STRUCTURE sqledboptions
{
void *piAutoConfigInterface;
sqlint32 restrictive;
void *reserved;
};
sqledbdescext data structure parameters
Field name | Data type | Description |
---|---|---|
SQLPAGESIZE | sqluint32 | Specifies the page size of the default buffer pool as well as the initial table spaces (SYSCATSPACE, TEMPSPACE1, USERSPACE1) when the database is created. The value given also represents the default page size for all future CREATE BUFFERPOOL and CREATE TABLESPACE statements. See the information that follows this table for values. |
SQLAUTOSTORAGE | Pointer | A pointer to an automatic
storage configuration structure. This pointer enables or disables
automatic storage for the database. If a pointer is given, automatic
storage may be enabled or disabled. If NULL, the default storage
group is created and a single storage path is assumed with a value
determined by the dbpath passed in, or the database
manager configuration parameter, dftdbpath. |
SQLCATTSEXT | Pointer | A pointer to an extended table space description control block (SQLETSDESCEXT) for the system catalog table space, which defines additional attributes to those found in SQLETSDESC. If NULL, the database manager determines the value of these attributes automatically (if relevant). |
SQLUSRTSEXT | Pointer | A pointer to an extended table space description control block (SQLETSDESCEXT) for the user table space, which defines additional attributes to those found in SQLETSDESC. If NULL, the database manager determines the value of these attributes automatically (if relevant). |
SQLTMPTSEXT | Pointer | A pointer to an extended table space description control block (SQLETSDESCEXT) for the system temporary table space, which defines additional attributes to those found in SQLETSDESC. If NULL, the database manager determines the value of these attributes automatically (if relevant). |
RESERVED | Pointer | A pointer to a database options control block (sqeldboptions), which is used to specify configuration advisor inputs, controls whether or not the new database is RESTRICTIVE, and controls encryption options for the new database. |
Valid values for SQLPAGESIZE (defined
in sqlenv) are:
- SQL_PAGESIZE_4K
- Default page size for the database is 4 096 bytes.
- SQL_PAGESIZE_8K
- Default page size for the database is 8 192 bytes.
- SQL_PAGESIZE_16K
- Default page size for the database is 16 384 bytes.
- SQL_PAGESIZE_32K
- Default page size for the database is 32 768 bytes.
Automatic storage configuration (sqleAutoStorageCfg) data structure parameters
The
automatic storage configuration (sqleAutoStorageCfg)
structure can be used during a call to the sqlecrea API.
It is an element of the sqledbdescext structure,
and specifies the storage paths for the default storage group.
Field name | Data type | Description |
---|---|---|
SQLENABLEAUTOSTORAGE | CHAR(1) | Specifies whether or not automatic storage is enabled for the database. See the information that follows this table for values. |
SQLNUMSTORAGEPATHS | sqluint32 | A value indicating the number of storage paths being pointed to by the SQLSTORAGEPATHS array. If the value is 0, the SQLSTORAGEPATHS pointer must be NULL. The maximum number of storage paths is 128 (SQL_MAX_STORAGE_PATHS). |
SQLSTORAGEPATHS | Pointer | An array of string pointers that point to storage paths. The number of pointers in the array is reflected by SQLNUMSTORAGEPATHS. Set SQLSTORAGEPATHS to NULL if there are no storage paths being provided (in which case, SQLNUMSTORAGEPATHS must be set to 0). The maximum length of each path is 175 characters. |
Valid values for SQLENABLEAUTOSTORAGE (defined
in sqlenv) are:
- SQL_AUTOMATIC_STORAGE_NO
- The default storage group is not created and table spaces managed by automatic storage cannot be created. When this value is used, SQLNUMSTORAGEPATHS must be set to 0 and SQLSTORAGEPATHS must be set to NULL.
- SQL_AUTOMATIC_STORAGE_YES
- The default storage group, IBMSTOGROUP, is created. The storage paths used for automatic storage are specified using the SQLSTORAGEPATHS pointer. If this pointer is NULL, then a single storage path is assumed with a value determined by database manager configuration parameter dftdbpath.
- SQL_AUTOMATIC_STORAGE_DFT
- The database manager determines whether or not to create the default storage group. Currently, the choice is made based on the SQLSTORAGEPATHS pointer. If this pointer is NULL, the default storage group is not created, otherwise it is created. The default value is equivalent to SQL_AUTOMATIC_STORAGE_YES.
Extended table space description block (SQLETSDESCEXT) structure parameters
The extended table space description
block (SQLETSDESCEXT) structure is used to specify
the attributes for the three initial table spaces. This structure
is used in addition to, not instead of, the Table Space Description
Block (SQLETSDESC) structure.
Field name | Data type | Description |
---|---|---|
SQLINITSIZE | sqlint64 | Defines the initial size of each table space that uses automatic storage. This field is only relevant for regular or large automatic storage table spaces. Use a value of SQL_TBS_AUTOMATIC_INITSIZE for other table space types or if the intent is to have Db2 automatically determine an initial size. Note: The actual value used by the database manager may be slightly smaller or larger than what was specified. This action is taken to keep sizes consistent across containers in the table space and the value provided may not allow for that consistency. |
SQLINCREASESIZE | sqlint64 | Defines the size that the database manager automatically increases the table space by when the table space becomes full. This field is only relevant for table spaces that have auto-resize enabled. Use a value of SQL_TBS_AUTOMATIC_INCSIZE if auto-resize is disabled or if the intent is to have the database manager determine the size increase automatically. Note: The actual value used by the database manager may be slightly smaller or larger than what was specified. This action is taken to keep sizes consistent across containers in the table space and the value provided may not allow for that consistency. |
SQLMAXIMUMSIZE | sqlint64 | Defines the maximum size to which the database manager automatically increases the table space. Alternately, a value of SQL_TBS_NO_MAXSIZE can be used to specify that the maximum size is "unlimited", in which case the table space can grow to the architectural limit for the table space or until a "filesystem full" condition is encountered. This field is only relevant for table spaces that have auto-resize enabled. Use a value of SQL_TBS_AUTOMATIC_MAXSIZE if auto-resize is disabled or if the intent is to have the database manager determine the maximum size automatically. Note: The actual value used by the database manager may be slightly smaller or larger than what was specified. This action is taken to keep sizes consistent across containers in the table space and the value provided may not allow for that consistency. |
SQLAUTORESIZE | CHAR(1) | Specifies whether auto-resize is enabled for the table space or not. See the information that follows this table for values. |
SQLINITSIZEUNIT | CHAR(1) | If relevant, indicates whether SQLINITSIZE is being provided in bytes, kilobytes, megabytes, or gigabytes. See the information that follows this table for values. |
SQLINCREASESIZEUNIT | CHAR(1) | If relevant, indicates whether SQLINCREASESIZE is being provided in bytes, kilobytes, megabytes, gigabytes, or as a percentage. See the information that follows this table for values. |
SQLMAXIMUMSIZEUNIT | CHAR(1) | If relevant, indicates whether SQLMAXIMUMSIZE is being provided in bytes, kilobytes, megabytes, or gigabytes. See the information that follows this table for values. |
Valid values for SQLAUTORESIZE (defined
in sqlenv) are:
- SQL_TBS_AUTORESIZE_NO
- Auto-resize is disabled for the table space. This value can only be specified for database-managed space (DMS) table spaces or automatic storage table spaces.
- SQL_TBS_AUTORESIZE_YES
- Auto-resize is enabled for the table space. This value can only be specified for database-managed space (DMS) table spaces or automatic storage table spaces.
- SQL_TBS_AUTORESIZE_DFT
- The database manager determines whether or not auto-resize is enabled based on the table space type: auto-resize is turned off for database-managed space (DMS) table spaces and on for automatic storage table spaces. Use this value for system-managed space (SMS) table spaces since auto-resize is not applicable for that type of table space.
Valid values for SQLINITSIZEUNIT, SQLINCREASESIZEUNIT and SQLMAXIMUMSIZEUNIT (defined
in sqlenv) are:
- SQL_TBS_STORAGE_UNIT_BYTES
- The value specified in the corresponding size field is in bytes.
- SQL_TBS_STORAGE_UNIT_KILOBYTES
- The value specified in the corresponding size field is in kilobytes (1 kilobyte = 1 024 bytes).
- SQL_TBS_STORAGE_UNIT_MEGABYTES
- The value specified in the corresponding size field is in megabytes (1 megabyte = 1 048 576 bytes)
- SQL_TBS_STORAGE_UNIT_GIGABYTES
- The value specified in the corresponding size field is in gigabytes (1 gigabyte = 1 073 741 824 bytes)
- SQL_TBS_STORAGE_UNIT_PERCENT
- The value specified in the corresponding size field is a percentage (valid range is 1 to 100). This value is only valid for SQLINCREASESIZEUNIT.
sqledboptions data structure parameters
- piAutoConfigInterface
- Input. A pointer to db2AutoConfigInterface structure which contains information that serves as input for the Configuration Advisor
- restrictive
- The setting of the restrictive field is stored in the
restrict_access database configuration parameter and will affect all future
upgrades of this database. That is, when a database is upgraded to a subsequent Db2 release, the
UPGRADE DATABASE checks the restrict_access database
configuration parameter setting to determine whether the restrictive set of default actions needs to
be applied to any new objects (for example, new system catalog tables) introduced in the new
Db2 release.
The valid values (defined in the sqlenv header file, which is located in the include directory) for this parameter are:
- SQL_DB_RESTRICT_ACCESS_NO or SQL_DB_RESTRICT_ACCESS_DFT
- Indicates that the database is to be created not using the restrictive set of default actions.
This setting will result in the following privileges granted to PUBLIC:
- CREATETAB privilege
- BINDADD privilege
- CONNECT privilege
- IMPLICIT_SCHEMA privilege
- EXECUTE with GRANT privilege on all procedures in schema SQLJ
- EXECUTE with GRANT privilege on all functions and procedures in schema SYSPROC
- BIND privilege on all packages created in the NULLID schema
- EXECUTE privilege on all packages created in the NULLID schema
- CREATEIN privilege on schema SQLJ
- CREATEIN privilege on schema NULLID
- USE privilege on table space USERSPACE1
- SELECT privilege on the SYSIBM catalog tables
- SELECT privilege on the SYSCAT catalog views
- SELECT privilege on the SYSSTAT catalog views
- UPDATE privilege on the SYSSTAT catalog views
- SQL_DB_RESTRICT_ACCESS_YES
- Indicates that the database is to be created using the restrictive set of default actions. This means that the grant actions listed previously under SQL_DB_RESTRICT_ACCESS_NO do not occur.
- reserved
- Input. A pointer to the sqledbdescextext data structure that specifies values for database encryption parameters. See sqledbdescextext data structure for more information.