1. 程式人生 > >oracle資料庫字元編碼utf-8改為ZHS16GBK

oracle資料庫字元編碼utf-8改為ZHS16GBK

首先檢視服務端字符集
select * from v$nls_parameters where parameter = 'NLS_CHARACTERSET'
NLS_CHARACTERSET WE8MSWIN1252
然後用sys使用者進行修改
>sqlplus 
>conn /as sysdba
>輸入口令:
>shutdown immediate;
>startup mount;
>ALTER SESSION SET SQL_TRACE=TRUE;
>ALTER> SYSTEM ENABLE RESTRICTED SESSION;
>ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
>ALTER SYSTEM SET AQ_TM_PROCESSES=0;
>ALTER DATABASE OPEN;
>alter database character set ZHS16GBK;
ORA-12712: new character set must be a superset of old character set
RROR at line 1:
結果報錯,提示新字符集必須是老字符集的超集。
於是強制轉換
>ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
>shutdown immediate;
>STARTUP;
問題解決。
 
INTERNAL_USE是沒有寫在文件中的引數,用於強制完成字符集轉化