This is the command that I use to create a new Db2 database in my project:
db2 create db <DATABASE_NAME> using codeset 1251 territory ru
Unfortunately, there is no documentation left and I cannot trace the origin of this specific command. I am trying to understand the purpose of the territory
parameter. The Db2 documentation says:
This parameter shows the territory used to create the database.
territory
is used by the database manager when processing data that is
territory sensitive.
What could be the purpose of this parameter? What kind of data could be territory sensitive? What are the possible use cases where territory
matters?
Best Answer
"Territory" is essentially equivalent to country code or locale. This setting affects default behaviour of the database when handling the date format, as well as the default SYSTEM collation (sorting) in some locales. Note that the client locale overrides this, so, when connected to a database with
territory ru
from a client with a US locale, the default date format will be taken from the client setting.It is also used by federation to determine the necessary conversions when retrieving data from remote servers with different territory (locale) settings.