Oracle12c日常pdb建立、開關和刪除操作

ultradb發表於2016-10-20

1.1  Oracle12c日常pdb建立、開關和刪除操作

1.1.1  直接建立pdb資料庫

CREATE PLUGGABLE DATABASE testdb

ADMIN USER testdbdb IDENTIFIED BY testdb

STORAGE (MAXSIZE 2G MAX_SHARED_TEMP_SIZE 100M)

DEFAULT TABLESPACE testdbdb DATAFILE '/opt/oracle//datafile/testdbdb_001.dbf' SIZE 25M AUTOEXTEND ON;

1.1.2  以現有模板建立pdb資料庫,

CREATE PLUGGABLE DATABASE testdbdb

ADMIN USER testdbdb  IDENTIFIED BY testdbdb roles=(dba)

file_name_convert=('/inm/data/oracle12c/oradata/testdb/pdbseed','/inm/data/oracle12c/oradata/testdb/testdbdb') ;

1.1.3  刪除pdb資料庫

DROP PLUGGABLE DATABASE testdb INCLUDING DATAFILES

1.1.4  開啟關閉單個pdb資料庫

alter pluggable database testdb open

alter pluggable database testdb close immediate;

1.1.5  All  Pdb開關操作

開啟所有的pdb

alter pluggable database all open;

 alter pluggable database all close immediate;

1.1.6  切換pdb

切換到pdb1

SYS@cdb >alter session set container=pdb1;

1.1.7  當前pdb狀態

show  pdbs;

[oracle@inmdb03 expdp]$ sqlplus "/as sysdba"

 

SQL*Plus: Release 12.1.0.2.0 Production on Thu May 7 17:55:42 2015

 

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

 

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

 

SQL> show pdbs;

 

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         3 testdb                          MOUNTED

         4 INMWAP                         MOUNTED

         5 testdbTEST                      MOUNTED

         6 NMSVIP                         MOUNTED

         7 testdbBIZ                       MOUNTED

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24179204/viewspace-2126806/,如需轉載,請註明出處,否則將追究法律責任。

相關文章