新特性:CDB/PDB的维护命令:使用PDB$SEED创建PDB

1、查看PDB$SEED的文件路径

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       READ WRITE NO
SQL> alter session set container=PDB$SEED;

Session altered.

SQL> select FILE_NAME from dba_data_files ;

FILE_NAME
--------------------------------------------------------------------------------
+DATA1/WHS1/86B637B62FE07A65E053F706E80A27CA/DATAFILE/system.265.1057318247
+DATA1/WHS1/86B637B62FE07A65E053F706E80A27CA/DATAFILE/sysaux.266.1057318247
+DATA1/WHS1/86B637B62FE07A65E053F706E80A27CA/DATAFILE/undotbs1.267.1057318247

SQL> exit

2、创建PDB

[oracle@cat1 trace]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Nov 24 15:51:01 2020
Version 19.3.0.0.0

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

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

SQL>  CREATE PLUGGABLE DATABASE pdb2_whs ADMIN USER pdb_whs IDENTIFIED BY oracle file_name_convert=('+DATA1','+DATA1');

Pluggable database created.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       READ WRITE NO
         4 PDB2_WHS                       MOUNTED
SQL> alter pluggable database PDB2_WHS open;

Pluggable database altered.

SQL> alter session set container=PDB2_WHS;

Session altered.

SQL> select FILE_NAME from dba_data_files ;

FILE_NAME
--------------------------------------------------------------------------------
+DATA1/WHS1/B4D692BC71BCD7E8E0532900A8C0F12A/DATAFILE/system.280.1057333867
+DATA1/WHS1/B4D692BC71BCD7E8E0532900A8C0F12A/DATAFILE/sysaux.281.1057333867
+DATA1/WHS1/B4D692BC71BCD7E8E0532900A8C0F12A/DATAFILE/undotbs1.279.1057333867

Related Posts