[Oracle 工程师手记]探究 Oracle PDB Application Container (四)

接着上一回

 [Oracle 工程师手记]探究 Oracle PDB Application Container (三)

说一说,如何解决附加的 PDB。

目前这个方法,还没有找到合理的解释:

执行

ALTER PLUGGABLE DATABASE APPLICATION ref_app SET COMPATIBILITY VERSION '1.1' ;

 就可以删除掉这个奇怪的 PDB,也是很神奇了。

(这是我重新执行了前文 (三) 的动作,获得了 新的PDB后的测试结果)

SQL> alter session set container=cdb$root;

Session altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB193                         MOUNTED
         4 APPCON1                        READ WRITE NO
         6 APPPDB1                        READ WRITE NO
         8 F4127053456_3_1                READ WRITE NO
SQL>


SQL> alter session set container=appcon1;

Session altered.

SQL> ALTER PLUGGABLE DATABASE APPLICATION ref_app SET COMPATIBILITY VERSION '1.1';

Pluggable database altered.

SQL> alter session set container=cdb$root;

Session altered.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB193                         MOUNTED
         4 APPCON1                        READ WRITE NO
         6 APPPDB1                        READ WRITE NO

<<<<<<<<<<< 上面的 F4127053456_3_1 PDB,消失不见了!

SQL>
SQL> alter session set container=appcon1;

Session altered.

SQL>
SQL> COLUMN app_name FORMAT A20
COLUMN app_version FORMAT A10

SELECT app_name,
       app_version,
       app_status
FROM   dba_applications
WHERE  app_name = 'REF_APP';

APP_NAME             APP_VERSIO APP_STATUS
-------------------- ---------- ------------
REF_APP              1.1        NORMAL

SQL>

这个PDB 的数据文件也消失不见了。

SQL> select con_id, name from v$datafile order by con_id;

    CON_ID
----------
NAME
--------------------------------------------------------------------------------
         4
/refresh/home/cpdest/DB193CDB/BF761DFF522F4797E0538828410AB8E8/datafile/o1_mf_re
f_app__j6xxvvs0_.dbf

         4
/refresh/home/cpdest/DB193CDB/BF761DFF522F4797E0538828410AB8E8/datafile/o1_mf_un
dotbs1_j6xxvcws_.dbf

         4

    CON_ID
----------
NAME
--------------------------------------------------------------------------------
/refresh/home/cpdest/DB193CDB/BF761DFF522F4797E0538828410AB8E8/datafile/o1_mf_sy
saux_j6xxvcwq_.dbf

         4
/refresh/home/cpdest/DB193CDB/BF761DFF522F4797E0538828410AB8E8/datafile/o1_mf_sy
stem_j6xxvcwm_.dbf

         6
/refresh/home/cpdest/DB193CDB/BF761DFF52324797E0538828410AB8E8/datafile/o1_mf_un

    CON_ID
----------
NAME
--------------------------------------------------------------------------------
dotbs1_j6xxvnwt_.dbf

         6
/refresh/home/cpdest/DB193CDB/BF761DFF52324797E0538828410AB8E8/datafile/o1_mf_sy
saux_j6xxvnws_.dbf

         6
/refresh/home/cpdest/DB193CDB/BF761DFF52324797E0538828410AB8E8/datafile/o1_mf_re
f_app__j6xxyygl_.dbf

    CON_ID
----------
NAME
--------------------------------------------------------------------------------

         6
/refresh/home/cpdest/DB193CDB/BF761DFF52324797E0538828410AB8E8/datafile/o1_mf_sy
stem_j6xxvnwr_.dbf


8 rows selected.

SQL>

 下一回:[Oracle 工程师手记]探究 Oracle PDB Application Container (五)

posted @ 2021-04-08 20:38  健哥的数据花园  阅读(100)  评论(0编辑  收藏  举报