Oracle 12c garbled, method of modifying character set

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.