Linux下修改Oracle字符集为ZHS16GBK

切换oracle用户

[root@train ~]# su - oracle       
Last login: Thu Apr 16 13:35:35 CST 2020 on pts/1

登录到oracle
[oracle@train ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Apr 17 09:48:42 2020

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

Connected to an idle instance.

将oracle关闭

SQL> shutdown immediate;

Database closed. 

Database dismounted. 

ORACLE instance shut down. 

进入mount模式

SQL> startup mount 

ORACLE instance started.

Total System Global Area 1543503872 bytes
Fixed Size                  8621040 bytes
Variable Size             989856784 bytes
Database Buffers          536870912 bytes
Redo Buffers                8155136 bytes
Database mounted.
Database opened.

启用受限会话

SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION; 

System altered. 

设置作业队列进程为0(当设置为0的时候任何方式创建的job都无法执行)

SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; 

System altered. 

设置Qnnn进程和QMNC进程为0(为了防止修改字符集时还有其他任务执行)

SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0; 

System altered. 

SQL> alter database open; 

Database altered. 

SQL> ALTER DATABASE CHARACTER SET ZHS16GBK; 

Database altered. 

SQL> ALTER DATABASE character set INTERNAL_USE ZHS16GBK; 

Database altered. 

SQL> shutdown immediate; 

Database closed. 

Database dismounted. 

ORACLE instance shut down. 

SQL> startup 

ORACLE instance started.

Total System Global Area 1543503872 bytes
Fixed Size                  8621040 bytes
Variable Size             989856784 bytes
Database Buffers          536870912 bytes
Redo Buffers                8155136 bytes
Database mounted.
Database opened.

查看修改结果

SQL> select * from v$nls_parameters; 

猜你喜欢

转载自blog.csdn.net/qq_37823979/article/details/105573522