首页 > 代码库 > 【翻译自mos文章】怎么startup/shutdown PDB?
【翻译自mos文章】怎么startup/shutdown PDB?
怎么startup/shutdown PDB?
来源于:
12c: How to Startup/Shutdown PDB‘s? (文档 ID 1592247.1)
适用于:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
目标:
startup/shutdown PDB的方法。
在CDB中运行SHUTDOWN IMMEDIATE 会发生什么?
假设我们在container database (CDB)级别使用传统的shutdown命令。那么我们会把CDB和其下所有的PDB所有关闭。
从上面我们能确认:在container database (CDB)级别使用SHUTDOWN IMMEDIATE命令会把CDB和其下所有的PDB所有关闭
怎么关闭个别的PDB?
或者:
也能够这么写:SQL> alter pluggable database pn1 close immediate;
一旦我们运行了shutdown命令,pdb总是停留在mount状态
怎么依据须要启动某一个PDB?
有两种不同的方式来启动PDB
Open PDB in restricted mode
Open PDB with force option
也能够把PDB open到upgrade模式
SQL> alter pluggable database PN1 open UPGRADE;
注意。本文也适用于rac,仅仅须要把v$换成GV$
来源于:
12c: How to Startup/Shutdown PDB‘s? (文档 ID 1592247.1)
适用于:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
目标:
startup/shutdown PDB的方法。
解决方式:
在12c之前,传统的startup/shutdown 命令是:
Shutdown Command SHUTDOWN NORMAL SHUTDOWN IMMEDIATE SHUTDOWN ABORT
Startup Command STARTUP STARTUP NOMOUNT STARTUP MOUNT
在CDB中运行SHUTDOWN IMMEDIATE 会发生什么?
假设我们在container database (CDB)级别使用传统的shutdown命令。那么我们会把CDB和其下所有的PDB所有关闭。
[oracle@rhel59 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 13 03:45:42 2016 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, OLAP, Advanced Analytics and Real Application Testing options SQL> select instance_name from v$instance; INSTANCE_NAME ---------------- orcl SQL> show con_name CON_NAME ------------------------------ CDB$ROOT SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> alter session set container=pn1; alter session set container=pn1 * ERROR at line 1: ORA-01034: ORACLE not available Process ID: 0 Session ID: 0 Serial number: 0 SQL>
从上面我们能确认:在container database (CDB)级别使用SHUTDOWN IMMEDIATE命令会把CDB和其下所有的PDB所有关闭
怎么关闭个别的PDB?
[oracle@rhel59 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 13 05:37:18 2016 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, OLAP, Advanced Analytics and Real Application Testing options SQL> SELECT NAME,OPEN_MODE from v$PDBS; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PN1 READ WRITE PN2 MOUNTED SQL> ALTER SESSION SET CONTAINER=pn1; ------------->>>>关键点 Session altered. SQL> SHUTDOWN IMMEDIATE; Pluggable Database closed. SQL> SELECT NAME,OPEN_MODE from v$PDBS; NAME OPEN_MODE ------------------------------ ---------- PN1 MOUNTED SQL>
或者:
[oracle@rhel59 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 13 05:40:10 2016 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, OLAP, Advanced Analytics and Real Application Testing options SQL> SELECT NAME,OPEN_MODE from v$PDBS; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PN1 READ WRITE PN2 MOUNTED SQL> alter pluggable database pn1 close;---->>关键点 Pluggable database altered. SQL> SELECT NAME,OPEN_MODE from v$PDBS; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PN1 MOUNTED PN2 MOUNTED SQL>
也能够这么写:SQL> alter pluggable database pn1 close immediate;
一旦我们运行了shutdown命令,pdb总是停留在mount状态
怎么依据须要启动某一个PDB?
有两种不同的方式来启动PDB
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PN1 MOUNTED 4 PN2 MOUNTED SQL> alter pluggable database pn1 open; Pluggable database altered. SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PN1 READ WRITE 4 PN2 MOUNTED SQL> select con_id, name, open_mode,RESTRICTED from v$PDBS; CON_ID NAME OPEN_MODE RES ---------- ------------------------------ ---------- --- 2 PDB$SEED READ ONLY NO 3 PN1 READ WRITE NO 4 PN2 MOUNTED SQL>
Open PDB in restricted mode
SQL> alter pluggable database PN1 open restricted; Pluggable database altered. SQL> SELECT NAME,OPEN_MODE,RESTRICTED from v$PDBS; NAME OPEN_MODE RES ------------------------------ ---------- --- PN1 READ WRITE YES
Open PDB with force option
SQL> alter pluggable database PN1 open FORCE; Pluggable database altered. SQL> SELECT NAME,OPEN_MODE,RESTRICTED from v$PDBS; NAME OPEN_MODE RES ------------------------------ ---------- --- PN1 READ WRITE NO
也能够把PDB open到upgrade模式
SQL> alter pluggable database PN1 open UPGRADE;
注意。本文也适用于rac,仅仅须要把v$换成GV$
【翻译自mos文章】怎么startup/shutdown PDB?
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。