12C修改pdb字符集(RAC):
背景:
已安装的oracle12.2rac字符集为AL32UTF8,而且环境中已经有其他pdb,新建pdb进行数据导入是发现字符集问题导致导入报错(原库字符集是zhs16gbk),所以需要修改该pdb字符集,但不影响其他pdb。
--确认字pdb的符集
alter session set container=PDBTEST;
select userenv('language') from dual;
rac实例修改时和单实例有点不同,需要先停提所有其它instance,修改后再打开。
--修改字符集
alter pluggable database PDBTEST close immediate instances=all;
alter pluggable database PDBTEST open read write restricted;
-- in container PDBTEST
alter session set container=PDBTEST;
select userenv('language') from dual;
alter database character set internal_use zhs16gbk;
alter pluggable database PDBTEST close immediate;
--启动pdb确认
alter pluggable database PDBTEST open instances=all;
alter session set container=PDBTEST;
select userenv('language') from dual; <<<<<<<<<<此时字符集已经修改
alter pluggable database all save state;
--启动一下服务
srvctl start service -db ora12c -service tims