Installing Oracle 12c on Windows 7 64-bit does not have a set character set, using the operating system default character set: we8mswin1252, modify the character set to: ZHS16GBK. Because the process is irreversible, you first need to back up the database.
1. Fully prepared database
2. Querying the current character set
PARAMETER VALUE---------------------------------------------------------------------------------------- --------------------------------nls_characterset we8mswin1252sql>
3. Close the database
SQL>shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down.
4. Start the database to Mount state
SQL>4982833152 bytesfixed size 2934600 bytesvariable size 2734688440 bytes Database Buffers 2231369728 bytesredo buffers 13840384 bytes Database mounted.
5. Limit session
SQL>alter system enable restricted session; System altered.
6. Query the relevant parameters and modify to prevent the task from automatically start execution
SQL> show parameter job_queue_processes;name TYPE VALUE---------------- -------------------------------------------------------------job_queue_processes integer +
SQL> show parameter aq_tm_processes;name TYPE VALUE-------------------- ---------------------------------------------------------aq_tm_processes integer 1
SQL> alterset job_queue_processes=0; System altered.
SQL>ALTERSET aq_tm_processes=0; System altered.
7. Open the Database
SQL>alterdatabaseopen ; Database altered.
8. Modifying the character Set
Sql> Alter Database character SetAl32utf8;Alter Database character SetAl32utf8*ERROR at line1: ORA-12712: Newcharacter SetMust be a superset ofOldcharacter Set
When the error occurs, the new character set must be a superset of the old character set, and the original character set is a subset of the new character set, which can be queried on the Oracle Official document for the character set inclusion relationship. Following the use of Oracle internal command Internal_use, skip the superset check, which is not recommended by the production environment.
SQL>alterdatabasecharacterset internal_use Al32utf8; Database altered.
9. Querying the current character set
SQL>Select*fromwhere parameter='nls_ CHARACTERSET'; PARAMETER VALUE--------------------------------------------------------------------- ---------------------------------------------------nls_characterset Al32utf8
10. Close the database
SQL>shutdown immediatesql>shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
11. Start the database to Mount state
SQL>4982833152 bytesfixed size 2934600 bytesvariable size 2734688440 bytes Database Buffers 2231369728 bytesredo buffers 13840384 bytes Database mounted.
12. Change the relevant parameters back to their original values
SQL> alterset job_queue_processes=1000; System altered.
SQL>ALTERSET aq_tm_processes=1; System altered.
13. Open the Database
SQL>alterdatabaseopen ; Database altered.
Original address:
Oracle 12c garbled, method of modifying character set
Oracle 12c garbled, method of modifying character set