rac 环境下修改oracle数据库字符集为GBK

 
 
 
 

今天安装数据库(oracle10.2.0.4)的时候字符集不小心没有改动,导致界面乱码,由于是rac环境和单实例的不太一样

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

 

1、查询当前的字符集

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

USERENV(‘LANGUAGE‘)
--------------------------------------------------------------------------------
AMERICAN_AMERICA.WE8ISO8859P1

sql> alter system set cluster_database=false scope=spfile sid=‘jscn1‘;

红色部分对于单实例的是不要加的,对于rac来说必须加上,不然会报

ORA-12720: operation requires database is in EXCLUSIVE mode


2、停止数据库(rac1和rac2都要停止)

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


3、启动数据库(只在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、修改字符集
SQL> ALTER DATABASE character set INTERNAL_USE zhs16gbk;
sql> alter system set cluster_database=true scope=spfile sid=‘jscn1‘;


5、验证(两个节点都要测)

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、启动rac2,验证rac2的字符集(废话,公用一个数据库,当然一样了)

 

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

 

以下为本人原创

今天按照上面blog,成功修改rac环境字符集
 
oracle 11.2.0.3 
 
select userenv(‘language‘) from dual;
SIMPLIFIED CHINESE_CHINA.ZHS16GBK 
 
改为:
 
select userenv(‘language‘) from dual;
SIMPLIFIED CHINESE_CHINA.AL32UTF8
 
 
这是rac node1的操作

[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, 2011, 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> 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>


rac node 2的操作,其中关机是一开始操作的,启动是最后操作的。 

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.0167E+10 bytes
Database Buffers         5804916736 bytes
Redo Buffers               60059648 bytes
Database mounted.
Database opened.
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.0167E+10 bytes
Database Buffers         5804916736 bytes
Redo Buffers               60059648 bytes
Database mounted.
Database opened.
SQL> select userenv(‘language‘) from dual;

USERENV(‘LANGUAGE‘)
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8

SQL> 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 


rac 环境下修改oracle数据库字符集为GBK,布布扣,bubuko.com

rac 环境下修改oracle数据库字符集为GBK

上一篇:SQL PLUS Options


下一篇:【SQL Server DBA】日常巡检1:数据库空间、状态、使用的监控