Skip to Main Content


Question and Answer

Sergiusz Wolicki

Thanks for the question.

Asked: June 03, 2021 - 9:23 am UTC

Last updated: June 10, 2021 - 12:16 pm UTC


Viewed 100+ times

You Asked

Hi,I'm using oracle for studing, and I queried the v$session using pl/sql developer from a windows pc client ,but I found the garbled code from the results.just as following:

SQL> select osuser from v$session; 


then I ran the same command from the DB server,but I got the same results.

Here are the characterset:

SQL> select userenv('language') from dual;



SQL> select * from v$nls_parameters;

PARAMETER                                                        VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_LANGUAGE                                                     SIMPLIFIED CHINESE
NLS_TERRITORY                                                    CHINA
NLS_CURRENCY                                                     ¥
NLS_ISO_CURRENCY                                                 CHINA
NLS_NUMERIC_CHARACTERS                                           .,
NLS_CALENDAR                                                     GREGORIAN
NLS_DATE_FORMAT                                                  DD-MON-RR
NLS_DATE_LANGUAGE                                                SIMPLIFIED CHINESE
NLS_CHARACTERSET                                                 ZHS16GBK
NLS_SORT                                                         BINARY
NLS_TIME_FORMAT                                                  HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT                                             DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT                                               HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT                                          DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY                                                ¥
NLS_NCHAR_CHARACTERSET                                           UTF8
NLS_COMP                                                         BINARY
NLS_LENGTH_SEMANTICS                                             BYTE
NLS_NCHAR_CONV_EXCP                                              FALSE

19 rows selected

I also set the environment variable in my windows os :

What's more,I tested my db as following:
SQL> select '中文' from dual;


Now,Could you please help me,why I got some garbled codes such as ??? when querying osuser from v$session?

thanks a lot.

and we said...

Lots of moving parts there, including a tool that we don't make or support.

Can you try the same with SQL Developer, and let us know the results.

(Note: First read this )


  (1 rating)


garbled code of v$session

A reader, June 10, 2021 - 8:21 am UTC

I downloaded the latest version of oracle SQL developer,which is , and got the same results as follows:

select '中文' from dual;

SQL> select osuser from v$session; 


Please give me some advices, thanks
Sergiusz Wolicki
June 10, 2021 - 12:16 pm UTC

The best advice I can give is to use a more current database release than We have improved the code responsible for getting the OSUSER from the Windows API and passing it to the database in (bug #6994490). You really shouldn't use a non-patched, 16-years old release. Oracle Database 18c XE (18.4) is available for free.

For your old release to work, you probably need to change the system default locale to Chinese. If you open Command Prompt, issue the command CHCP, and do not see "Active code page: 936" out-of-the-box, then V$SESSION will not work with Simplified Chinese characters.