0

I need some help with my DB2 instance on Cloud. I need execute a command for change system property, for example I need change the configuration STRING_UNITS to CODEUNITS32, but I cant do it using IBM DATA SERVER DRIVER( IBM console). I will to thank some help. Thank you very much.

1 Answers1

0

string_units is configurable on-line

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.admin.config.doc/doc/r0060936.html

so if you have SYSADM, SYSCTRL or SYSMAINT authority on the instance you could run

call admin_cmd('UPDATE DB CFG USING STRING_UNITS CODEUNITS32 IMMEDIATE')

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0023593.html

The change will only take effect on new connections, existing connections would need to re-connect to pick up the new default.

If you don't have one of those authorities, then you can change the NLS_STRING_UNITS global variable at a session level https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0060917.html

Paul Vernon
  • 3,818
  • 1
  • 10
  • 23
  • Thank you very much !!! @Paul Vernon. First we made the change and it did not work on the existing tables, however on a new table created in the instance, it did accept the record that was failing before. – Yasser Moreno Jun 14 '20 at 00:38
  • Yes, it only affects new tables. It changes the default string units from OCTETS to CODEUNITS32.. which means that e.g. a VARCHAR(4) with an implicit string units of OCTETS will only allow 4 bytes maximum - so no good if you want to store 4 characters and at least one is more than 1 byte in UTF-8. With VARCHAR(4) and an implicit (or explicit) CODEUNITS32, you can store up to 16 bytes, and up-to 4 characters... so great if you want to store 2,3 or 4 byte UTF-8 characters – Paul Vernon Jun 15 '20 at 11:30