当前位置:网站首页>Cloning PDB with ADG standby
Cloning PDB with ADG standby
2022-06-12 21:39:00 【dingdingfish】
This article refers to the article :How to Clone a PDB from a Standby Database in a Data Guard Environment, And completed the whole experimental process .
First you need a ADG Environment , A better way is to use Oracle Vagrant Projects Of OracleDG project .
This project will create 1 Lord 1 Prepared ADG Environmental Science , Version is 19.3. be based on 64GB Memory ,4 OCPU The host of , Creation time 30 About minutes , Very fast .
Create another one on the standby database CDB, Used to host clones PDB. use dbca Silent mode creation , Time in 22 About minutes .
The current architecture is as follows ,PDB1 It is a library that needs to be cloned :
The above standard DB193H1 and DB193H1_STDBY yes DB_UNIQUE_NAME, The actual database name is DB193H1.
For clarity , We will DB193H1 It is called the main library ,DB193H1_STDBY It is called standby library ,ORCLCDB2 Called the test library .
First , We need to change the standby database to read-only status :
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ORCLPDB1 MOUNTED
SQL> alter pluggable database orclpdb1 open read only;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ORCLPDB1 READ ONLY NO
Because the standby database can only be read-only at most , Therefore, we need to build an additional database to host the cloned PDB. If you directly use the... On the standby database CDB As the target container for cloning , The error will be reported as follows :
SQL> create pluggable database PDBCLONE from ORCLPDB1;
create pluggable database PDBCLONE from ORCLPDB1
*
ERROR at line 1:
ORA-16000: database or pluggable database open for read-only access
We create a clone administrator on the master database clone_admin, yes common user, He will be used to clone later , After this user is established, it will pass ADG Propagate to the standby database .
create user c##clone_admin identified by Welcome1;
grant create session, resource to c##clone_admin container=all;
grant create pluggable database to c##clone_admin container=all;
grant sysoper to c##clone_admin container=all;
alter user c##clone_admin set container_data=ALL container=current;
grant select on cdb_pdbs to c##clone_admin;
-- In the reference document 1 in , Another method was used , But I didn't try
grant create session, sysoper to C##SYSOPER identified by SysOperPw__199 container=all;
Then create a test library Database link, Be careful , this Database link It refers to the standby database rather than the primary database , The purpose is to reduce the impact on the main database , And avoid network delays .
SQL> create public database link clone_link connect to c##clone_admin identified by Welcome1 using 'DB193H1_STDBY';
SQL> select pdb_name from cdb_pdbs@clone_link;
PDB_NAME
--------------------------------------------------------------------------------
PDB1
PDB$SEED
At present, our backup database ( Cloned source library ) State the following :
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
At present, our test library ( Target library for cloning ) State the following :
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
Start the clone in the test library :
SQL> create pluggable database PDBCLONE from PDB1@clone_link;
create pluggable database PDBCLONE from PDB1@clone_link
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [3647], [19], [16400], [], [], [],
[], [], [], [], [], []
Okay , This is exactly the mistake we expected . Because it is cloned from the standby database , So this error will appear . If you clone from the master library , It won't go wrong , But this is not the scenario we tested today .
MOS This document of Create Pluggable Database From ADG errors out with ORA-600 [3647] (Doc ID 2072550.1), The causes and solutions are introduced in detail . The applicable database versions of this document are 12.1.0.2 to 21.1.
Simply speaking , The solution is to stop redo apply Clone again , After cloning , You can start redo apply.
Be careful , The last clone failed , But there is still a PDB The entry of , We need to delete it first :
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBCLONE MOUNTED
SQL> drop pluggable database PDBCLONE including datafiles;
Pluggable database dropped.
It can be in the database or DGMGRL Stop in redo apply:
-- In the database
alter database recover managed standby database cancel ;
-- DGMGRL in
edit database db193h1_stdby set state = 'apply-off';
This time I succeeded :
SQL> create pluggable database PDBCLONE from PDB1@clone_link;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 PDBCLONE MOUNTED
SQL> alter pluggable database pdbclone open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
4 PDBCLONE READ WRITE NO
Now you can recover redo apply 了 :
-- In the database
alter database recover managed standby database disconnect ;
-- DGMGRL in
edit database db193h1_stdby set state = 'apply-on';
To further confirm , I installed in the main library Sample Schema, Repeat the above process , The data is indeed cloned into the test library .
Here are some instructions :
- The last picture in the original text , It clearly describes the sequence of operations and where they are performed . For... In the standby database PDB, First stop redo apply, then open readonly; After cloning , First close PDB( Clone Source ), And then again start redo apply. Although I didn't execute close And the action of , But still follow his process .
- Refreshable PDB Cloning does not support based on ADG standby establish , I won't try this . See Doc ID 2765472.1
Reference resources
边栏推荐
- (4) Pyqt designs and implements the [factory production management system] order page - add, delete, modify and query (including source code analysis)
- 测试基础之:单元测试
- USB机械键盘改蓝牙键盘
- Graphics2D类基本使用
- 复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展
- 冒泡排序
- Jdbctemplate inserts and returns the primary key
- SQL调优指南笔记6:Explaining and Displaying Execution Plans
- SQL调优指南笔记15:Controlling the Use of Optimizer Statistics
- Gzip compression decompression
猜你喜欢

Smart management of green agriculture: a visual platform for agricultural product scheduling

SQL调优指南笔记16:Managing Historical Optimizer Statistics

SQL调优指南笔记6:Explaining and Displaying Execution Plans

SQL调优指南笔记10:Optimizer Statistics Concepts

Graphics2D类基本使用

ASCII 码对照表

Icml2022 | Galaxy: apprentissage actif des cartes de polarisation

风控建模十:传统建模方法存在的问题探讨及改进方法探索

一款高颜值的MySQL管理工具

Npoi create word
随机推荐
NiO User Guide
Linux backup MySQL
ICML2022 | GALAXY:极化图主动学习
复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展
selenium操作元素遇到的异常
#981 Time Based Key-Value Store
Oracle 19C installation documentation
SQL调优指南笔记13:Gathering Optimizer Statistics
SQL调优指南笔记18:Analyzing Statistics Using Optimizer Statistics Advisor
#886 Possible Bipartition
ICML2022 | GALAXY:極化圖主動學習
User guide for JUC concurrency Toolkit
递归调用知识点-包含例题求解二分查找、青蛙跳台阶、逆序输出、阶乘、斐波那契、汉诺塔。
冒泡排序
模块八:设计消息队列存储消息数据的MySQL表
ASCII code comparison table
Solve one-dimensional array prefix sum
Main stages of garbage collection in ZGC
Introduction to the characteristics of balancer decentralized exchange market capitalization robot
Npoi create word