以下の内容はhttps://htn20190109.hatenablog.com/entry/2025/03/02/001759より取得しました。


{16 追加}DG環境PDBリモートクローン

 

https://docs.oracle.com/cd/F19136_01/refrn/STANDBY_PDB_SOURCE_FILE_DBLINK.html
https://www.dbi-services.com/blog/hot-clone-of-a-remote-pdb-in-a-dataguard-environment-19c/


remote dg ACT2 ACT2_PDB1
local dg ACT ACT_PDB2 -> ACT_PDB3

archive log list

SELECT * FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LOCAL_UNDO_ENABLED';

show parameter db_create_file_dest;

     
-- 1. local primary
vi tnsnames.ora

ACT =
  (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=mmm112.example.com)(PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=act.example.com)))

ACT2 =
  (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=mmm112.example.com)(PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=act2.example.com)))

 

-- 2. local standby
vi tnsnames.ora

ACT =
  (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST=mmm112.example.com)(PORT=1521))
  (CONNECT_DATA=
     (SERVICE_NAME=act.example.com)))


-- 3. remote primary

drop user C##USER01 cascade;
grant create session, sysoper to C##USER01 identified by oracle container=all;
 


-- 4. local primary
drop database link dblink01;
CREATE DATABASE LINK dblink01 CONNECT TO C##USER01 IDENTIFIED BY oracle USING 'ACT2';

create pluggable database ACT_PDB2 from ACT2_PDB1@dblink01 STANDBYS=NONE;
alter pluggable database ACT_PDB2 open;


drop user C##USER02 cascade;
grant create session, sysoper to C##USER02 identified by oracle container=all;

drop database link dblink02;
CREATE DATABASE LINK dblink02 CONNECT TO C##USER02 IDENTIFIED BY oracle USING 'ACT';


-- 5. local standby

show parameter standby_pdb_source_file_dblink;
alter system set standby_pdb_source_file_dblink='dblink02' scope=both;
show parameter standby_pdb_source_file_dblink;

-- 6. local primary

alter pluggable database ACT_PDB2 close;
alter pluggable database ACT_PDB2 open read only;
create pluggable database ACT_PDB3 from ACT_PDB2 STANDBYS=ALL;
alter pluggable database ACT_PDB3 open;


-- 7. local standby

alter pluggable database ACT_PDB3 open read only;

show pdbs;
select * from cdb_data_files order by con_id, file_id;

 

-- 8. local primary
alter pluggable database ACT_PDB2 close;
drop pluggable database ACT_PDB2 including datafiles;

 

 




以上の内容はhttps://htn20190109.hatenablog.com/entry/2025/03/02/001759より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14