First look at the Oracle database encoding
Sql> SELECT * from nls_database_parameters where parameter = ' nls_characterset ';
PARAMETER
--------------------
VALUE
--------------------
Nls_characterset
Al32utf8
This is derived from props$, which represents the character set of the database.
Oracle Client Encoding
Sql> SELECT * from nls_instance_parameters where parameter= ' nls_language ';
PARAMETER
--------------------
VALUE
--------------------
Nls_language
Simplified Chinese
It comes from V$parameter, which represents the setting of the client's character set, possibly a parameter file, an environment variable, or a registry session character set environment
The select * from Nls_session_parameters, which originates from the V$nls_parameters, represents the session's own settings, may be the session's environment variable or the ALTER session is complete, and if there are no special settings, it will be associated with the NLS _instance_parameters consistent.
Again, how do I modify Oracle's character set:
At present my database environment's character set is Al32utf8, then change it to ZHS16GBK
1. First sign up as SYSDBA conn/as SYSDBA
2. Close the database shutdown immediate;
3. With mount to call the database, startup mount
4. Set session
Sql>alter SYSTEM ENABLE restricted session;
sql> ALTER SYSTEM SET job_queue_processes=0;
sql> ALTER SYSTEM SET aq_tm_processes=0;
5. Start the database
ALTER DATABASE open;
6. Modify Character Set
ALTER DATABASE CHARACTER SET ZHS16GBK;
This may be an error indicating our character set: The new character set must be a superset of the old character set, at which point we can skip the check of the superset to make changes:
ALTER DATABASE Character Set Internal_use ZHS16GBK;
This statement is OK, and the Help that Ternal_use provides allows Oracle to bypass the validation of subsets and superset, which is identical to the internal operation of the statement above.
7. Shutdown, reboot
Sql>shutdown immediate;
Sql> Startup
Of course, the character set is best not easily modified, because this will have a direct impact on the data of the database, if the production environment, it may cause incalculable loss.