[20181010]12c clone pdb.txt
[20181010]12c clone pdb.txt
--//從來沒有測試過這個功能,測試看看.
1.環境:
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
SYS@test> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TEST01P READ WRITE NO
SYS@test> select FILE_NAME,FILE_ID,TABLESPACE_NAME,CON_ID from cdb_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME CON_ID
-------------------------------------------------- ---------- -------------------- ----------
D:\APP\ORACLE\ORADATA\TEST\TEST01P\UNDOTBS01.DBF 10 UNDOTBS1 3
D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSAUX01.DBF 9 SYSAUX 3
D:\APP\ORACLE\ORADATA\TEST\TEST01P\USERS01.DBF 11 USERS 3
D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSTEM01.DBF 8 SYSTEM 3
D:\APP\ORACLE\ORADATA\TEST\SYSTEM01.DBF 1 SYSTEM 1
D:\APP\ORACLE\ORADATA\TEST\SYSAUX01.DBF 3 SYSAUX 1
D:\APP\ORACLE\ORADATA\TEST\UNDOTBS01.DBF 5 UNDOTBS1 1
D:\APP\ORACLE\ORADATA\TEST\USERS01.DBF 7 USERS 1
8 rows selected.
2.克隆外掛資料庫看看.
SYS@test> alter pluggable database test01p close;
Pluggable database altered.
SYS@test> create pluggable database test02p from test01p FILE_NAME_CONVERT =('D:\APP\ORACLE\ORADATA\TEST\TEST01P\','D:\APP\ORACLE\ORADATA\TEST\TEST02P\') ;
create pluggable database test02p from test01p FILE_NAME_CONVERT =('D:\APP\ORACLE\ORADATA\TEST\TEST01P\','D:\APP\ORACLE\ORADATA\TEST\TEST02P\')
*
ERROR at line 1:
ORA-65036: pluggable database TEST01P not open in required mode
SYS@test> alter pluggable database test01p open read only ;
Pluggable database altered.
SYS@test> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 TEST01P READ ONLY NO
SYS@test> create pluggable database test02p from test01p FILE_NAME_CONVERT =('D:\APP\ORACLE\ORADATA\TEST\TEST01P\','D:\APP\ORACLE\ORADATA\TEST\TEST02P\') ;
Pluggable database created.
SYS@test> alter pluggable database test02p open read only ;
alter pluggable database test02p open read only
*
ERROR at line 1:
ORA-65085: cannot open pluggable database in read-only mode
SYS@test> alter pluggable database test02p open ;
Pluggable database altered.
$ sqlplus scott/btbtms@127.0.0.1:1521/test02p
SQL*Plus: Release 12.2.0.1.0 Production on Wed Oct 10 21:33:59 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Wed Oct 10 2018 21:00:55 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SCOTT@127.0.0.1:1521/test02p> select * from dept;
DEPTNO DNAME LOC
---------- -------------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SYS@test> select FILE_NAME,FILE_ID,TABLESPACE_NAME,CON_ID from cdb_data_files order by file_id;
FILE_NAME FILE_ID TABLESPACE_NAME CON_ID
-------------------------------------------------- ---------- -------------------- ----------
D:\APP\ORACLE\ORADATA\TEST\SYSTEM01.DBF 1 SYSTEM 1
D:\APP\ORACLE\ORADATA\TEST\SYSAUX01.DBF 3 SYSAUX 1
D:\APP\ORACLE\ORADATA\TEST\UNDOTBS01.DBF 5 UNDOTBS1 1
D:\APP\ORACLE\ORADATA\TEST\USERS01.DBF 7 USERS 1
D:\APP\ORACLE\ORADATA\TEST\TEST02P\SYSTEM01.DBF 20 SYSTEM 5
D:\APP\ORACLE\ORADATA\TEST\TEST02P\SYSAUX01.DBF 21 SYSAUX 5
D:\APP\ORACLE\ORADATA\TEST\TEST02P\UNDOTBS01.DBF 22 UNDOTBS1 5
D:\APP\ORACLE\ORADATA\TEST\TEST02P\USERS01.DBF 23 USERS 5
8 rows selected.
SYS@test> alter pluggable database test02p close ;
Pluggable database altered.
SYS@test> alter pluggable database test02p open read only ;
Pluggable database altered.
--//經歷一次open以後,就可以以open read only 開啟.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2215930/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20181010]v$rman_configuration沒有輸出.txt
- sourcetree github clone 報錯 hg clone fails with “repository not found“GithubAI
- WSL git cloneGit
- Oracle clone databaseOracleDatabase
- (十三).clone方法
- 1.3.2.1.2.3 Refreshable Clone PDBs
- SSH 方式 Git cloneGit
- Linux Clone函式Linux函式
- js2-cloneJS
- github clone 指定的tagGithub
- js deep clone 深克隆JS
- git clone倉儲問題Git
- Rust中的Copy和CloneRust
- git clone的使用小記Git
- jQuery原始碼解析之clone()jQuery原始碼
- Git clone 的小問題Git
- Github clone程式碼最快的方式Github
- MySQL 8 新特性之Clone PluginMySqlPlugin
- 使用映象配置為 Git Clone 加速Git
- git clone到指定的目錄Git
- git clone 慢並且會中斷Git
- MySQL的clone(克隆)要注意的點MySql
- gitlab如何實現批次clone倉庫Gitlab
- git clone失敗問題解決Git
- clone 淺克隆帶來的問題
- rust-quiz:030-clone-pointers.rsRustUI
- gitlab Clone Pull Push 日誌資訊Gitlab
- Idea clone 專案推送到自有倉庫Idea
- git clone失敗,超時,速度慢Git
- mac磁碟克隆備份工具:Clone X for macMac
- 使用Git命令列clone一個專案Git命令列
- JAVA 基礎 – clone淺克隆與深克隆Java
- 12C打psu
- Oracle 12c系列(十) | 12c中的Recovering Tables and Table PartitionsOracle
- Docker: docker pull, wget, curl, git clone 等如何更快?DockerwgetGit
- Java 中的 clone( ) 和 new,哪個效率更高?Java
- 02. Rust 記憶體管理 Copy & Clone(上)Rust記憶體
- 【OCM】Oracle 12C OCMU 12c OCM升級考試大綱Oracle