背景描述
在cent os的英文环境下安装了oracle 10g,但是忘记调整字符集为GBK,导致最后安装的是ISO8859-1的字符集,很艰难的在centos上安装的数据库,不想重新安装,只能通过oracle自带的功能来修改字符集。
解决方法
1、oracle用户登陆
-
[root@itest1 cas-tomcat-7.0.11]# su oracle
-
[oracle@itest1 cas-tomcat-7.0.11]$ sqlplus /nolog
-
-
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 15 11:34:54 2014
-
-
Copyright (c) 1982, 2005, Oracle. All rights reserved.
2、关闭数据库
-
SQL> conn / as sysdba
-
Connected.
-
SQL> shutdown immediate
-
Database closed.
-
Database dismounted.
-
ORACLE instance shut down.
3、修改字符集
-
SQL> startup mount
-
ORACLE instance started.
-
-
Total System Global Area 553648128 bytes
-
Fixed Size 1220532 bytes
-
Variable Size 163577932 bytes
-
Database Buffers 385875968 bytes
-
Redo Buffers 2973696 bytes
-
Database mounted.
-
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 ZHS16GBK;
-
-
Database altered.
4、重启oracle
-
SQL> shutdown immediate;
-
Database closed.
-
Database dismounted.
-
ORACLE instance shut down.
-
-
SQL> startup
-
ORACLE instance started.
-
-
Total System Global Area 553648128 bytes
-
Fixed Size 1220532 bytes
-
Variable Size 163577932 bytes
-
Database Buffers 385875968 bytes
-
Redo Buffers 2973696 bytes
-
Database mounted.
-
Database opened.
阅读(1386) | 评论(0) | 转发(0) |