Character set changes for Oracle databases
A, Oracle server-side Character set query
Select Userenv (' language ') from dual
Where Nls_characterset is the server-side character set
Nls_language for server-side character display
B. Querying the character set of the Oracle client side
$echo $NLS _lang
If you find that the data you select is garbled, configure the client's character set to the same character set as the Linux operating system. If it is still garbled, it is possible that there is a problem with the data in the database, or there is a problem with the configuration of the Oracle server.
C, server-side character Set modification
*****************************************************************
* Change Character Set step method (WE8ISO8859P1-ZHS16GBK) *
*****************************************************************
Sql>
To make a character set change by booting the database into restricted mode:
sql> conn/as sysdba
Connected.
sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Sql> Startup Mount
ORACLE instance started.
Total System Global area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database buffers 33554432 bytes
Redo buffers 667648 bytes
Database mounted.
sql> ALTER SYSTEM ENABLE RESTRICTED SESSION;
System altered.
sql> ALTER SYSTEM SET job_queue_processes=0;
System altered.
sql> ALTER SYSTEM SET aq_tm_processes=0;
System altered.
sql> ALTER DATABASE open;
Database altered.
sql> ALTER DATABASE CHARACTER SET zhs16gbk;
ALTER DATABASE CHARACTER SET ZHS16GBK
*
ERROR at line 1:
Ora-12712:new character set must be a superset of the old character set
Hint to our character set: The new character set must be a superset of the old character set, and we can skip over the superset check to make the change:
sql> ALTER DATABASE character set Internal_use ZHS16GBK;
Database altered.
Sql> SELECT * from V$nls_parameters;
Slightly
Rows selected.
Reboot checks for changes to complete:
sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Sql> Startup
ORACLE instance started.
Total System Global area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database buffers 33554432 bytes
Redo buffers 667648 bytes
Database mounted.
Database opened.
Sql> SELECT * from V$nls_parameters;
Slightly
Rows selected.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D, client side character Set modification
In the. Bash_profile in the/home/oracle and/root user directories
Add or modify Export nls_lang= "American_america. UTF8"statement
Close the current SSH window.