欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ORACLE11G 字符集更改(这里更改为AL32UTF8)

程序员文章站 2022-05-07 16:44:11
...
更改步骤:1、用sysdba角色用户登录sqlplus: 命令行输入:sqlplus sys as sysdba

               2、输入口令,进入sqlplus:sql>---

               3、依次键入下面的命令行执行:

                    shutdown immediate;
                    STARTUP MOUNT;
                    ALTER SESSION SET SQL_TRACE=TRUE;
                    ALTER SYSTEM ENABLE RESTRICTED SESSION;
                    ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
                    ALTER SYSTEM SET AQ_TM_PROCESSES=0;
                    ALTER DATABASE OPEN;
                    ALTER DATABASE character set INTERNAL_USE AL32UTF8;
                    ALTER SESSION SET SQL_TRACE=FALSE;
                    shutdown immediate;
                    startup;

风险分析:执行上述命令,有可能造成数据库中已有数据混乱的情况,所以在进行操作前,

               要进行数据库的备份操作;

结果查看:察看 NLS_LANG 信息:
               SELECT parameter, value FROM v$nls_parameters WHERE parameter LIKE '%CHARACTERSET';
              NLS_LANG 信息已经变成:


              NLS_CHARACTERSET
              AL32UTF8
              NLS_NCHAR_CHARACTERSET
              AL16UTF16