1. 程式人生 > >【翻譯自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的方法。

解決方案:
在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全部關閉。
[[email protected] ~]$ 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?
[[email protected] ~]$ 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> 

或者:
[[email protected] ~]$ 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

altered restrict 能夠 inf clas info proc 發生 reserve 怎麽startup/shutdown PDB? 來源於: 12c: How to Startup/Shutdown PDB‘s? (文檔 ID 1592247.1

翻譯mos文章怎麼startup/shutdown PDB

怎麼startup/shutdown PDB? 來源於: 12c: How to Startup/Shutdown PDB's? (文件 ID 1592247.1) 適用於: Oracle Database - Enterprise Edition - Version 12

翻譯mos文章使用asm來部署 超大數據庫(10TB到PB 範圍)--針對oracle 10G

2個 數值 acl 5.1 transport after 例如 clas rain 使用asm來部署 超大數據庫(10TB到PB 範圍) 參考原文: Deployment of very large databases (10TB to PB range) with

翻譯mos文章即使resource_limit = false, password的 資源限制也會生效

作用 pro use def alt doc 資源限制 lock bsp 即使resource_limit = false, password的 資源限制也會生效 參考原文: Resource limits for passwords work even with re

翻譯mos文章 在錯誤的從os級別remove掉 trace file 之後,怎麽找到該trace file的內容?

否則 lin reat -m evel data node name rate des 在錯誤的從os級別remove掉 trace file 之後,怎麽找到該trace file的內容? 參考原文: How to Find the Content

翻譯mos文章rman 標準版和企業版的兼容性

ont 數據庫 rac targe cati als track class dup rman 標準版和企業版的兼容性 來源於: RMAN Standard and Enterprise Edition Compatibility (文檔 ID 730193.1

翻譯mos文章註意: ASMB process exiting due to lack of ASM file activity

sse ins 安全 rac 註意 inf 實例 通信 統計 註意: ASMB process exiting due to lack of ASM file activity 參考原文: NOTE: ASMB process exiting due to l

翻譯mos文章使用asmcmd命令在本地和遠程 asm 實例之間 拷貝asm file的方法

export sha should dsm failed number files 遠程連接 關於 使用asmcmd命令在本地和遠程 asm 實例之間 拷貝asm file的方法 參考原文: How to Copy asm files between remot

翻譯mos文章當點擊完 finishbutton後,dbca 或者dbua hang住

cat queue class pop trace rom base done automatic 當點擊完 finishbutton後,dbca 或者dbua hang住 來源於: DBCA/DBUA APPEARS TO HANG AFTER CLICKIN

翻譯mos文章Windows平臺下的 Oraagent Memory Leak

style date any pat trac bytes issue processes ren 來源於: Oraagent Memory Leak (文檔 ID 1956840.1) APPLIES TO: Oracle Database - Ent

翻譯mos文章在RHEL7/OL7上安裝Oracle 12.1.0.2的伺服器端或者客戶端時,報需要"compat-libstdc++"包

在RHEL7/OL7上安裝Oracle 12.1.0.2的伺服器端或者客戶端時,報需要"compat-libstdc++"包 來源於: Installation of 12.1.0.2 Oracle Database Server/Client on RHEL 7/OEL7

翻譯mos文章怎麼正確的計算一個ip地址的subnet id?

怎麼正確的計算一個ip地址的subnet id? 來源於: How to calculate the correct subnet for an interface (文件 ID 1059759.1) 適用於: Oracle Database - Enterprise Ed

翻譯mos文章對rman 壓縮的徹底理解

對rman 壓縮的徹底理解 來源於: A Complete Understanding of RMAN Compression (文件 ID 563427.1) 適用於: Oracle Database - Enterprise Edition - Version 8.1.

翻譯mos文章Standby Redo Logs (SRL)的用途,益處與限制

Standby Redo Logs (SRL)的用途,益處與限制 來源於: Usage, Benefits and Limitations of Standby Redo Logs (SRL) (文件 ID 219344.1) 目的: 本文顯示了Standby Redo L

翻譯mos文章job 不能自動執行的解決方法

job 不能自動執行的解決方法 參考原文: Jobs do not execute automatically (Doc ID 309945.1) 適用於: Oracle Server - Enterprise Edition - Version: 9.2.0.4 This

翻譯mos文章將一個失敗的primary database 復原為physical standby 庫的步驟

將一個失敗的primary database 復原為physical standby 庫的步驟 參考自: Step by Step Guide on How To Reinstate Failed Primary Database into Physical Standby

翻譯mos文章引數Db_recovery_file_dest_size的最大值是多少

引數Db_recovery_file_dest_size的最大值是多少? 參考原文: What Is Maximum Size For Db_recovery_file_dest_size In Oracle 10.2, 11.1, 11.2 (Doc ID 1404822

翻譯HVR官方手冊HVR資料複製軟體介紹與術語解釋

【翻譯自HVR官方手冊】HVR資料複製軟體介紹與術語解釋 HVR資料複製軟體是荷蘭HVR公司推出的一款資料複製軟體,用於db到db,db到file,file到db,file到file的實時複製。 整個過程分為如下四個步驟: 第一步:配置Location 第二步:配置Channel 第三步

Python內建函式詳解翻譯python3.6官方文件共68個

翻譯源 來自:https://docs.python.org/3/library/functions.html  abs(x) 返回一個數的絕對值。引數可以是一個整數或一個浮點數。若引數是複數,返回複數的模 all(iterable) 若 可迭代物件中所有元素為真

網絡JS實現保存當前網頁HTML到本地

console http nts jquer () webkit 網絡 ctu color <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <titl