oracle字符集调整

1  select userenv('language') from dual;

select * from nls_database_parameters

1.       关闭数据库

SQL>SHUTDOWN IMMEDIATE

 

2. 启动到Mount

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;

SQL>ALTER DATABASE NATIONAL CHARACTER SET AL16UTF16;


--如果是从子集到父集,需要使用INTERNAL_USE 参数,跳过超子集检测
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE AL32UTF8;

SQL>ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE AL16UTF16;

 


SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP

注意:如果没有大对象,在使用过程中进行语言转换没有什么影响,(切记设定的字符集必须是ORACLE支持,不然不能start) 按上面的做法就可以。

 

若出现‘ORA-12717: Cannot ALTER DATABASE NATIONAL CHARACTER SET when NCLOB data exists’ 这样的提示信息,

要解决这个问题有两种方法

1. 利用INTERNAL_USE 关键字修改区域设置,

2. 利用re-create,但是re-create有点复杂,所以请用internal_use

 

SQL>SHUTDOWN IMMEDIATE;

SQL>STARTUP MOUNT EXCLUSIVE;

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 NATIONAL CHARACTER SET INTERNAL_USE UTF8;

SQL>SHUTDOWN immediate;

SQL>startup;

 

你可能感兴趣的:(oracle)