在Redhat上安装Oracle 10g没有设定字符集,采用的是操作系统默认字符集:WE8ISO8859P1,将字符集修改为:ZHS16GBK。由于过程不可逆,首先需要备份数据库。
1.数据库全备 2.查询当前字符集
SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
PARAMETER VALUE
---------------------------------------- ----------------------------------------
NLS_CHARACTERSET WE8ISO8859P1 3.关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down. 4.启动数据库到mount状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 205520896 bytes
Fixed Size 1266608 bytes
Variable Size 100666448 bytes
Database Buffers 100663296 bytes
Redo Buffers 2924544 bytes
Database mounted. 5.限制session
SQL> alter system enable restricted session;
System altered. 6.查询相关参数并修改
SQL> show parameter job_queue_processes;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
job_queue_processes integer 10 SQL> show parameter aq_tm_processes;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 0 SQL> alter system set job_queue_processes=0;
System altered. 7.打开数据库
SQL> alter database open;
Database altered. 8.修改字符集
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 出现错误提示,新字符集必须是老字符集的超集,也就原来字符集是新字符集的子集,可以再Oracle官方文档上查询字符集包含关系。下面使用Oracle内部命令internal_use,跳过超集检查,生产环境不建议使用此方法。 SQL> alter database character set internal_use ZHS16GBK;
Database altered. 9.查询当前字符集
SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
PARAMETER VALUE
---------------------------------------- ----------------------------------------
NLS_CHARACTERSET ZHS16GBK 10.关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down. 11.启动数据库到mount状态
SQL> startup mount
ORACLE instance started.
Total System Global Area 205520896 bytes
Fixed Size 1266608 bytes
Variable Size 100666448 bytes
Database Buffers 100663296 bytes
Redo Buffers 2924544 bytes
Database mounted. 12.将相关参数改回原来值
SQL> alter system set job_queue_processes=10;
System altered. 13.打开数据库
SQL> alter database open;
Database altered.

Oracle 设定字符集的更多相关文章

  1. 转:php连接oracle设定字符集,避免乱码

    原文来自于:http://muyu.iteye.com/blog/399884 数据库用oracle,当php连接oracle的时候,最好指定字符集. 查PHP手册,oci_connect的第四个参数 ...

  2. 【Oracle+PHP】php连接oracle设定字符集,避免乱码

    数据库用oracle,当php连接oracle的时候,最好指定字符集. 查PHP手册,oci_connect的第四个参数为charset,这是关键. 首先获取oracle的字符集,运行“select ...

  3. [转]Oracle因安装时未设定字符集导致中文乱码的解决方案

    在CentOS 6.4上安装Oracle 11g没有设定字符集,采用的是操作系统默认字符集:WE8MSWIN1252,将字符集修改为:AL32UTF8. SQL> select userenv( ...

  4. oracle数据库字符集

    Oracle字符集的基本原理 1. Oracle服务器字符集 oracle以哪种字符编码存储字符,可以通过以下语句查出数据库字符集的设置. 方法1 SQL> select * from v$nl ...

  5. oracle基础教程(8)oracle修改字符集

    oracle基础教程(8)oracle修改字符集 1.用dba连接数据库 -->sqlplus / as sysdba 2.查看字符集 -->SELECT parameter, value ...

  6. Oracle数据库字符集修改

    Oracle字符集是一个字节数据的解释的符号集合,有大小之分,有相互的包容关系.ORACLE支持国家语言的体系结构允许你使用本地化语言来存储,处理,检索数据.一般来说,数据库字符集在安装数据库实例时就 ...

  7. Oracle更改字符集

    更改oracle的字符集: sqlplus / as sysdba SQL> shutdown immediate; Database closed. Database dismounted. ...

  8. Oracle 修改字符集

    出现ORA-12899,是字符集引起的,中文在UTF-8中占3个字节,ZHS16GBK中占2个字节,而源dmp文件字符集是ZHS16GBK库里倒出来的数据,现在要导入到目标字符集为UTF-8的库里,所 ...

  9. Oracle查字符集查版本号

    原文:Oracle查字符集查版本号 ---查字符集 select * from nls_database_parameters ---查版本 查看oracle的版本信息 (1)用客户端连接到数据库,执 ...

随机推荐

  1. 41、OrthoMCL和mcl软件进行基因家族分析

    转载:http://www.realbio.cn/news/124.html https://blog.csdn.net/seallama/article/details/43820763 http: ...

  2. win32多线程 (四) Mutex

    Mutex 用途和critical  section 非常类似,不过Mutex是内核对象,速度比section慢.Mutexes可以跨进程使用.另外Mutex在等待的时候可以设置等待时间. 以下是两种 ...

  3. ubuntu下安装配置apache2(含虚拟主机配置)

    在Ubuntu14.14中安装apache 安装指令: sudo apt-get install apache2 安装结束后: 产生的启动和停止文件是: /etc/init.d/apache2 启动: ...

  4. Odometry的发布和发布odom到base_link的tf变换

    转载自http://www.ncnynl.com/archives/201702/1328.html ROS发布nav_msgs/Odometry消息,以及通过tf从“odom”坐标系到“base_l ...

  5. dynamic和nullable一起使用时的注意

    dynamic和nullable一起使用时的注意

  6. MVC异常过滤器在三种作用范围下的执行顺序

    对于一般过滤器(即:除了IExceptionFilter ),当同时在Controller和Action中都设置了同一个过滤器后(例如IActionFilter),执行顺序一般是由外到里,即“全局”- ...

  7. properties配置文件在idea中默认utf-8编码可能会乱码的解决

    使用idea集成开发环境时,有时在properties配置文件有中文,在线上拿到的时乱码,如何解决? 这样设置: 最后说一下,setting设置是对当前项目的,想要所有的项目都有相同的设置,需要在 中 ...

  8. 编写高质量代码改善C#程序的157个建议——建议10: 创建对象时需要考虑是否实现比较器

    建议10: 创建对象时需要考虑是否实现比较器 有对象的地方就会存在比较,在.NET的世界中也一样.举个最简单的例子,在UI中,有一个10个人的Salary列表.根据排序的需要,列表要支持针对基本工资来 ...

  9. WOX快速搜索

    WOX wox和mac上的Aflred类似,虽然在功能上稍有逊色,但是还是可以给我们使用windows电脑带来很多福利.首先你不需要在桌面放一堆应用软件的快捷方式,桌面可以非常干净整洁,想要打开某个应 ...

  10. WP REST API: 设置和使用OAuth 1.0a Authentication(原文)

    In the previous part of the series, we set up basic HTTP authentication on the server by installing ...