160505. Oracle modified Character set modified to ZHS16GBK

Source: Internet
Author: User

Modifying the Oracle Character set

Method/Step
  1. 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.

160505. Oracle modified Character set modified to ZHS16GBK

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.