当前位置:网站首页>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
边栏推荐
猜你喜欢

如何自己动手写一个vscode插件,实现插件自由!

Teambition 协作应用心得分享|社区征文

GNS installation and configuration

ASCII code comparison table

Experiment 7-2-6 print Yanghui triangle (20 points)

利用ADG Standby克隆PDB

Compiling process of OpenSSL and libevent on PC

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

ICML2022 | GALAXY:極化圖主動學習

Sorting out the knowledge points of primary and secondary indicators
随机推荐
复杂系统如何检测异常?北卡UNCC等最新《复杂分布式系统中基于图的深度学习异常检测方法综述》,阐述最新图异常检测技术进展
[qnx hypervisor 2.2 manuel de l'utilisateur] 4.2 environnement de construction pris en charge
ATOI super resolution
Oracle LiveLabs实验:Introduction to Oracle Spatial Studio
Gzip compression decompression
[target detection] |dive detector into box for object detection new training method based on fcos
atoi超强解析
【QNX Hypervisor 2.2 用户手册】4.2 支持的构建环境
#141 Linked List Cycle
Smart management of green agriculture: a visual platform for agricultural product scheduling
Pointer and array & pointer and const & struct and Const
Semester summary of freshman year
Fill in the checklist & lt; int> Have default values? [repeat] - fill list & lt; int> with default values? [duplicate]
Shell script Basics
Bluetooth for Delphi xe7
【QNX Hypervisor 2.2 用户手册】4.3 获取host组件
Binary search
How do complex systems detect anomalies? North Carolina UNCC and others' latest overview of graph based deep learning anomaly detection methods in complex distributed systems describes the latest prog
【目标检测】|Dive Deeper Into Box for Object Detection 基于FCOS新训练方法
Oracle SQL Developer的代码输入框中推荐使用的中文字体