码迷,mamicode.com
首页 > 数据库 > 详细

Oracle 12C -- 设置CDB启动后,PDBs自动启动

时间:2015-11-01 17:49:00      阅读:387      评论:0      收藏:0      [点我收藏+]

标签:

CDB重启后,PDBs默认是处于mounted状态

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           READ WRITE

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup 
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size                  2923680 bytes
Variable Size             436208480 bytes
Database Buffers          721420288 bytes
Redo Buffers               13852672 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           MOUNTED
PDB2                           MOUNTED

SQL> 

 

命令"alter pluggable database ... save state",可以让CDB重启后,pdb维持其关机前的状态。
取消设置使用"alter pluggable database ... discard state"。

SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           MOUNTED

SQL> alter pluggable database pdb1 save state;

Pluggable database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup ;
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size                  2923680 bytes
Variable Size             436208480 bytes
Database Buffers          721420288 bytes
Redo Buffers               13852672 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           MOUNTED

SQL> 

 

Oracle 12C -- 设置CDB启动后,PDBs自动启动

标签:

原文地址:http://www.cnblogs.com/abclife/p/4928088.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!