DBAtlas · Database operations atlas

Create a refreshable PDB, refresh it and convert it to an independent PDB

OracleMultitenant

Command

-- In the target CDB root (DB link to the source ready: see pdb-clone-remote):
CREATE PLUGGABLE DATABASE <new_pdb> FROM <pdb>@clone_link
  FILE_NAME_CONVERT = ('/<pdb>/', '/<new_pdb>/')
  REFRESH MODE EVERY 60 MINUTES;
SELECT pdb_name, status, refresh_mode, refresh_interval, last_refresh_scn
FROM   dba_pdbs WHERE pdb_name = UPPER('<new_pdb>');

-- Can only be opened READ ONLY; close it first to refresh manually:
ALTER PLUGGABLE DATABASE <new_pdb> OPEN READ ONLY;
ALTER PLUGGABLE DATABASE <new_pdb> CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE <new_pdb> REFRESH;

-- Change the mode (MANUAL) or convert to an independent, writable PDB (irreversible):
ALTER PLUGGABLE DATABASE <new_pdb> REFRESH MODE MANUAL;
ALTER PLUGGABLE DATABASE <new_pdb> REFRESH MODE NONE;
ALTER PLUGGABLE DATABASE <new_pdb> OPEN;

What it does

Creates a copy that is kept current by applying the source PDB's redo periodically or on demand; it opens READ ONLY for reporting and becomes an independent read-write PDB with REFRESH MODE NONE.

When to use it

For a regularly refreshed reporting/test copy of production, a low-downtime PDB migration (final refresh + REFRESH MODE NONE), or a "cheap PDB-level standby".

Caution

The PDB must be closed during a refresh; while open READ ONLY the automatic refresh waits. The archivelogs needed for the refresh must be accessible on the source. REFRESH MODE NONE is irreversible; the copy can no longer be refreshed. Requires local undo + ARCHIVELOG on the source. It does not replace Data Guard for real DR.

Open in DBAtlas →

Related