Modify the oracle database character set to GBK In the rac Environment

Source: Internet
Author: User

The character set is accidentally not changed when the database is installed today (oracle10.2.0.4), leading to garbled interface because the rac environment is not the same as that of a single instance.

Http://blog.csdn.net/rulev5/article/details/7020134

1. query the Current Character Set

SQL> select userenv ('language') from dual;

USERENV ('language ')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.WE8ISO8859P1

SQL> alter system set cluster_database = false scope = spfile sid = 'jscn1 ';

The red part is not required for a single instance, but must be added for rac. Otherwise, a message will be reported.

ORA-12720: operation requires database is in EXCLUSIVE mode

2. Stop the database (both rac1 and rac2 must be stopped)

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

3. Start the database (only operate on rac1)

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size 2084264 bytes
Variable Size 436208216 bytes
Database Buffers 1124073472 bytes
Redo Buffers 14692352 bytes
SQL> Alter database mount exclusive;

Database altered.

SQL> Alter system enable restricted session;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 0;

System altered.
SQL> Alter database open;

Database altered.

4. Modify character sets
SQL> ALTER DATABASE character set INTERNAL_USE zhs16gbk;
SQL> alter system set cluster_database = true scope = spfile sid = 'jscn1 ';

5. Verification (both nodes must be tested)

Database altered.
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1577058304 bytes
Fixed Size 2084264 bytes
Variable Size 436208216 bytes
Database Buffers 1124073472 bytes
Redo Buffers 14692352 bytes
Database mounted.
Database opened.
SQL> select userenv ('language') from dual;

USERENV ('language ')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK

6. Start rac2 and verify the character set of rac2 (nonsense, public a database, of course the same)

 

//************************************** ******************//

 

Original

According to the above blog today, the rac Environment Character Set oracle 11.2.0.3 select userenv ('language') from dual; SIMPLIFIED CHINESE_CHINA.ZHS16GBK was modified to: select userenv ('language') from dual; SIMPLIFIED CHINESE_CHINA.AL32UTF8 this is the rac node1 operation
 

[Oracle @ ESCMDB01 ~] $ Sqlplus "/as sysdba"

SQL * Plus: Release 11.2.0.3.0 Production on Thu Mar 6 16:13:51 2014

Copyright (c) 1982,201 1, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup ORACLE instance started.

Total System Global Area 1.6034E + 10 bytes Fixed Size 2244192 bytes Variable Size 1.0133E + 10 bytes Database Buffers 5838471168 bytes Redo Buffers 60059648 bytes Database mounted. database opened. SQL> alter system set cluster_database = false scope = spfile sid = 'dzsw1 ';

System altered.

SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup nomount; ORACLE instance started.

Total System Global Area 1.6034E + 10 bytes Fixed Size 2244192 bytes Variable Size 1.0133E + 10 bytes Database Buffers 5838471168 bytes Redo Buffers 60059648 bytes SQL> Alter database mount exclusive;

Database altered.

SQL> Alter system enable restricted session;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 0;

System altered.

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 0;

System altered.

SQL> Alter database open;

Database altered.

SQL> ALTER DATABASE character set INTERNAL_USE AL32UTF8;

Database altered.

SQL> alter system set cluster_database = true scope = spfile sid = 'dzsw1 ';

System altered.

SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup; ORACLE instance started.

Total System Global Area 1.6034E + 10 bytes Fixed Size 2244192 bytes Variable Size 1.0133E + 10 bytes Database Buffers 5838471168 bytes Redo Buffers 60059648 bytes Database mounted. database opened. SQL> startup ORA-01081: cannot start already-running ORACLE-shut it down first SQL> select userenv ('language') from dual;

USERENV ('language') ---------------------------------------------------- AMERICAN_AMERICA.AL32UTF8

SQL>


In rac node 2, shutdown is the first operation, and start is the last operation.
 
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1.6034E+10 bytesFixed Size                  2244192 bytesVariable Size            1.0167E+10 bytesDatabase Buffers         5804916736 bytesRedo Buffers               60059648 bytesDatabase mounted.Database opened.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1.6034E+10 bytesFixed Size                  2244192 bytesVariable Size            1.0167E+10 bytesDatabase Buffers         5804916736 bytesRedo Buffers               60059648 bytesDatabase mounted.Database opened.SQL> select userenv('language') from dual;USERENV('LANGUAGE')----------------------------------------------------AMERICAN_AMERICA.AL32UTF8SQL> 

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.