2

Overview: I am trying to create an Informix instance with a character set of UTF8.

Details: I understand that the default character set in informix when creating an instance is ISO Latin 1 (819). However, I am trying to convert my informix instances over to a UTF8 character set. I have created the correct Onconfig and paths. I cannot seem to set CLIENT_LOCALE, DB_LOCALE, SERVER_LOCALE, and DBLANG correctly.

> set DB_LOCALE=en_us.utf8
> set CLIENT_LOCALE=en_us.utf8
> set DBLANG=en_us.utf8   (I do not know if this is the correct value)
> set SERVER_LOCALE=en_us.utf8
> set GL_USEGLU=1

This works when I echo all five values they are set. However, when I try to create the instance after by:

> oninit -iy 

I use dbaccess to look at sysmaster::sysdbslocale all the sys databases values are set to 819 which stands for the character set ISO Latin 1 not UTF8. (I have also tried setting them with export and repeating all other steps the same way.) One thing to note is that I am setting these values on a telnet connection to the server through putty. The servers I am using are HP-UX.

Questions:

  • Does anyone know what I am doing wrong?
  • Is DBLANG set to the correct value?
  • How do I set these values so that the instance is created using the utf8 character set?
  • And finally how do I get these values to be set so that I do not have to set them every time I connect to the server using putty.
michael.moyer
  • 88
  • 1
  • 11
  • 2
    Ummm.. You don't really create UTF-8 "instances", you create UTF-8 databases, but no matter what settings you use, the admin databases (sysmaster, sysutils, etc) are always created as 'en_US.819'. Try creating a new database. Because you have DB_LOCALE set to 'en_US.utf8' in your environment, the locale of the database would be 'en_US.utf8' (or 'en_US.57372'). You can put those environment variables in your user profile or in the Informix environment configuration file ($INFORMIXDIR/etc/informix.rc). Search for 'chkenv' iin the Informix documentation. – jsagrera May 02 '18 at 14:55
  • Thanks I will look into this. And yes when I create a new database It does create it with the character set utf8. I did not know that the sys database character sets do not change thanks for that info. – michael.moyer May 02 '18 at 15:05
  • Will selecting from the sys databases and another database in the same sql statement work seeing as they have different db_locales. – michael.moyer May 02 '18 at 15:08
  • Also then why set SERVER_LOCALE at all if the instance does not change to UTF-8. – michael.moyer May 02 '18 at 15:09
  • 2
    The 'admin' databases are kind of special. Usually you can't do distributes queries if the databases have different locales but that's not the case with the admin ones. You can do a "select * from sysmaster:systables" from anywhere no matter your current DB_LOCALE setting. SERVER_LOCALE is used to specify the locale the engine will use to read/write files (OS files), stuff like the onconfig file, sqlexplain output or online.log. Usually there is no need to change it from the default en_US.819. – jsagrera May 02 '18 at 15:39
  • Thanks this clears up a lot of confusion that I have had around the subject. – michael.moyer May 02 '18 at 15:50
  • Setting the server locale allows you to get error messages (or at least some of them) in a language other than US English. – Jonathan Leffler May 03 '18 at 10:35

0 Answers0