Everything you always wanted to know about Oracle Database NLS_LANG and character sets

I have recently come across the Oracle Database Globalization Support again and the question of what character set is used when, how and where. A lot of this can be or is controlled by the NLS_LANG OS environment variable, buried deep down in the Database Globalization Support Guide. But I just found this “hidden gem” on the Oracle web page that, for some reason, isn’t very well indexed by the search engines: https://www.oracle.com/database/technologies/faq-nls-lang.html

I also found that the page could do with an overhaul and a few more details, so I’ve taken the liberty to provide an updated version of it over here: Oracle Database NLS_LANG FAQ

Hopefully, this will help other users of Oracle Database to understand this environment variable better and maybe help to improve the overall search engine ranking for that page. If you have any questions regarding what character set is used or should be used and how to set what, that FAQ page is your friend.

SOLVED: Oracle XE: ORA-00821: Specified value of sga_target is too small

tl;dr

  • Open ${ORACLE_HOME}/assistants/dbca/templates/XE_Database.dbc with a text editor
  • Find <InitParamAttributes><InitParams>
  • Add the following XML tag under <InitParams>: <initParam name="cpu_count" value="2"/>
Continue reading “SOLVED: Oracle XE: ORA-00821: Specified value of sga_target is too small”

How to get the month name in the IntelliJ copyright velocity template

Every time I try to create a copyright profile in IntelliJ (or PyCharm), I find myself googling around the web trying to find out how to get the month name, e.g. August, into the template. Unfortunately, the IntelliJ documentation is not very helpful by just saying:

IntelliJ documentation about date formatting

In short, it can be done via $today.format("MMMM"), as the DateInfo implements the syntax from java.text.SimpleDateFormat, which has a long list of formatting options:

java.text.SimpleDateFormat formatting options

However, the important part is further below:

Month: If the number of pattern letters is 3 or more, the month is interpreted as text; otherwise, it is interpreted as a number.

  • Letter M produces context-sensitive month names, such as the embedded form of names. Letter M is context-sensitive in the sense that when it is used in the standalone pattern, for example, “MMMM”, it gives the standalone form of a month name and when it is used in the pattern containing other field(s), for example, “d MMMM”, it gives the format form of a month name. For example, January in the Catalan language is “de gener” in the format form while it is “gener” in the standalone form. In this case, “MMMM” will produce “gener” and the month part of the “d MMMM” will produce “de gener”. If a DateFormatSymbols has been set explicitly with constructor SimpleDateFormat(String,DateFormatSymbols) or method setDateFormatSymbols(DateFormatSymbols), the month names given by the DateFormatSymbols are used.
  • Letter L produces the standalone form of month names.

It’s important to use at least 3 letters M to have the month be printed in text form otherwise, you will get the month’s number.

With that in mind, one can now provide a decent copyright profile in IntelliJ, well, to my liking at least, anyway:

Since: $today.format("MMMM") $today.year
Author: $username
Name: $file.fileName
Description: 

Copyright $today.year Gerald Venzl

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Which generates:

/*
 * Since: January 2022
 * Author: gvenzl
 * Name: Test.java
 * Description:
 *
 * Copyright 2022 Gerald Venzl
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Introducing gvenzl/oracle-xe: Oracle Database XE Docker images

One of the things that kept me busy lately was experimenting with how much an Oracle XE database setup could be streamlined inside a Docker image for things like CI/CD consumption. Pretty much ever since I put together the first official build scripts for Oracle Database, people have asked for faster image pull and startup times to speed up their continuous integration tests. A lot of things have changed since then, and I’m happy that my engineering colleagues at Oracle have taken on the maintenance and further enhancements of Oracle’s official Docker build files and images, and integrated them into the internal processes.

Continue reading “Introducing gvenzl/oracle-xe: Oracle Database XE Docker images”

Free sample data sets for everyone!

It’s actually been quite a while since I have put together these free sample data sets for everyone but it just struck me today that I’ve never blogged about them. It was in December 2020 when I finally published and announced these data sets on Twitter. But what am I actually talking about here, you may ask? Well, here comes a story of “when life gives you lemons, make lemonade!”

Continue reading “Free sample data sets for everyone!”