oracle 12 去掉 cdb,Oracle 12c 学习之启动关闭CDB&PDB

Oracle 12c 学习之启动关闭CDB&PDB

1、默认登陆到CDB

$sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 11:01:46 2018

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

Connected to an idle instance.

2、启动CDB

SQL> startup

ORACLE instance started.

Total System Global Area 1560281088 bytes

Fixed Size 2924784 bytes

Variable Size 956305168 bytes

Database Buffers 587202560 bytes

Redo Buffers 13848576 bytes

Database mounted.

Database opened.

3、查看容器名

SQL> show con_name

CON_NAME

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

CDB$ROOT

4、查看pdb

默认会有一个PDB$SEED,PDB1是通过模版创建的。

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

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

2 PDB$SEED READ ONLY NO

3 PDB1 MOUNTED

5、默认pdb未启动,手动启动pdb

SQL> alter pluggable database all open;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

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

2 PDB$SEED READ ONLY NO

3 PDB1 READ WRITE NO

6、关闭pdb

SQL> alter pluggable database pdb1 close;

Pluggable database altered.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

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

2 PDB$SEED READ ONLY NO

3 PDB1 MOUNTED

7、pdb只读打开

SQL> alter pluggable database pdb1 open read only;

Pluggable database altered.

8、切换到pdb1

SQL> alter session set container=pdb1 ;

Session altered.

SQL> show con_name

CON_NAME

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

PDB1

9、也可以这样启动pdb

SQL> shutdown immediate;

Pluggable Database closed.

SQL> startup

Pluggable Database opened.

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED

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

3 PDB1 READ WRITE NO

10、切换到cdb,关闭cdb的同时,pdb也会跟着关闭

SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

©著作权归作者所有:来自51CTO博客作者roidba的原创作品,如需转载,请注明出处,否则将追究法律责任

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值