Fix Chinese Characters in Oracle Sqlplus on Linux Without Reboot
This guide explains why Chinese characters appear as question marks in Sqlplus on Linux, how to identify the server character set, and provides step‑by‑step instructions to set the NLS_LANG environment variable and apply it instantly using the source command.
When using Sqlplus on Linux to access an Oracle database, Chinese characters may display as question marks because the client and server character sets differ. The server’s character set can be checked with select userenv("language") from dual;, which often returns something like SIMPLIFIED CHINESE_CHINA.ZHS16GBK.
Step 1: Verify Server Character Set
Log into Sqlplus and run the query above to confirm the exact character set used by the Oracle instance.
Step 2: Set Client Environment Variable
Edit the .bash_profile (or equivalent shell startup file) of the Oracle user, adding the following line at the end:
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"Adjust the value after the equals sign to match the server’s character set you obtained in Step 1.
Step 3: Apply the Change Immediately
Because the server cannot be restarted, use the source command to reload the profile without a reboot: source /home/oracle/.bash_profile This forces the shell to read the updated environment variable, making the new character set effective for subsequent Sqlplus sessions.
After sourcing, exit Sqlplus, reconnect, and test with insert or update statements containing Chinese characters to confirm the issue is resolved.
Note: The source command works because environment variables are loaded into memory at login; re‑sourcing the profile forces the system to refresh them without a full reboot.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
