当前位置:网站首页>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
边栏推荐
- Ubuntu16.04 completely delete MySQL database
- The ifeq, filter and strip of makefile are easy to use
- Oracle LiveLabs实验:Introduction to Oracle Spatial
- Image processing 12- image linear blending
- Can tonghuashun open an account? Can the security of securities companies be directly opened on the app? How to open an account for securities accounts
- USB mechanical keyboard changed to Bluetooth Keyboard
- Oracle SQL Developer的代码输入框中推荐使用的中文字体
- Recursively call knowledge points - including example solving binary search, frog jumping steps, reverse order output, factorial, Fibonacci, Hanoi tower.
- 服务没有报告任何错误mysql
- Teamwork collaboration application experience sharing | community essay solicitation
猜你喜欢

Kdd2022 | graphmae: self supervised mask map self encoder

SQL调优指南笔记11:Histograms

MySql主从复制

建立高可用的数据库

Icml2022 | Galaxy: apprentissage actif des cartes de polarisation

User guide for JUC concurrency Toolkit

Oracle LiveLabs实验:Introduction to Oracle Spatial

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

一级指针&二级指针知识点梳理

阅读笔记 Deep Hough Voting for 3D Object Detection in Point Clouds
随机推荐
Can tonghuashun open an account? Is it safe to open an account in tonghuashun
Main stages of garbage collection in ZGC
[QNX hypervisor 2.2 user manual] 4.3 obtain the host component
结构体知识点all in
ASCII 码对照表
[leetcode] 573 complex multiplication (conversion between characters and numbers)
GNS安装与配置
SQL调优指南笔记13:Gathering Optimizer Statistics
Digital intelligence data depth | Bi goes down the altar? It's not that the market has declined, it's that the story has changed
SQL调优指南笔记17:Importing and Exporting Optimizer Statistics
Npoi create word
#886 Possible Bipartition
MySql主从复制
JVisualVM初步使用
DRF receives nested data and creates objects. Solution: DRF not NULL constraint failed
SQL调优指南笔记14:Managing Extended Statistics
多线程模型下的生产者消费者模式
Oracle 19C installation documentation
重排数列练习题
Yanghui triangle code implementation