Skip to main content

HOT CLONE PDB FROM 12c TO19c : ORACLE DATABASE MULTITENANT

 HOT CLONE PDB from 12c è 19c :

 

1 -- Compatibility checks: Ensure that any features or options used in the 12c PDB are compatible with the 19c CDB

SQL> SELECT name, value FROM parameter WHERE name='compatible';

 

2 -- Prepare the Target 19c CDB

Ensure that the target 19c CDB is up and running, and configure a TNS listener to allow connectivity between the source and target databases.

 

3  -- Ensure the common user has required privileges to clone the PDB.

SQL> CREATE USER c##borg IDENTIFIED BY oracle DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp CONTAINER=ALL;

SQL> GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE, SYSOPER TO c##borg CONTAINER = ALL;

 

3 -- Create a Database Link on Target (19c CDB)

From the 19c CDB, create a database link to the source 12c CDB.

SQL> CREATE DATABASE LINK clone_link CONNECT TO <user_with_sufficient_privileges> IDENTIFIED BY "<password>" USING '<12c_TNS>';

 

 

5 -- Create public database link on Target database

CREATE public DATABASE link clonemypdb CONNECT TO c##borg IDENTIFIED BY oracle USING 'CDB1';

 

6 -- Create Pluggable database like below from target database.

CREATE PLUGGABLE DATABASE PDB1 FROM PDB1@clonemypdb file_name_convert=('CDB1','CDB2');

 

7 -- Open Pluggable database in upgrade mode.

ALTER PLUGGABLE DATABASE PDB1 OPEN UPGRADE;

 

8 – PDB Upgrade.

Then I need to open PDB1 in CDB2 in UPGRADE mode because its dictionary is still an Oracle 12.2.0.1 dictionary whereas it operates now within a 19c database. We need to upgrade it.

 

9 -- Upgrade PDB1 like below

$ dbupgrade -c "PDB1" -l /home/oracle/logs

$ORACLE_HOME/rdbms/admin/catctl.pl -d \

$ORACLE_HOME/rdbms/admin -c 'FIDONEW' -l $ORACLE_BASE catupgrd.sql

10 -- Once upgrade is completed OPEN PDB1 and run utlrp

 

SQL> alter pluggable database PDB1 open;

SQL> alter pluggable database PDB1 save state;

 

$ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -c 'PDB1' -e -b utlrp -d $ORACLE_HOME/rdbms/admin utlrp.sql

 

11 -- $ORACLE_HOME/perl/bin/perl $ORACLE_HOME/rdbms/admin/catcon.pl -n 1 -c 'PDB1' -l /home/oracle/logs -b utltz_upg_check -d $ORACLE_HOME/rdbms/admin  utltz_upg_check.sql

 

Automatically creating directories for the clone PDB's database files if they don't already exist

 

SAVE STATE:

 

SAVE STATE: This command ensures that the current state of the PDB (whether it’s open or closed) is saved. If the container database (CDB) is restarted, the saved state of the PDB will automatically be restored.

 

Practical Usage:

If PDB1 is currently open and you run ALTER PLUGGABLE DATABASE PDB1 SAVE STATE;, Oracle will remember that PDB1 was open. After a CDB restart, PDB1 will be automatically opened again without manual intervention.

Similarly, if PDB1 was closed, Oracle will remember this state and keep it closed after the CDB restarts.

 

SELECT name, value FROM v$parameter WHERE name LIKE '_%seed_cdb%';

 

 

Comments

Popular posts from this blog

Issues and Solutions for Oracle 19c Grid Infrastructure Installation

     Common Issues and Solutions for Oracle 19c Grid Infrastructure Installation •       Check Log Files for Details Oracle installation issues often provide valuable clues in the log files. If the installer seems stuck or fails, check the following logs: ▪ Install log : /u01/app/oraInventory/logs/installActions<date>.log •       ▪ Grid Infrastructure log : $ORACLE_BASE/cfgtoollogs/ •         •       These logs can provide error messages and help identify the exact issue. •         •        Check Permissions and Ownership Verify that the Oracle Grid Infrastructure installation directories have the correct ownership and permissions. •        For example: •        Make sure the grid user has permission to write to the directories where the i...

CHANGING DBID FOR ORACLE DATABASE 11G

C:\Users\computer>sqlplus SQL*Plus: Release 11.1.0.7.0 - Production on Thu Sep 10 21:03:33 2013 Copyright (c) 1982, 2008, Oracle.  All rights reserved. Enter user-name: sys as sysdba Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select dbid from v$database;       DBID ---------- 2188161033 SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options C:\Users\computer>nid DBNEWID: Release 11.1.0.7.0 - Production on Thu Sep 10 21:04:44 2013 Copyright (c) 1982, 2007, Oracle.  All rights reserved. Keyword     Description                    (Default) ---------------------------------------------------- TARGET ...

How to Improve Oracle Data Pump Performance - IMPDP

  How to Improve Oracle Data Pump Performance:- Use Parallelism : Set the PARALLEL parameter to at least 2 * number of CPUs . This allows multiple worker processes to perform tasks simultaneously, speeding up both export and import processes. Example: PARALLEL=4 for a system with 2 CPUs. Perform Import Using NETWORK_LINK : Use the NETWORK_LINK parameter to import data directly from the source database. This method is particularly helpful when space is constrained, as it streams the data without needing to generate dump files on the source. It can also reduce time compared to exporting and then importing, as data is streamed directly from the source to the target database. Disable Archivelog Mode (Standalone Databases) : For standalone databases, temporarily disable archive logging during the import process. Import operations can generate a lot of redo logs, slowing down the import. Disabling...