Relocate PDB from 18C to 19C

General Steps

1.Relocate PDB from 18C to 19C 
2.Upgrade PDB on 19C side
3.Open Relocated PDB on 19C side.
4.Wait for 10 mins to check if there is block corruption on relocated PDB on 19C side

Environment :

source DB: 18C

Target DB: 19C

Source DB: A

Target DB: B

Source DB_NAME=cdb

Target DB_NAME=orcl

 

Detailed Steps:

Steps.

Source 18C: DB  A (DB_NAME=cdb)

Target 19C : DB  A  (DB_NAME=orcl)

 
1Enable archivelogEnable archivelog 
2

alter pluggable datbaase testpdb. close abort instances=all;
drop pluggable database testpdb including datafiles;
create pluggable database testpdb admin user admin identified by admin;
alter pluggable database testpdb open instances=all;
alter pluggable datbaase testpdb close immediate instances=all;
alter pluggable database testpdb open;
alter user system identified by systempasswd;
grant CREATE SESSION,connect, sysoper, create pluggable database to SYSTEM container=all;

/ 
3

Add tns entry:

[oracle@A admin]$vi $ORACLE_HOME/network/admin/tnsnames.ora
TESTPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = A_DB_scanip_domainname)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testpdb.domainname)
)
)

Add tns entry:

[oracle@B admin]$vi $ORACLE_HOME/network/admin/tnsnames.ora

remote_source18C_CDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = A_DB_scanip_domainname)(PORT = 1521))   <==写Source CDB的值
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cdb.domainname)   <====写Source CDB的CDB级的service name (即:在Source cdb,sql里执行show parameter service的值)
)
)

 
 

Grant permission via sqlplus:

grant execute on sys.DBMS_SQL to system container=all;

grant select any table to system container=all;

grant sysdba to system CONTAINER=ALL;

GRANT CREATE SESSION, RESOURCE, CREATE ANY TABLE, UNLIMITED TABLESPACE TO system CONTAINER=ALL;

GRANT CREATE PLUGGABLE DATABASE TO system CONTAINER=ALL;

GRANT SYSOPER TO system CONTAINER=ALL;

Grant permission via sqlplus:

grant execute on sys.DBMS_SQL to system container=all;

grant select any table to system container=all;

grant sysdba to system CONTAINER=ALL;

GRANT CREATE SESSION, RESOURCE, CREATE ANY TABLE, UNLIMITED TABLESPACE TO system CONTAINER=ALL;

GRANT CREATE PLUGGABLE DATABASE TO system CONTAINER=ALL;

GRANT SYSOPER TO system CONTAINER=ALL;

 
4 

Create dblinke and relocated PDB:

Sqlplus /nolog  

SQL>   connect sys/syspassword@orcl as sysdba

SQL>   drop database link cdb1_link;

SQL>   create database link cdb1_link connect to system identified by <systempassword> using 'remote_source18C_CDB';

SQL>   create pluggable database pdbrelocate from testpdb@cdb1_link relocate;   

Pluggable database created.

 
5 

Open PDB:

SQL> alter pluggable database pdbrelocate open upgrade;

Pluggable database altered.

 
6 

Upgrade relocate PDB to 19C:

Command: $ORACLE_HOME/bin/dbupgrade -c '<PDB1>,<PDB2>, ..., <PDBn>'

[oracle@B admin]$ dbupgrade -c 'pdbrelocate';

Argument list for [$ORACLE_HOME/rdbms/admin/catctl.pl]
For Oracle internal use only A = 0
Run in c = pdbrelocate
Do not run in C = 0
Input Directory d = 0
Echo OFF e = 1
Simulate E = 0
Forced cleanup F = 0
Log Id i = 0
Child Process I = 0
Log Dir l = 0
Priority List Name L = 0
Upgrade Mode active M = 0
SQL Process Count n = 0
SQL PDB Process Count N = 0
Open Mode Normal o = 0
Start Phase p = 0
End Phase P = 0
Reverse Order r = 0
AutoUpgrade Resume R = 0
Script s = 0
Serial Run S = 0
Classic Upgrade t = 0
RO User Tablespaces T = 0
Upgrade PDBs in Upgrade mode x = 0
Display Phases y = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0

catctl.pl VERSION: [19.0.0.0.0]
STATUS: [Production]

...

Serial Phase #:98 [PDBRELOCATE] Files:1 Time: 0s
**** Upgrading ODM, WK, EXF, RUL, XOQ, LCTR ****
Serial Phase #:100 [PDBRELOCATE] Files:1 Time: 7s
*********** Final Component scripts ***********
Serial Phase #:102 [PDBRELOCATE] Files:1 Time: 2s
************* Final Upgrade scripts ************
Serial Phase #:103 [PDBRELOCATE] Files:1 Time: 4s
******************* Migration ******************
Serial Phase #:104 [PDBRELOCATE] Files:1 Time: 0s
*** End PDB Application Upgrade Pre-Shutdown ***
Serial Phase #:105 [PDBRELOCATE] Files:1 Time: 0s
***************** Post Upgrade *****************
**************** Summary report ****************
Serial Phase #:109 [PDBRELOCATE] Files:1 Time: 3s
*** End PDB Application Upgrade Post-Shutdown **
Serial Phase #:110 [PDBRELOCATE] Files:2 Time: 0s

Grand Total Time: 904s [PDBRELOCATE]

LOG FILES: ($ORACLE_BASE/cfgtoollogs/orcl/upgrade20201014083821/catupgrdpdbrelocate*.log)

Upgrade Summary Report Located in:
$ORACLE_BASE/cfgtoollogs/orcl/upgrade20201014083821/upg_summary.log

Time: 917s For PDB(s)

Grand Total Time: 917s

LOG FILES: ($ORACLE_BASE/cfgtoollogs/orcl/upgrade20201014083821/catupgrd*.log)

Grand Total Upgrade Time: [0d:0h:15m:17s]

 
  

Open relocated PDB:

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
4 PDB2 MOUNTED
5 PDB3 MOUNTED
6 PDBRELOCATE MOUNTED
SQL> alter pluggable database pdbrelocate open;

Pluggable database altered.

SQL>  select * from PDB_PLUG_IN_VIOLATIONS where con_id=6;

 
  

Check if there is block corrpution:

SQL> select * from v$database_block_corruption;

no rows selected

SQL> alter pluggable database pdbrelocate close immediate;

Pluggable database altered.

SQL> alter pluggable database pdbrelocate open;

Pluggable database altered.

SQL> select * from v$database_block_corruption;

no rows selected

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值