A preserved pluggable database needs a suitable destination. Oracle's compatibility function compares the described database with the container database where the function runs. Its Boolean result and the plug-in violation report help identify problems and choose the next action.
Oracle DBA Lesson 50 Part 2 — Check PDB Plug Compatibility
Part 1 covered closing, unplugging, and preserving the source. This part covers the destination assessment. Part 3 covers plugging in, opening, and validating the target.
Requirements before the check
For a direct Oracle Database 19c PDB plug, establish these decisions before the compatibility check.
| Area | Decision to establish |
|---|---|
| Release | The source-to-target release path is supported. Automatic downgrade by plugging a higher-release PDB into a lower-release CDB is unsupported. An upgrade requires its supported upgrade procedure. |
| Options | Source database options are the same as, or a subset of, those available in the target. Installation does not by itself establish edition or licensing eligibility. |
| Platform | The direct procedure requires matching endianness: the byte order used to represent data. Cross-endian movement requires the documented conversion or migration workflow. |
| Character sets | Apply the database and national character-set rules for the actual container type. Identical character sets are not a universal requirement. |
| Files | The destination database process can access the descriptor and every required preserved data file. Plan source-file mapping, destination copies, and temporary-file handling. |
| Encryption | Required TDE keys and wallets, and the mode-specific import or access procedure, are available. A compatibility result does not test every key or recovery operation. |
| Capacity and recovery | Establish space, permissions, transfer integrity, and a tested recovery path. Keep source copies and recovery resources through target validation. |
When the target CDB database character set is AL32UTF8, the multitenant guide relaxes the usual source and target database and national character-set compatibility requirement. Other Globalization Support Guide restrictions still apply, including supported character sets, container type, and cross-container access. An application PDB must use the same character set and national character set as its application container. One Unicode label does not make every character-set combination valid.
RAC, Data Guard, application containers, cross-endian moves, release upgrades, and encryption can add separate procedures. See plugging in an unplugged PDB and choosing a character set.
Establish the destination context
Run the check in the intended destination root. The session needs EXECUTE on DBMS_PDB, the dictionary access these statements use, and the session privileges the procedure requires. An application-root procedure has its own requirements.
Confirm the database identity and the current container before running the check:
SHOW CON_NAME
SELECT db_unique_name FROM v$database;
For this check, the current container is CDB$ROOT in the intended destination CDB. The descriptor path /transfer/app_pdb.xml is on the database server. The server process must be able to read it. APP_PDB is the intended target PDB name. Confirm that name is available while preparing the target.
Use the matching completed post-unplug descriptor and file set from Part 1. Do not substitute a different database's descriptor or an earlier inconsistent file copy. Retain the original artifacts and record their identities and checksums.
Run the compatibility function
SET SERVEROUTPUT ON
BEGIN
IF DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/transfer/app_pdb.xml',
pdb_name => 'APP_PDB') THEN
DBMS_OUTPUT.PUT_LINE('Compatible');
ELSE
DBMS_OUTPUT.PUT_LINE('Review violations');
END IF;
END;
/
SET SERVEROUTPUT ON is a SQL*Plus command. It displays the messages written by DBMS_OUTPUT. The anonymous PL/SQL block calls the function and turns its Boolean result into a message.
| Input or result | Meaning |
|---|---|
pdb_descr_file |
Server path of the PDB description being assessed. The 19c multitenant guide also permits a .pdb archive for this parameter. The call above uses XML. |
pdb_name |
Intended target name. If omitted, Oracle uses the name in the descriptor. Use this same intended name when retrieving findings. |
TRUE |
The described PDB is compatible with the current CDB according to this check. The block prints Compatible. |
FALSE |
The described PDB is incompatible. The block prints Review violations. Inspect the detailed findings before attempting the plug. |
The two printed strings are written by the block. They are not the function's return value. The return is a PL/SQL Boolean, so the check uses a block rather than displaying the function as an ordinary SQL column.
An exception, an unreadable descriptor, or a failed call is a failed assessment, not a successful compatibility result. Preserve the error and investigate the path, access, descriptor validity, and environment before retrying.
The check reads the description and can record diagnostics in PDB_PLUG_IN_VIOLATIONS. It does not create the target PDB, copy the data files, open the application, or test its jobs. See DBMS_PDB.
Retrieve and interpret the findings
SELECT time, type, status, cause, message, action
FROM pdb_plug_in_violations
WHERE name = 'APP_PDB'
AND status <> 'RESOLVED'
ORDER BY time, line;
| Field | What it tells you |
|---|---|
TIME |
When the finding was discovered. Retain the check time, target identity, intended name, and descriptor identity so the report can be read in context. |
TYPE |
ERROR or WARNING. |
STATUS |
PENDING, RESOLVED, or IGNORE. This is the finding's status, not the PDB's open mode or catalog status. |
CAUSE |
The attribute being checked. |
MESSAGE |
Description of the violation. |
ACTION |
The corrective action described for the violation. Read its complete text. |
The filter removes RESOLVED rows. It can still return both PENDING and IGNORE. IGNORE is a recorded status, not a reason to dismiss an unexplained finding. For history and diagnosis, remove the status predicate and inspect the full report. Leave the dictionary rows as Oracle recorded them. Repeated checks and older findings need the check time, target identity, intended name, and descriptor identity. Sorting by time does not by itself show that a row came from the latest check.
When the source requires an option the target does not provide, the finding can be classified this way:
| TYPE | STATUS | CAUSE |
|---|---|---|
| ERROR | PENDING | Option mismatch |
Read the full MESSAGE and ACTION on the actual row. Cause text, messages, error numbers, and remedies depend on the release and the environment. Choose a suitable target, or arrange the option's supported configuration, including its prerequisites and eligibility. Follow the reported action. After the relevant condition changes, run the compatibility check again and retain the new result and the complete report. See PDB_PLUG_IN_VIOLATIONS.
Handle warnings and release-specific work
A true result still needs a review of the remaining warnings and the actions they prescribe. A patch mismatch may require the documented patch or SQL patch procedure. A release change needs a supported upgrade plan. Some remediation happens after plugging in, at the point that procedure requires. Judge each warning on its own. Do not ignore every warning, and do not require every warning to disappear before any target creation.
Use the exact source and target release, Release Update, component state, and report action to determine the sequence. Ordinary PDB-to-PDB movement does not call for noncdb_to_pdb.sql. That script belongs to the documented non-CDB conversion workflow.
For encrypted data, follow the procedure for the actual TDE keystore mode. Key and wallet handling is separate from the compatibility result. Keep access to the encryption and recovery resources, and keep secrets out of reusable scripts.
What remains before returning users
After the compatibility review, complete the planned file-location mapping, the target plug and open procedure, and any required patch or upgrade work. Validate the open or restricted state and the plug-in findings, a fresh service connection, application data, jobs and integrations, and target backup and recovery readiness. Record those outcomes before treating the move as complete.
Part 1's source ordering still applies. The SQL reference requires dropping an unplugged source before plugging it into the same CDB or into another CDB. Run that separate source-root KEEP DATAFILES step at the planned point before plugging in. Permanent files are retained, and the tempfile is deleted. Keep the post-unplug source copies and the recovery resources through target validation and the retention requirement. See CREATE PLUGGABLE DATABASE and ALTER PLUGGABLE DATABASE.
Recap
Run DBMS_PDB.CHECK_PLUG_COMPATIBILITY in the intended destination CDB$ROOT, using the matching post-unplug descriptor and the intended PDB name. TRUE means this check finds the described PDB compatible, and remaining warnings still need their prescribed actions. FALSE means read PDB_PLUG_IN_VIOLATIONS for that name and follow TYPE, STATUS, MESSAGE, and ACTION. The check does not create the PDB, move its files, or show that services, jobs, and recovery are ready.
No comments:
Post a Comment