Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create, switch and delete oracle 12c pdb

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "oracle 12c pdb how to create, switch, delete", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "oracle 12c pdb how to create, switch, delete" this article.

Pdb tests: create, switch, delete

The concepts of CDB and PDB are put forward in ORACLE12C

They can be understood as containers and plug-ins respectively (PDB is inserted in CDB)

The management of CDB is not different from that of traditional database.

-- confirm the current cdb

SQL > select name,cdb from v$database

NAME CDB

ZARADB YES

-- query the basic information of current pdb

Col pdb_name for a30

Select pdb_id,pdb_name,dbid,status,creation_scn from dba_pdbs

Select con_id,dbid,NAME,OPEN_MODE from v$pdbs

PDB_ID PDB_NAME DBID STATUS CREATION_SCN

3 PDB1 3337485269 NORMAL 1909544

2 PDB$SEED 4072348290 NORMAL 1720741

SQL >

CON_ID DBID NAME OPEN_MODE

-

2 4072348290 PDB$SEED READ ONLY

3 3337485269 PDB1 READ WRITE

-- create a pdb

-- 1 create directly

CREATE PLUGGABLE DATABASE pdb2

ADMIN USER pdb2dba IDENTIFIED BY anbaisheng

STORAGE (MAXSIZE 2G MAX_SHARED_TEMP_SIZE 100m)

DEFAULT TABLESPACE tbs_pdb2 DATAFILE'/ opt/oracle/oradata/ZARADB/datafile/pdb2_001.dbf' SIZE 25m AUTOEXTEND ON

-- 2 create an existing pdb as a template

-- an existing pdb can only be created in read only mode, otherwise an error will be reported.

-- create a pdb2 using pdb1 as a template

Drop pluggable database pdb2 including datafiles

Alter pluggable database pdb1 close

Alter pluggable database pdb1 open read only

Create pluggable database pdb2

From pdb1

File_name_convert = ('/ opt/oracle/oradata/ZARADB/E98BEB85B1A80C56E0439A02A8C05841/datafile/','/opt/oracle/oradata/ZARADB/datafile/pdb2')

-- turn pdb on and off

Alter pluggable database pdb2 close

Alter pluggable database all close

Alter pluggable database pdb2 close immediate

Alter pluggable database pdb2 open

Alter pluggable database all open

-- Delete pdb

-- similar to deleting tablespaces, you can cascade delete data files

Drop pluggable database pdb2

Drop pluggable database pdb2 including datafiles

-- unplug

-- pdb can only mount but not open after unplug

Alter pluggable database pdb2 unplug into'/ tmp/pdb2.xml'

Delete pdb after unplug, and then add it back to pdb using xml file

Drop pluggable database pdb2

Create pluggable database pdb2 using'/ tmp/pdb2.xml' nocopy

The above is all the content of the article "how to create, switch and delete oracle 12c pdb". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report