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
SQL>Select*fromwhere parameter='nls_ CHARACTERSET'; PARAMETER VALUE--------------------------------------------------------------------- -----------nls_characterset we8iso8859p1
3. Close the database
SQL>shutdown immediateDatabase closed. Database dismounted. ORACLE instance shut down.
4. Start the database to Mount state
SQL> startup mountoracle instance started. Total System Globalarea205520896 bytesfixed Size 1266608 bytesvariable Size 100666448 bytesDatabase buffers 100663296 Bytesredo buffers 2924544 bytesDatabase mounted.
5. Limit session
SQL>alter system enable restricted session; System altered.
6. Query the relevant parameters and modify
Sql>Show parameter job_queue_processes; NAME TYPE VALUE------------------------------------ ----------- ------------------------------Job_queue_processesinteger TenSQL>Show parameter aq_tm_processes; NAME TYPE VALUE------------------------------------ ----------- ------------------------------Aq_tm_processesinteger 0SQL> AlterSystemSetJob_queue_processes=0; System altered.
7. Open the Database
SQL>alterdatabaseopen; Database altered.
8. Modifying the character Set
Sql> Alter Database character SetZHS16GBK;Alter Database character SetZHS16GBK*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 zhs16gbk; Database altered.
9. Querying the current character set
SQL>Select*fromwhere parameter='nls_ CHARACTERSET'; PARAMETER VALUE--------------------------------------------------------------------- -----------nls_characterset ZHS16GBK
10. Close the database
SQL>shutdown immediateDatabase closed. Database dismounted. ORACLE instance shut down.
11. Start the database to Mount state
SQL> startup mountoracle instance started. Total System Globalarea205520896 bytesfixed Size 1266608 bytesvariable Size 100666448 bytesDatabase buffers 100663296 Bytesredo buffers 2924544 bytesDatabase mounted.
12. Change the relevant parameters back to their original values
SQL>alterset job_queue_processes=ten; System altered.
13. Open the Database
SQL>alterdatabaseopen; Database altered.
Oracle 12c garbled, method of modifying character set