General Information
Library Note
Morgan's Library Page Header
Purpose
Defines the interface to restore pre-plugin backups
AUTHID
DEFINER
Data Types
CREATE TYPE SYS.ORA$PREPLUGIN_BACKUP_MSG_T AS OBJECT(con_id NUMBER);
/
Dependencies
ALL_TAB_COLUMNS
DBMS_SCHEDULER
V$DATABASE
DBMS_AQ
DBMS_SQL
V$PDBS
DBMS_ASSERT
DBMS_SYS_ERROR
X$KCCPDB
DBMS_LOCK
ORA$PREPLUGIN_BACKUP_MSG_T
X$KRBPPBTBL
DBMS_PDB
Documented
No
First Available
12.2
Pragmas
PRAGMA SUPPLEMENTAL_LOG_DATE(default, NONE);
Security Model
Owned by SYS with EXECUTE granted to SYSBACKUP
Source
{ORACLE_HOME}/rdbms/admin/dbmspplb.sql
Subprograms
DROPX$RMANTABLES
Purges all X$ tables used by RMAN to restore and recover pre-plugin backup from ROOT
dbms_preplugin_backup.dropX$RmanTables(p_con_id IN NUMBER);
conn / as sysdba
SELECT con_id, name
FROM v$containers
ORDER BY 1;
CON_ID NAME
------- ---------
1 CDB$ROOT
2 PDB$SEED
3 FREEPDB1
exec dbms_preplugin_backup.dropX$RmanTables (3);
PL/SQL procedure successfully completed.
EXPORTX$RMANTABLES
Exports all X$ tables used by RMAN to restore and recover pre-plugin backup into PDB dictionary
1 - export only tables required for media recovery / 2 - export only backup meta-data tables
dbms_preplugin_backup.exportX$RmanTables(
p_pdb_name IN VARCHAR2 DEFAULT NULL,
p_type IN NUMBER DEFAULT NULL);
exec dbms_preplugin_backup.exportX$RmanTables ('FREEPDB1', 1);
PL/SQL procedure successfully completed.
EXPORTX$RMANTABLESASPDB
Export X$ Rman tables procedure that can be invoked using dbms_sql
1 - export only tables required for media recovery / 2 - export only backup meta-data tables
dbms_preplugin_backup.exportX$RmanTablesAsPdb(p_type IN NUMBER);
exec dbms_preplugin_backup.exportX$RmanTablesAsPdb (3);
PL/SQL procedure successfully completed.
IMPORTX$RMANTABLES
Imports all X$ tables used by RMAN to restore and recover pre-plugin backup from PDB dictionary to ROOT based on container name
dbms_preplugin_backup.importX$RmanTables(p_pdb_name IN VARCHAR2);
exec dbms_preplugin_backup.importX$RmanTables ('PDBTEST');
PL/SQL procedure successfully completed.
IMPORTX$RMANTABLESASJOB
Same as importX$RmanTables except that it is executed as async using DBMS_SCHEDULER
dbms_preplugin_backup.importX$RmanTablesAsJob(p_con_id IN NUMBER);
exec dbms_preplugin_backup.importX$RmanTablesAsJob (4);
PL/SQL procedure successfully completed.
The code at right can be found in $ORACLE_HOME/rdbms/admin/catpplb.sql
dbms_scheduler.create_program(
program_name => l_program_name,
program_type => 'STORED_PROCEDURE',
program_action => 'sys.dbms_preplugin_backup.importX$RmanTablesUsingConId ',
number_of_arguments => 1,
enabled => FALSE,
comments => 'Program to import preplugin backups');
dbms_scheduler.define_metadata_argument(
program_name => l_program_name,
metadata_attribute => 'event_message',
argument_position => 1,
argument_name => 'p_con_id');
dbms_scheduler.enable(name => l_program_name);
IMPORTX$TABLESUSINGCONID
Imports all X$ tables used by RMAN to restore and recover pre-plugin backup from PDB dictonary to ROOT based on container ID
dbms_preplugin_backup.importX$RmanTablesUsingConId(
p_msg IN sys.ora$preplugin_backup_msg_t);
DECLARE
conIdVal sys.ora$preplugin_backup_msg_t := 4;
BEGIN
dbms_preplugin_backup.importX$RmanTablesUsingConId (conIdVal);
END;
/
PL/SQL procedure successfully completed.
TRUNCATEX$RMANTABLES
Truncate KRBPPBTBL tables procedure that can be invoked using DBMS_SQL
A bug has been opened in bugDB
17 February, 2024.
dbms_preplugin_backup.truncateX$RmanTables;
exec dbms_preplugin_backup.truncateX$RmanTables ;
*
ORA-06511: Pluggable database does not exist. (the extra space is in the original msg)