Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
Toset the global database identification number
1. You set the identification number of a database by setting the value of the
publicoption Global_database_id. Theidentification number must be a
non-negativeinteger.
Forexample, the following statement sets the database identification number
to20.
SET OPTION PUBLIC.Global_database_id = 20
Ifthe partition size for a particular column is 5000, default values for this
databaseare selected from the range 100001–105000.
Setting unique database identification numbers when extractingdatabases
Ifyou use the extraction utility to create your remote databases, you can
writea stored procedure to automate the task. Ifyou create a stored
procedurenamed sp_hook_dbxtract_begin, it is called automatically by the
extractionutility. Before the procedure is called, the extraction utility creates
atemporary table named #hook_dict, with the following contents:
name value
extracted_db_global_id userID being extracted
Ifyou write your sp_hook_dbxtract_begin procedure to modify the value
columnof the row, that value is used as the GLOBAL_DATABASE_ID
optionof the extracted database, and marks the beginning of the range of
primarykey values for GLOBAL DEFAULTAUTOINCREMENT values.
Example Considerextracting a database for remote user user2 with a user_id of 101.
Ifyou do not define an sp_hook_dbxtract_begin procedure, the extracted
databasewill have Global_database_id set to 101.
Ifyou define a sp_hook_dbxtract_begin procedure, but it does not modify
anyrows in the #hook_dict then the option will still be set to 101.
Ifyou set up the database as follows:
131