Oracle character set modification view method

  • 2020-10-07 18:55:07
  • OfStack

1. How to view the database character set
[A] Database server character set select * from nls_database_parameters, derived from props$, is the character set representing the database.
Client character set environment select * from nls_instance_parameters, derived from v$parameter,
Represents the set of character sets for the client, which may be parameter files, environment variables, or a registry
The session character set environment select * from nls_session_parameters, derived from v$nls_parameters, represents the setting of the session itself, which may be the session environment variable or alter session. If there is no special setting for the session, it will be sent to nls_instance_parameters1.
The client character set needs to match server 1 to correctly display non-Ascii characters in the database. alter session if multiple Settings exist > The environment variable > The registry > Parameter file
The character set should be 1, but the language setting can be different. English language setting is recommended. If the character set is zhs16gbk, nls_lang can be American_America.es45EN16ES46en.
2. How to modify the character set
[A] Versions above 8i can modify the character set through alter database, but only for subsets to supersets. It is not recommended to modify the props$table, which may lead to serious errors.
Startup nomount;
Alter database mount exclusive; The earliest webmaster website in China
Alter system enable restricted session;
Alter system set job_queue_process=0;
Alter database open;
Alter database character set zhs16gbk;

Related articles: