oracle数据库字符集的修改(AL32UTF-8 改为 ZHS16GBK)

时间:2022-02-08 08:30:37

$sqlplus /nolog

SQL>conn / as sysdba

然后执行以下命令:
SQL>shutdown immediate    //关闭数据库服务器
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;


(  ERROR at line 1:ORA-12721: operation cannot execute when other sessions are active
若出现上面的错误,使用下面的办法进行修改,使用INTERNAL_USE可以跳过超集的检查:
SQL>ALTER DATABASE CHARACTER SET INTERNAL_USE ZHS16GBK;  )


SQL>SHUTDOWN IMMEDIATE
SQL>STARTUP

字符集修改完毕