ORACLE 19C创建多个不同字符集PDB
现在需要在一个测试环境创建1个为AL32UTF8的PDB,2个ZHS16GBK的PDB
这种情况下,必须先创建的CDB为AL32UTF8,下面是具体步骤:
1.AL32UTF8的pdb在建实例的时候一起创建完成
2.创建第一个ZHS16GBK的PDB cdr,通过pdbseed来克隆:
SQL> create pluggable database cdr admin user suq identified by suq file_name_convert=('pdbseed','cdr');
SQL> alter pluggable database cdr open;
SQL> alter session set container=cdr;
SQL> alter system enable restricted session;
SQL> alter pluggable database cdr character set internal_use zhs16gbk;
SQL> shutdown immediate
SQL> startup
3.创建第二个pdb cdrlog,通过克隆cdr来实现:
SQL> create pluggable database cdrlog from cdr file_name_convert=('cdr','cdrlog');
SQL> alter pluggable database cdrlog open;
SQL> alter pluggable database all save state;
4.检查每个pdb的字符集
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DBSERVER READ WRITE NO
4 CDR READ WRITE NO
5 CDRLOG READ WRITE NO
SQL> alter session set container=dbserver;
Session altered.
SQL> select userenv('LANGUAGE') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.AL32UTF8
SQL> alter session set container=cdr;
Session altered.
SQL> select userenv('LANGUAGE') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
SQL> alter session set container=cdrlog;
Session altered.
SQL> select userenv('LANGUAGE') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
SQL>
原文地址:https://blog.csdn.net/su377486/article/details/142821697
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!