oracle 19c rac 修改PDB字符集

[root@tdcxldb01 ~]# su - oracle
Last login: Sun Jun 18 17:17:46 CST 2023
[oracle@tdcxldb01 ~]$
[oracle@tdcxldb01 ~]$
[oracle@tdcxldb01 ~]$ export ORACLE_SID=CHENXINLEI1
[oracle@tdcxldb01 ~]$
[oracle@tdcxldb01 ~]$
[oracle@tdcxldb01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jun 18 17:43:54 2023
Version 19.15.0.0.0

Copyright © 1982, 2022, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.15.0.0.0

SQL>
SQL>
SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

 2 PDB$SEED			  READ ONLY  NO
 
26 TDCXL			  READ WRITE NO

SQL>
SQL>
SQL> alter session set container=TDCXL;

Session altered.

SQL>
SQL> select userenv(‘language’) from dual;

USERENV(‘LANGUAGE’)

AMERICAN_AMERICA.ZHS16GBK

SQL>
SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE NO

SQL>
SQL>
SQL>
SQL> alter database character set internal_use AL32UTF8;
alter database character set internal_use AL32UTF8
*
ERROR at line 1:
ORA-12719: operation requires database is in RESTRICTED mode

SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE NO

SQL>
SQL>
SQL> conn / as sysdba
Connected.
SQL>
SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

 2 PDB$SEED			  READ ONLY  NO
 
26 TDCXL			  READ WRITE NO

SQL>
SQL> alter session set container =TDCXL;

Session altered.

SQL>
SQL> select count(*) from v$session;

COUNT(*)

   182

SQL>
SQL> @tbs

TABLESPACE_NAME SUM_SPACE(M) SUM_BLOCKS USED_SPACE(M) USED_RATE(%) FREE_SPACE(M)


USERS 55 7040 44.81 81.47 10.19
SYSAUX 31150 3987200 518.62 1.66 30631.38
SYSTEM 31050 3974400 449.56 1.45 30600.44
TDCXL_TBS 20480 2621440 163.25 .8 20316.75
UNDO_2 10445 1336960 61.87 .59 10383.13
UNDOTBS1 10455 1338240 32.87 .31 10422.13
TEMP 10297 1318016 0

7 rows selected.

SQL>
SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE NO

SQL>
SQL>

SQL>
SQL> alter pluggable database TDCXL close immediate instances=all;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  MOUNTED

SQL>
SQL> alter pluggable database TDCXL open read write restricted instances=all;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE YES

SQL>
SQL> select userenv(‘language’) from dual;

USERENV(‘LANGUAGE’)

AMERICAN_AMERICA.ZHS16GBK

SQL> alter database character set internal_use AL32UTF8;
alter database character set internal_use AL32UTF8
*
ERROR at line 1:
ORA-65025: Pluggable database TDCXL is not closed on all instances.

SQL> alter pluggable database TDCXL close immediate instances=all;

Pluggable database altered.

SQL> alter pluggable database TDCXL open read write restricted;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE YES

SQL> select userenv(‘language’) from dual;

USERENV(‘LANGUAGE’)

AMERICAN_AMERICA.ZHS16GBK

SQL> alter database character set internal_use AL32UTF8;

Database altered.

SQL> alter pluggable database TDCXL close immediate instances=all;

Pluggable database altered.

SQL>
SQL> ?alter pluggable database TDCXL open instances=all;
SP2-0734: unknown command beginning “?alter plu…” - rest of line ignored.
SQL>
SQL> alter pluggable database TDCXL open instances=all;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME			  OPEN MODE  RESTRICTED

26 TDCXL			  READ WRITE NO

SQL>
SQL> select userenv(‘language’) from dual;

USERENV(‘LANGUAGE’)

AMERICAN_AMERICA.AL32UTF8

SQL>

你可能感兴趣的:(运维日常,oracle,数据库,sql)