ZHS16GBK转换成AL32UTF8

现字符集

SQL>  select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK



rac环境转换字符集

关闭数据库
[root@rac2 ~]# srvctl stop database -db hap
转换
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 4999609048 bytes
Fixed Size                  9145048 bytes
Variable Size             956301312 bytes
Database Buffers         4026531840 bytes
Redo Buffers                7630848 bytes
SQL> alter system set cluster_database=FALSE scope=spfile sid='*';
System altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 4999609048 bytes
Fixed Size                  9145048 bytes
Variable Size             956301312 bytes
Database Buffers         4026531840 bytes
Redo Buffers                7630848 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 INTERNAL_USE AL32UTF8;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
启动并检查
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 4999609048 bytes
Fixed Size                  9145048 bytes
Variable Size             956301312 bytes
Database Buffers         4026531840 bytes
Redo Buffers                7630848 bytes
SQL> alter system set cluster_database=TRUE scope=spfile sid='*';
System altered.
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 4999609048 bytes
Fixed Size                  9145048 bytes
Variable Size             956301312 bytes
Database Buffers         4026531840 bytes
Redo Buffers                7630848 bytes
Database mounted.
Database opened.
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
SQL>


这样rac的字符集就从ZHS16GBK转换成AL32UTF8。




请使用浏览器的分享功能分享到微信等