欢迎投稿

今日深度:

Oracle12c修改字符集的方法(解决数据导入后中文乱码及ORA-12899错误),

Oracle12c修改字符集的方法(解决数据导入后中文乱码及ORA-12899错误),


之前在Windows上安装的Oracle,现在迁移到Linux上,把dmp文件导入Linux的时候发现字段的注释和存储过程中的中文是问号?,而且导入的时候还会报ORA-12899错误。其实这些都是字符集问题。

1、查询当前字符集

select * from nls_database_parameters where parameter='NLS_CHARACTERSET';

如果不是ZHS16GBK说明确实是字符集问题。

2、关闭数据库

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

3、启动数据库到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.

4、限制session

SQL> alter system enable restricted session;
System altered.

5、禁用作业调度进程,确保无进程调用数据库

先查询之前的值

SQL> show parameter job_queue_processes;

把参数置为0

SQL> alter system set job_queue_processes=0;
System altered.

6、打开数据库

alter database open;

7、修改字符集

SQL> alter database character set internal_use ZHS16GBK;          
Database altered.

8、查询当前字符集

SQL> select * from nls_database_parameters where parameter='NLS_CHARACTERSET';
PARAMETER                                VALUE
---------------------------------------- ----------------------------------------
NLS_CHARACTERSET                         ZHS16GBK

9、重复2关闭数据库和3启动数据库到mount状态并将作业调度进程参数调回之前的值

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 
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.
 
SQL> alter system set job_queue_processes=110;
System altered.

10、恢复session

SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;
System altered.

11、打开数据库

SQL> alter database open;
Database altered.

到此这篇关于Oracle 12c修改字符集的方法(解决数据导入后中文乱码及ORA-12899错误)的文章就介绍到这了,更多相关Oracle 12c修改字符集内容请搜索PHP之友以前的文章或继续浏览下面的相关文章希望大家以后多多支持PHP之友!

您可能感兴趣的文章:
  • oracle11g客户端连接12c服务器ORA-01017错误问题解决
  • 关于Oracle12C默认用户名system密码不正确的解决方案
  • 部署Oracle 12c企业版数据库( 安装及使用)
  • Oracle12c图形化&静默安装踩坑的方法步骤
  • 解决oracle12c创建用户提示ORA-65096:公用用户名或角色无效问题
  • oracle12C安装步骤(图文详解)

www.htsjk.Com true http://www.htsjk.com/oracle/47954.html NewsArticle Oracle12c修改字符集的方法(解决数据导入后中文乱码及ORA-12899错误), 之前在Windows上安装的Oracle,现在迁移到Linux上,把dmp文件导入Linux的时候发现字段的注释和存储过程中的中文是问号...
评论暂时关闭