当前位置:网站首页>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
边栏推荐
- How to implement a simple publish subscribe mode
- #886 Possible Bipartition
- KDD2022 | GraphMAE:自监督掩码图自编码器
- zgc的垃圾收集的主要阶段
- Can flush open an account? Can you directly open the security of securities companies on the app
- Teambition 协作应用心得分享|社区征文
- 杨辉三角代码实现
- drf 接收嵌套数据并创建对象, 解决:drf NOT NULL constraint failed
- 利用ADG Standby克隆PDB
- Oracle数据库中查询执行计划的权限
猜你喜欢

CVPR 2022 | 应对噪声标签,西安大略大学、字节跳动等提出对比正则化方法

Sorting out the knowledge points of primary and secondary indicators

ICML2022 | GALAXY:极化图主动学习

Icml2022 | Galaxy: apprentissage actif des cartes de polarisation

#113 Path Sum II

Oracle LiveLabs实验:Introduction to Oracle Spatial Studio

复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展

@loadbalance annotation of resttemplate

Risk control modeling X: Discussion on problems existing in traditional modeling methods and Exploration on improvement methods

阅读笔记 Deep Hough Voting for 3D Object Detection in Point Clouds
随机推荐
Principales étapes de la collecte des ordures à Zgc
Pixel level reconstruction and restoration technology to solve severe image blur
Insert sort
JVisualVM初步使用
一级指针&二级指针知识点梳理
复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展
KDD2022 | GraphMAE:自监督掩码图自编码器
冒泡排序
实现从字符串中删除某个字符操作
NiO User Guide
Rearrangement exercises
ATOI super resolution
Jdbctemplate inserts and returns the primary key
Can flush open an account? Can you directly open the security of securities companies on the app
有向图深拷贝
递归调用知识点-包含例题求解二分查找、青蛙跳台阶、逆序输出、阶乘、斐波那契、汉诺塔。
The ifeq, filter and strip of makefile are easy to use
(4) Pyqt designs and implements the [factory production management system] order page - add, delete, modify and query (including source code analysis)
Redis cluster mget optimization
Risk control modeling X: Discussion on problems existing in traditional modeling methods and Exploration on improvement methods