Oracle 11g R2 RAC数据库中文乱码解决

本文详细介绍了如何在Oracle 11g RAC环境下更改数据库字符集以解决中文乱码问题,并提供了具体的SQL命令及步骤。此外,还介绍了如何设置客户端环境变量解决SQL Plus中的中文显示问题。

1、解决数据库中文乱码:

更改字符集步骤(WE8ISO8859P1 --> ZHS16GBK) :

[oracle@rac121 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 10:56:55 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> shutdown immediate --这儿是RAC,所以需要关闭所有节点
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.3462E+10 bytes
Fixed Size                  2241104 bytes
Variable Size            7281315248 bytes
Database Buffers         6174015488 bytes
Redo Buffers                4485120 bytes
Database mounted.

SQL> alter system enable restricted session;

System altered.

SQL> show parameter job_queue

NAME                              TYPE          VALUE
-----------------------     -----------  ----------
job_queue_processes         integer        1000
SQL> show parameter aq_tm

NAME                              TYPE          VALUE
-----------------------     -----------  ----------
aq_tm_processes              integer        10

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;
Alter DATABASE character set INTERNAL_USE ZHS16GBK
*
ERROR at line 1:
ORA-12720: 操作要求数据库处于 EXCLUSIVE 模式下 --由于是RAC环境,所以要修改参数cluster_database

SQL> alter system set cluster_database=false scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1.3462E+10 bytes
Fixed Size                  2241104 bytes
Variable Size            7281315248 bytes
Database Buffers         6174015488 bytes
Redo Buffers                4485120 bytes
Database mounted.
SQL> alter system enable restricted session;

System altered.

SQL> alter database open;

Database altered.

SQL> Alter DATABASE character set INTERNAL_USE ZHS16GBK;

Database altered.

SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------------------------
SIMPLIFIED CHINESE_CHINA.ZHS16GBK

SQL> alter system set job_queue_processes=1000;

System altered.

SQL> alter system set aq_tm_processes=10;

System altered.

SQL> alter system set cluster_database=true scope=spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.


Total System Global Area 1.3462E+10 bytes
Fixed Size                  2241104 bytes
Variable Size            7281315248 bytes
Database Buffers         6174015488 bytes
Redo Buffers                4485120 bytes
Database mounted.
Database opened.
SQL> show parameter cluster_database

NAME                                    TYPE                   VALUE
-----------------                    -------------        ------------------
cluster_database                     boolean                TRUE
cluster_database_instances       integer                 2
SQL> --到此可以向数据库中插入中文



2、SQLPLUS中文乱码:

[oracle@rac122 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 31 11:20:21 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select * from terry.t2;

VNAME
--------------------
??
?????

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@rac122 ~]$ export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
[oracle@rac122 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on 星期五 8月 31 11:20:55 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select * from terry.t2;

VNAME
--------------------
呵呵
一二三国四

SQL> 





源码直接下载地址: https://pan.quark.cn/s/a4b39357ea24 "学成在线项目前端(涉及图片、源码、psd图片等资源)"所关联的知识要点主要分布在多个前端开发的核心范畴,涵盖了HTML、CSS、JavaScript以及设计素材的应用。该项目或许是一个在线教育体系完整界面的前端构建实例,整合了构建此类平台所需的所有核心构成部分。 1. **HTML**(HyperText Markup Language)作为一种结构化标记语言,用于网页内容的组织,定义了诸如头部、主体、段落、图像等网页组成部分。在具体项目中,HTML文档负责构建并展示页面的基础架构与内容,例如课程目录展示、用户身份验证模块、课程详细信息展示等单元。 2. **CSS**(Cascading Style Sheets)专注于网页的视觉表现与布局设计,涉及颜色方案、字体选择、尺寸设定、对齐模式等细节。在"学成在线"项目中,CSS技术可能被用于塑造统一的视觉体验,例如按钮外观设计、导航栏布局规划、页面自适应布局实现等,确保在同设备环境下的兼容性。 3. **JavaScript** 作为一种客户端脚本语言,旨在增强网页的交互性与动态表现。在"学成在线"项目中,JavaScript技术可能应用于用户行为的响应处理,如点击事件触发更多课程内容加载、表单输入验证、页面动态效果呈现、视频播放器控制等操作。此外,它也可能用于实现如AJAX异步数据获取等高级功能,以优化用户使用体验。 4. **PSD图片**代表Photoshop文档格式,通常用于存储设计构思或网页原型设计。在该项目中,PSD文件可能包含了用户界面的设计草图,设计师通过这些文件来规划并预览界面的视觉形态,包括色彩协调、图标...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值