Oracleæ°æ®åºæ¥çåä¿®æ¹æå¡å¨ç«¯çå符éçæ¹æ³æ¯æ¬æ主è¦è¦ä»ç»çå
容ï¼æ¥ä¸æ¥æ让æ们ä¸èµ·æ¥äºè§£ä¸ä¸è¿é¨åå
容ã
Aãoracle server 端å符éæ¥è¯¢
select userenvï¼'language'ï¼ from dual
å
¶ä¸NLS_CHARACTERSET 为server端å符é
NLS_LANGUAGE 为 server端å符æ¾ç¤ºå½¢å¼
Bãæ¥è¯¢oracle client端çå符é
$echo $NLS_LANG
å¦æåç°ä½ select åºæ¥çæ°æ®æ¯ä¹±ç ï¼è¯·æclient端çå符éé
ç½®æä¸linuxæä½ç³»ç»ç¸åçå符éãå¦æè¿æ¯æä¹±ç ï¼åæå¯è½æ¯æ°æ®åºä¸çæ°æ®åå¨é®é¢ï¼æè
æ¯oracleæå¡ç«¯çé
ç½®åå¨é®é¢ã
Cãserver端å符éä¿®æ¹
å°æ°æ®åºå¯å¨å°RESTRICTED模å¼ä¸åå符éæ´æ¹ï¼
SQL> conn /as sysdba Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 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 ZHS16GBK;
ALTER DATABASE CHARACTER SET ZHS16GBK ERROR at line 1:
ORA-12712: new character set must be a superset of old character set
æ示æ们çå符éï¼æ°å符éå¿
须为æ§å符éçè¶
éï¼è¿æ¶æ们å¯ä»¥è·³è¿è¶
éçæ£æ¥åæ´æ¹ï¼
SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK;
Database altered.
SQL> select * from v$nls_parameters;
ç¥
19 rows selected.
éå¯æ£æ¥æ¯å¦æ´æ¹å®æï¼
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> select * from v$nls_parameters;
ç¥
19 rows selected.
æ们çå°è¿ä¸ªè¿ç¨åä¹åALTER DATABASE CHARACTER SETæä½çå
é¨è¿ç¨æ¯å®å
¨ç¸åçï¼ä¹å°±æ¯è¯´INTERNAL_USEæä¾ç帮å©å°±æ¯ä½¿Oracleæ°æ®åºç»è¿äºåéä¸è¶
éçæ ¡éªã
è¿ä¸æ¹æ³å¨æäºæ¹é¢æ¯æç¨å¤çï¼æ¯å¦æµè¯ï¼åºç¨äºäº§åç¯å¢å¤§å®¶åºè¯¥æ ¼å¤å°å¿ï¼é¤äºä½ 以å¤ï¼æ²¡æ人ä¼ä¸ºæ¤å¸¦æ¥çåæè´è´£ã
ç»è¯ï¼æ们ä¸å¦¨å说ä¸æ¬¡ï¼ï¼
对äºDBAæ¥è¯´ï¼æä¸ä¸ªå¾éè¦çååå°±æ¯ï¼ä¸è¦æä½ çæ°æ®åºç½®äºå±é©çå¢å°ï¼
è¿å°±è¦æ±æ们ï¼å¨è¿è¡ä»»ä½å¯è½å¯¹æ°æ®åºç»æåçæ¹åçæä½ä¹åï¼å
åææçå¤ä»½ï¼å¾å¤DBA没æå¤ä»½çæä½ä¸å¾å°äºæ¨ççæè®ã
Dãclient端å符éä¿®æ¹
å¨ /home/oracleä¸ /rootç¨æ·ç®å½ä¸çãbash_profileä¸
æ·»å æä¿®æ¹ export NLS_LANG="AMERICAN_AMERICA.UTF8" è¯å¥
温馨提示:答案为网友推荐,仅供参考