前阵子给以同事导oracle数据库,但是发现导入后数据都是乱码,下面是自己解决这个问题的一些小整理。
比如:
#su oralce$export ORACLE_SID=orcl$export ORACLE_HOME=/db/oracle/product/10.2.0/db_1$cd $ORACLE_HOME$cd bin$./sqlplus /nologSQL> 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
终端登录服务器执行下列: