Oracle 11g view server/client encoding and modify db Encoding

Source: Internet
Author: User


Check the server/client encoding and modify the database encoding at oracle 11g. If the server and client encoding are inconsistent, asp.net may display garbled characters when reading the database record. view the oracle server encoding: select * from sys. nls_database_parameters; check the client code: select * from sys. nls_session_parameters; www.2cto.com if the two-end encoding is inconsistent, you can modify the client encoding: regedit to open the Registry: HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_OraDb10g_home1 to modify the value of NLS_LANG, generally, the value is SIMPLIFIED CHINESE_CHINA.ZHS16GBK (SIMPLIFIED Chinese encoding, which is the default encoding for oracle installation). If the server is utf8, this value needs to be changed to SIMPLIFIED CHINESE_CHINA.AL32UTF8tips: if you do not remember, you can also run select userenv ('language') from dual; on the server side to check if pl/SQL devloper is used, the difference in the encoding between the client and the server is also detected. If the difference is found, the following dialog box is displayed:

To remove this prompt: Modify the handler for NLS_LANG under HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ ORACLE \ key_1_lient11g_client_x86 (Note: After my actual test, after I have modified the registry, although this prompt box is no longer displayed, however, it may cause garbled characters in the SQL plus provided by oracle. It is recommended that you directly check Don't show this message again for the first time when this window is displayed) how to modify the database encoding: (test on oracle 11g) SQL> conn system as sysdba; SQL> shutdown immediate; SQL> startup mount; SQL> alter system enable restricted session; SQL> alter system set job_queue_processes = 0; SQL> alter database open; SQL> alter database character set internal_use AL32UTF8; SQL> shutdown immediate; SQL> startup record several common oracle SQL commands: unlock the user (hr): alter user hr account unlock; change the user (hr) password (new password is hr ): alter user hr identified by hr; grant the select permission for the (emp) Table to the user (hr): grant select on emp to hr; Revoke authorization: remove select on emp from hr;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.