ZHS16GBK轉換成AL32UTF8

hellohf123發表於2022-02-21

現字符集

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。




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2856605/,如需轉載,請註明出處,否則將追究法律責任。

相關文章