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

2021年09月15日 阅读数:3
这篇文章主要向大家介绍[Oracle 工程师手记]探究 Oracle PDB Application Container (四),主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。

接着上一回html

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

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

目前这个方法,尚未找到合理的解释:session

执行app

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

 就能够删除掉这个奇怪的 PDB,也是很神奇了。post

(这是我从新执行了前文 (三) 的动做,得到了 新的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 的数据文件也消失不见了。url

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 (五) spa