Oracle view encoding and modify encoding

Source: Internet
Author: User

Oracle view encoding and modify encoding

First look at the encoding of the Oracle database


Sql> SELECT * from nls_database_parameters where parameter = ' nls_characterset ';


PARAMETER
--------------------
VALUE
--------------------
Nls_characterset
Al32utf8


This is derived from props$, which is the character set that represents the database.


Oracle Client-side encoding


Sql> SELECT * from nls_instance_parameters where parameter= ' nls_language ';


PARAMETER
--------------------
VALUE
--------------------
Nls_language
Simplified Chinese


It originates from V$parameter, which represents the setting of the client's character set, which may be a parameter file, an environment variable, or a registry session character set environment


SELECT * from Nls_session_parameters, which originates from V$nls_parameters, represents the session's own settings, which may be the session's environment variable or alter session completion, if the session does not have a special setting, will be associated with the NLS _instance_parameters consistent.


And then, how to modify the Oracle character set:


Currently my database environment character set is Al32utf8, then change it to ZHS16GBK


1. First log in as Sysdba conn/as SYSDBA


2. Close the database shutdown immediate;


3. Use mount to hit the database, startup mount


4. Set session


Sql>alter SYSTEM ENABLE RESTRICTED SESSION;
sql> ALTER SYSTEM SET job_queue_processes=0;
sql> ALTER SYSTEM SET aq_tm_processes=0;


5. Start the database


ALTER DATABASE open;


6. Modifying the character Set


ALTER DATABASE CHARACTER SET ZHS16GBK;


This may cause an error, prompting 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:


ALTER DATABASE Character Set Internal_use ZHS16GBK;


This statement is available, and the help provided by Ternal_use will allow Oracle to bypass the validation of subsets and superset, which is exactly the same as the one inside the statement above.


7. Shutdown, restart


Sql>shutdown immediate;
Sql> Startup


Of course, the character set is best not to easily modify, because this will have a direct impact on the data of the database, if it is a production environment, can cause unpredictable loss.

Oracle view encoding and change encoding (RPM)

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.