connetct to CDB as a common user and verify that pdb_test is closed

SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 1258043702 PDB$SEED                       READ ONLY
         3 3749525766 PDB1                           READ ONLY
         4 2192587015 P4                             READ ONLY
         5  255759235 PDB_TEST                       READ WRITE

SQL> alter pluggable database pdb_test close;
SQL> alter pluggable database pdb_test unplug into '/tmp/xmlfile1.xml';
SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 1258043702 PDB$SEED                       READ ONLY
         3 3749525766 PDB1                           READ ONLY
         4 2192587015 P4                             READ ONLY
         5  255759235 PDB_TEST                       MOUNTED

 

A PDB must be dropped from the CDB before it can be plugged back into the same CDB

SQL> create pluggable database pdb_test using '/tmp/xmlfile1.xml' nocopy;
create pluggable database pdb_test using '/tmp/xmlfile1.xml' nocopy
*
ERROR at line 1:
ORA-65012: Pluggable database PDB_TEST already exists.


SQL> drop pluggable database pdb_test;
SQL> create pluggable database pdb_test using '/tmp/xmlfile1.xml' nocopy;
SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 1258043702 PDB$SEED                       READ ONLY
         3 3749525766 PDB1                           READ ONLY
         4 2192587015 P4                             READ ONLY
         5  255759235 PDB_TEST                       MOUNTED

SQL> alter pluggable database pdb_test open;
SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 1258043702 PDB$SEED                       READ ONLY
         3 3749525766 PDB1                           READ ONLY
         4 2192587015 P4                             READ ONLY
         5  255759235 PDB_TEST                       READ WRITE

SQL> 

 

相关文章:

  • 2021-08-12
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-07-12
  • 2021-04-11
猜你喜欢
  • 2021-10-14
  • 2021-11-19
  • 2021-11-24
  • 2021-09-02
  • 2021-06-04
  • 2022-01-25
相关资源
相似解决方案