前陣子給以同事導oracle數據庫,但是發現導入後數據都是亂碼,下面是自己解決這個問題的一些小整理。
比如:#su oralce $export ORACLE_SID=orcl $export ORACLE_HOME=/db/oracle/product/10.2.0/db_1 $cd $ORACLE_HOME $cd bin $./sqlplus /nolog SQL> conn / as sysdba; SQL> shutdown immediate; SQL> startup mount SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION; SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0; SQL>ALTER DATABASE OPEN; SQL> ALTER DATABASE CHARACTER SET ZHS16GBK; ORA-12712: new character set must be a superset of old character set (意思是新字符集必須為舊字符集的超集,跳過即可) SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK; SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION; SQL> shutdown immediate; SQL> startup
Oracle 10g更改字符集AL32UTF8為ZHS16GBK
終端登錄服務器執行下列: