global_database_id option [database]

Controls the range of values for columns created with DEFAULT GLOBAL AUTOINCREMENT. For use in generating unique primary keys in a replication environment.

Allowed values

Integer

Default

2147483647

Scope

Can be set for the PUBLIC group only. DBA authority required.

Remarks

The value you specify for this option is the starting value. For columns created with DEFAULT GLOBAL AUTOINCREMENT, when a row is inserted into the table that does not include a value for the DEFAULT GLOBAL AUTOINCREMENT column, the database server generates a value for the column. The value is determined by the global_database_id value and the partition size for the column.

Setting global_database_id to the default value indicates that GLOBAL DEFAULT AUTOINCREMENT is disabled. In this case NULL is generated as a default.

You can find the value of the option in the current database using the following statement:

SELECT DB_PROPERTY( 'GlobalDBID' );

This feature is of particular use in replication environments to ensure unique primary keys.

See also
Example

The following example sets the database identification number to 100.

SET OPTION PUBLIC.global_database_id = '100';