Problem description: Oracle installed in Linux by a colleague, the default character set is not modified. WE8ISO8859P1 is used and Chinese characters are not supported,
The problem is that the Chinese data entered by the client can be displayed. After the data is submitted, the Chinese data will be displayed ???. The problem is that the character set on the oracle server does not support Chinese characters.
You can use:
Select userenv ('language') from dual; command to view the character set used by the server.
Or select * from V $ NLS_PARAMETERS; the command can also be
And select * from SYS. PROPS $;
After confirming the problem, I Google it. There is a lot of information on the Internet. It may be the reason why my environment is inconsistent with those of them. I did not solve the problem following the steps on the Internet.
After finding the root cause of the problem, you can solve the problem by referring to the relevant online documents as follows:
In general, there are two ideas:
1. reinstall
2. Modify Character Set
Note: The first method is useless. I think reinstallation is not my favorite path, and solving the problem is fundamental. So I chose the second method.
Many people on the Internet say that the character set cannot be changed after the oracle server is installed. Practice has proved that the character set can be modified. At least the oracle8 or later versions can be modified.
My solution steps:
1. Log On via ssh and switch to the oracle user
Switch USER command: su-oracle
Log on to oracle with sqlplus and run the following command:
: Sqlplus/nolog
: Connect/as sysdba
In this way, you are logged on.
2. Change the character set
First, after logging on to sqlplus, close the oracle database
1. shutdown immediate;
2. startup mount;
3. alter system enable restricted session;
4. alter system set JOB_QUEUE_PROCESSES = 0;
5. alter system set AQ_TM_PROCESSES = 0;
6. alter database open;
7. alter database character set INTERNAL_USE ZHS16GBK;
8. shutdown immediate;
9. startup;
Note: At the beginning, I did not solve the problem according to the above steps, because some information prompted me to use alter database character set ZHS16GBK in step 1; I tried this command, I am using alter database character set INTERNAL_USE ZHS16GBK; a message indicating that the modification is successful is displayed. Similarly, if an error is prompted for the command under startup mount, you can try to run the Step 7 command under startup restrict.
The following are my debugging command records. For more information, see the commands that indicate errors that fail to be executed.
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 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 104859216 bytes
Database Buffers 176160768 bytes
Redo Buffers 2973696 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.