Oracle DBMS_RA_POOL
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose Recovery Appliance (Recovery Appliance) Backup and Recovery support utility.
AUTHID DEFINER
Constants
Name Data Type Value
 AM_DEBUG Constants
AM_DEBUG_ON NUMBER 1
AM_DEBUG_LOW NUMBER 2
AM_DEBUG_MED NUMBER 3
AM_DEBUG_HIGH NUMBER 4
AM_DEBUG_OFF NUMBER 5
 Chunk Constants
CHUNK_NOT_SHARED NUMBER 1
CHUNK_OWNER NUMBER 2
CHUNK_DEPENDENT NUMBER 1
 KBRS Constants
KBRS_SAVE_INFO_POOL NUMBER 0
KBRS_SAVE_INFO_CFFILE NUMBER 1
KBRS_SAVE_INFO_SPFILE NUMBER 2
 KBRSOPER Constants
KBRSOPER_CLSPOST NUMBER 1
KBRSOPER_POST NUMBER 2
KBRSOPER_RELEASE NUMBER 3
KBRSOPER_COPY NUMBER 4
KBRSOPER_DEL NUMBER 5
KBRSOPER_NEWFILE NUMBER 6
KBRSOPER_NEXT NUMBER 7
KBRSOPER_DONE NUMBER 8
 KBRSPLBLD Constants
KBRSPLBLD_PIECE NUMBER 1
KBRSPLBLD_PURGE NUMBER 2
KBRSPLBLD_SMALLPURGE NUMBER 3
KBRSPLBLD_OPTPURGE NUMBER 4
KBRSPLBLD_ALLPURGE NUMBER 5
KBRSPLBLD_OPTIMIZE NUMBER 6
KBRSPLBLD_DUPPURGE NUMBER 7
BRSPLBLD_ORIGPIECE NUMBER 8
BRSPLBLD_FULLPIECE NUMBER 10
KBRSPLBLD_MOVPURGE NUMBER 11
KBRSPLBLD_BADMETA1 NUMBER 101
KBRSPLBLD_BADMETA2 NUMBER 102
KBRSPLBLD_CLEANUP NUMBER 103
KBRSPLBLD_INITPOP NUMBER 104
KBRSPLBLD_ADDPOP NUMBER 105
KBRSPLBLD_USERINS NUMBER 106
KBRSPLBLD_USERDEL NUMBER 107
KBRSPLBLD_REBUILD NUMBER 108
KBRSPLBLD_REPAIR NUMBER 109
 VDBF Constants
VBDF_COMPLETE NUMBER 1
VBDF_BUILDING NUMBER 2
VBDF_ABORT NUMBER 3
VBDF_FIN_NOBP NUMBER 4
VBDF_CLEANUP NUMBER 5
VBDF_REPOPULATE NUMBER 6
VBDF_OBSOLETE NUMBER 7
VBDF_REPAIR NUMBER 8
 Miscellaneous Constants
BIGNUM NUMBER 1E40
KSCNINV NUMBER 281474976710655
Data Types TYPE blklst IS TABLE OF blocks%ROWTYPE INDEX BY BINARY_INTEGER;
type nolst  IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
type nmlst  IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
type dtlst  IS TABLE OF date INDEX BY BINARY_INTEGER;

TYPE collapse_bin_t IS RECORD (
blkrank NUMBER,
blockno NUMBER,
scn     NUMBER,
chunkno NUMBER,
used    NUMBER,
coffset NUMBER,
endblk  NUMBER);

TYPE collapse_blocks_c IS REF CURSOR RETURN collapse_bin_t;

TYPE collapse_b_t IS RECORD (
blkrank N UMBER,    -- 1 for restore else blockno rank
blockno  NUMBER,    -- min
chunkno  NUMBER,
numblks  NUMBER,    -- count
coffset  NUMBER,    -- min
numbytes NUMBER);   -- sum(used)

TYPE collapse_blocks_t IS TABLE OF collapse_b_t;

TYPE gaplst IS TABLE OF collapse_bin_t INDEX BY BINARY_INTEGER;

s_gap gaplst;
s_cg BINARY_INTEGER;
s_dftotalblocks NUMBER;
s_sig_gapcorruption NUMBER;
s_fixup_unord rai_number_2t;
s_blocks_diag BOOLEAN := FALSE;
Dependencies
BCF DBMS_RCVCAT PLANS
BDF DBMS_RCVMAN PLAN_DETAILS
BDFDF DBMS_LOCK PROT
BLOCKS DBMS_RANDOM RAI_NUMBER_2T
BP DBMS_RA_INT RAI_STATISTICS
BRL DBMS_RA_MISC RAI_TWO_NUMBERS_TYPE
BS DBMS_RA_SCHEDULER SBT_CATALOG
BSF DBMS_RA_STORAGE SBT_LIB_DESC
CDF DBMS_SQL SBT_TASK
CHUNKS DBMS_SYSTEM SL
CONFIG DBMS_SYS_ERROR SRCP
COMMON DF TASK
DB KBRSI_ICD TASK_CHUNK_CACHE
DBINC ODB VBLST
DBINCLST PDBINC VDBF
DBMS_APPLICATION_INFO PENDING_PURGE_DF XDF
DBMS_BACKUP_RESTORE    
Documented No
First Available Not known
Security Model Owned by SYS with no privileges granted
Source {ORACLE_HOME}/rdbms/admin/recover.bsq
-- The SQL for this package was extracted from recover.bsq and executed independently
-- from a SQL*Plus prompt. Not having an Oracle Recovery Appliance handy some a small
-- amount of the source was commented out to obtain a successful compilation.


SQL> @c:\stage\dbms_ra_pool.sql

SP2-0808: Package created with compilation warnings

SQL> show err
Errors for PACKAGE DBMS_RA_POOL:

LINE/COL ERROR
-------- -----------------------------------------------------------------
1/1 PLW-05018: unit DBMS_RA_POOL omitted optional AUTHID clause;
default value DEFINER used
68/20 PLW-06026: package specification exposes global variable S_FIXUP_UNORD
69/18 PLW-06026: package specification exposes global variable S_BLOCKS_DIAG
86/27 PLW-07203: parameter 'P_LOC' may benefit from use of the NOCOPY compiler hint
190/29 PLW-07203: parameter 'P_OUTPUT' may benefit from use of the NOCOPY compiler hint
330/14 PLW-06026: package specification exposes global variable S_GAP
331/14 PLW-06026: package specification exposes global variable S_CG
333/23 PLW-06026: package specification exposes global variable S_DFTOTALBLOCKS
334/23 PLW-06026: package specification exposes global variable S_SIG_GAPCORRUPTION
Subprograms
 
ALLOC_PLAN
Undocumented dbms_ra_pool.alloc_plan(
p_dbkey IN NUMBER,
p_dfkey IN NUMBER,
p_vbkey IN NUMBER,
p_qtype IN NUMBER);
TBD
 
BAD_METADATA
Undocumented dbms_ra_pool.bad_metadata(
p_dbkey IN NUMBER,
p_dfkey IN NUMBER,
p_vbkey IN NUMBER,
p_type  IN NUMBER,
p_bpkey IN NUMBER);
TBD
 
BEGIN_DF
Undocumented dbms_ra_pool.begin_df(
p_vbkey     IN OUT NUMBER,
p_ckpid     IN OUT NUMBER,
p_dbkey     IN     NUMBER,
p_fno       IN     NUMBER,
p_blocks    IN     NUMBER,
p_incrscn   IN     NUMBER,
p_crescn    IN     NUMBER,
p_crestamp  IN     NUMBER,
p_rstscn    IN     NUMBER,
p_rststamp  IN     NUMBER,
p_pluscn    IN     NUMBER,
p_prlscn    IN     NUMBER,
p_prltstamp IN     NUMBER,
p_dfkey        OUT NUMBER,
p_dbinckey     OUT NUMBER,
p_unorderid    OUT NUMBER,
p_prvmaxscn    OUT NUMBER,
p_firstblk  IN     NUMBER,
p_lastblk   IN     NUMBER);
TBD
 
BUILD_READ_PLAN
Undocumented dbms_ra_pool.build_read_plan(
p_dbkey   IN  NUMBER,
p_vbkey   IN  NUMBER,
p_dfkey   IN  NUMBER,
p_bufsize IN  NUMBER,
p_type    IN  NUMBER,
p_chunks  IN  NUMBER,
p_stored  OUT NUMBER);
TBD
 
CHECK_PDBINC
Undocumented dbms_ra_pool.check_pdbinc(
p_dbkey     IN NUMBER,
p_dfkey     IN NUMBER,
p_incscn    IN NUMBER,
p_begrstscn IN NUMBER,
p_endrstscn IN NUMBER);
TBD
 
COLLAPSE
Undocumented dbms_ra_pool.collapse(
p_dfkey    IN NUMBER,
p_vbkey    IN NUMBER,
p_firstblk IN NUMBER,
p_lastblk  IN NUMBER,
i_cur      IN sys.dbms_ra_pool.collapse_bin_t)
RETURN sys.dbms_ra_pool.collapse_blocks_t;
TBD
 
COPIED_TO_TAPE
Undocumented dbms_ra_pool.copied_to_tape(p_dbkey IN NUMBER) RETURN NUMBER;
-- demo code from recover.bsq
l_ontape := dbms_ra_pool.copied_to_tape(p_task_rec.db_key);
 
DEALLOC_PLAN
Undocumented dbms_ra_pool.dealloc_plan(
p_dfkey IN NUMBER,
p_vbkey IN NUMBER,
p_qtype IN NUMBER,
p_lock  IN BOOLEAN);
-- demo code from recover.bsq
dbms_ra_pool.dealloc_plan(i.df_key, i.vb_key, i.qtype);
 
DEALLOC_PLAN_BP
Undocumented dbms_ra_pool.dealloc_plan_bp(p_bskey IN NUMBER);
-- demo code from recover.bsq
dbms_ra_pool.dealloc_plan_bp(bskey);
 
DELETEVB
Undocumented dbms_ra_pool.deleteVB(
p_slkey   IN NUMBER,
p_dbkey   IN NUMBER,
p_currinc IN NUMBER,
bpkey     IN NUMBER,
p_noplans IN BOOLEAN,
p_notasks IN BOOLEAN);
-- demo code from recover.bsq
IF p_noplans AND p_notasks THEN
  trace1('FREE_BACKUP_PIECE_OPT: Skipping deleteVB');
ELSE
  dbms_ra_pool.deleteVB(p_slkey   => p_db_slkey,
                        p_dbkey   => p_db_key,
                        p_currinc => p_currinc,
                        p_bpkey   => l_bpkey,
                        p_noplans => p_noplans,
                        p_notasks => p_notasks);
END IF;
 
END_DF
Undocumented dbms_ra_pool.end_df(
p_vbkey        IN NUMBER,
p_dfkey        IN NUMBER,
p_relfno       IN NUMBER,
p_ckpscn       IN NUMBER,
p_absscn       IN NUMBER,
p_repair       IN BOOLEAN,
p_cmpvsn       IN NUMBER,
p_issft        IN NUMBER,
p_unorder      IN NUMBER
p_newblk_bytes IN NUMBER,
p_dupblk_bytes IN NUMBER,
p_match        IN RAW,
p_replev       IN NUMBER);
TBD
 
FIXUP_TAB
Undocumented dbms_ra_pool.fixup_tab RETURN sys.rai_number_2t;
TBD
 
GET_DF_PDBINC
Undocumented dbms_ra_pool.get_df_pdbinc(
p_dbinckey IN NUMBER,
p_dfkey    IN NUMBER,
p_scn      IN NUMBER)
RETURN NUMBER;
-- demo code from recover.bsq
BEGIN
  trc('partition_lock_bp: bpkey ' || p_bpkey);
  FOR i IN (SELECT DISTINCT df_key, ORA_HASH(df_key, 1023, 0) + 1 hash
            FROM bp JOIN bdfdf USING(bs_key)
            WHERE bp_key = p_bpkey
            AND pdbinc_key = dbms_ra_pool.get_df_pdbinc(dbinc_key, df_key, ckp_scn)
            ORDER BY df_key) LOOP
    dbms_ra_scheduler.get_lock(dbms_ra_scheduler.LOCK_PURGE, i.hash, p_lock_mode);
  END LOOP;
END partition_lock_bp;

SELECT MIN(task_id)
INTO   s_pending_interrupt
FROM   task JOIN bp ON(param_num2 = bp_key)
JOIN   bdfdf bf USING(bs_key)
WHERE  task_type = TASK_RESTORE
AND    bf.pdbinc_key = dbms_ra_pool.get_df_pdbinc(bf.dbinc_key, bf.df_key, bf.ckp_scn)
AND    state IN (STATE_RUNNING, STATE_EXECUTABLE, STATE_TASK_WAIT)
AND    ora_hash(bf.df_key, 1023, 0) + 1 = l_partition_pos;
 
INCRLEVEL
Undocumented dbms_ra_pool.incrLevel(
p_create_scn IN NUMBER,
p_incr_scn   IN NUMBER)
RETURN NUMBER;
-- demo code from recover.bsq
SELECT MAX(dbms_ra_pool.incrLevel(d.create_scn, d.incr_scn)) + COUNT(*)
INTO l_count
FROM bdf d
WHERE bs_key = p_bs_key;
 
MOVEDF
Undocumented dbms_ra_pool.moveDF(
p_dbkey IN NUMBER,
p_dfkey IN NUMBER);
-- demo code from recover.bsq
PROCEDURE execute_move_df (p_task_rec IN task%ROWTYPE) IS
 l_sl_key     NUMBER;
 l_old_sl_key NUMBER;
 l_chunks     NUMBER;
BEGIN
  tracex('EXECUTE_MOVE_DF on database ' || p_task_rec.db_key || '; df_key= ' || p_task_rec.param_num1);
  s_no_wait_on_allocate := TRUE;
  dbms_ra_pool.moveDF(p_task_rec.db_key, p_task_rec.param_num1);
END execute_move_df;
 
OBSOLETEPLANS
Undocumented dbms_ra_pool.obsoletePlans(
p_dfkey     IN NUMBER,
p_chk_krbph IN NUMBER,
p_lock      IN NUMBER);
TBD
 
OK4POOL
Undocumented dbms_ra_pool.ok4pool(
p_dbkey    IN  NUMBER,
p_bpkey    IN  NUMBER,
p_update   IN  BOOLEAN,
p_hasdups  OUT BOOLEAN,
p_nofityet OUT BOOLEAN,
p_isok     OUT BOOLEAN);
-- demo code from recover.bsq
dbms_ra_pool.ok4pool(l_dbkey, l_bpkey, (l_update > 0), l_hasdups, l_nofit, l_isok);
 
OPTIMIZEDF
Undocumented dbms_ra_pool.optimizeDF(
p_dbkey IN NUMBER,
p_dfkey IN NUMBER);
-- demo code from recover.bsq
dbms_ra_pool.optimizeDF(p_task_rec.db_key, p_task_rec.param_num1);
 
ORPHANS
Undocumented dbms_ra_pool.orphans(
p_dbkey   IN NUMBER,
p_dfkey   IN NUMBER,
p_currinc IN NUMBER)
RETURN BOOLEAN;
TBD
 
PDB_ORPHANS
Undocumented dbms_ra_pool.pdb_orphans(
p_dbkey   IN NUMBER,
p_dfkey   IN NUMBER,
p_currinc IN NUMBER,
p_ckpid   IN NUMBER,
p_pdbkey  IN NUMBER)
RETURN BOOLEAN;
TBD
 
PLANDF
Undocumented dbms_ra_pool.planDF(
p_type   IN NUMBER,
p_dfkey  IN NUMBER,
p_vbkey  IN NUMBER,
p_res    IN NUMBER,
p_locked IN BOOLEAN,
p_must   IN BOOLEAN,
p_plock  IN BOOLEAN);
-- demo code from recover.bsq
BEGIN
  dbms_ra_pool.planDF(l_ptype, l_dfkey, l_vbkeys(i));
EXCEPTION
  WHEN OTHERS THEN
    save_error;
    dbms_ra_misc.unlock(dbms_ra_misc.KEY_BP, l_bpkey);
    RAISE;
END;
 
PLANNEDDBSPACE
Undocumented dbms_ra_pool.plannedDBSpace(p_db_key IN NUMBER) RETURN NUMBER;
-- demo code from recover.bsq
l_planned_db_space := dbms_ra_pool.plannedDBSpace(p.db_key);
 
PREP_PIECE_READ
Undocumented dbms_ra_pool.prep_piece_read(
p_inbpkey     IN  NUMBER,
p_loc         OUT VARCHAR2,
p_dbkey       OUT NUMBER,
p_db_id       OUT NUMBER,
p_dfkey       OUT NUMBER,
p_vbkey       OUT NUMBER,
p_blksize     OUT NUMBER,
p_original    OUT NUMBER,
p_read_bufs   OUT NUMBER,
p_read_size   OUT NUMBER,
p_read_waste  OUT NUMBER,
p_rslvr_flags OUT NUMBER,
p_cmpvsn      OUT NUMBER,
p_firstsec    OUT NUMBER,
p_secsz       OUT NUMBER,
p_seccnt      OUT NUMBER);
TBD
 
PREP_READ
Undocumented dbms_ra_pool.prep_read(
p_type        IN  NUMBER,
p_bskey       IN  NUMBER,
p_vbkey       IN  NUMBER,
p_dfkey       IN  NUMBER,
p_blksize     OUT NUMBER,
p_read_bufs   OUT NUMBER,
p_read_size   OUT NUMBER,
p_read_waste  OUT NUMBER,
p_rslvr_flags OUT NUMBER,
p_cmpvsn      OUT NUMBER);
TBD
 
PROCESS_BACKUP_PIECE
Undocumented dbms_ra_pool.process_backup_piece(
p_dbkey    IN  NUMBER,
p_bpkey    IN  NUMBER,
p_upd      IN  NUMBER,
p_complete OUT BOOLEAN);
-- demo code from recover.bsq
dbms_ra_pool.process_backup_piece(p_task_rec.db_key, p_task_rec.param_num1, NVL(p_task_rec.param_num2, 0), l_processed);
 
PURGEDB
Undocumented dbms_ra_pool.purgeDB(
p_slkey   IN NUMBER,
p_dbkey   IN NUMBER,
p_purpose IN NUMBER,
p_inline  IN BOOLEAN);
-- demo code from recover.bsq
dbms_ra_scheduler.s_purging_active := TRUE;
dbms_ra_pool.purgeDB(l_sl_key, p_db_key, p_purpose, p_inline);
dbms_ra_scheduler.s_purging_active := FALSE;
trace1('PURGE_DATABASE: ... Done Purging');
 
PURGEDF
Undocumented dbms_ra_pool.purgeDF(
p_type  IN NUMBER,
p_dfkey IN NUMBER,
p_vbkey IN NUMBER,
p_dbkey IN NUMBER);
-- demo code from recover.bsq
dbms_ra_pool.purgeDF(p_task_rec.param_num3, -- Type of purge
p_task_rec.param_num1, -- df_key
p_task_rec.param_num2, -- vb_key
p_task_rec.db_key);    -- db_key
 
PURGE_COLLAPSE
Undocumented dbms_ra_pool.purge_collapse(i_cur IN sys.dbms_ra_pool.collapse_bin_t)
RETURN sys.dbms_ra_pool.collapse_blocks_t;
TBD
 
REPAIRCHUNKS
Undocumented dbms_ra_pool.repairChunks(
p_dbkey IN NUMBER,
p_dfkey IN NUMBER);
-- demo code from recover.bsq
IF l_savepoint <> -77 THEN
  dbms_ra_pool.repairChunks(p_task_rec.db_key, p_task_rec.param_num1);
  check_for_interrupt(-77);
END IF;
 
REPAIR_DF
Undocumented dbms_ra_pool.repair_df(
p_vbkey     IN OUT NUMBER,
p_newvb     IN OUT NUMBER,
p_dbkey     IN     NUMBER,
p_fno       IN     NUMBER,
p_blocks    IN     NUMBER,
p_relfno    IN     NUMBER,
p_crescn    IN     NUMBER,
p_crestamp  IN     NUMBER,
p_rstscn    IN     NUMBER,
p_rststamp  IN     NUMBER,
p_startscn  IN     NUMBER,
p_ckpscn    IN     NUMBER,
p_pluscn    IN     NUMBER,
p_prlscn    IN     NUMBER,
p_prltstamp IN     NUMBER,
p_cmpvsn    IN     NUMBER,
p_issft     IN     NUMBER,
p_firstblk  IN     NUMBER,
p_lastblk   IN     NUMBER,
p_replev    IN     NUMBER,
o_dfkey        OUT NUMBER,
o_ckpid        OUT NUMBER);
TBD
 
SAVE_KRBPH
Undocumented dbms_ra_pool.save_krbph(
p_dfkey     IN NUMBER,
p_chunkno   IN NUMBER,
p_name      IN VARCHAR2,
p_splittype IN NUMBER);
TBD
 
SETDEBUG
Undocumented dbms_ra_pool.setDebug(
p_level    IN NUMBER,
p_safemode IN NUMBER,
p_outtype  IN NUMBER);
TBD
 
SHOW_PLAN
Undocumented dbms_ra_pool.show_plan(
p_vbkey       IN NUMBER,
p_dfkey       IN NUMBER,
p_krbph_dfkey IN NUMBER,
p_qtype       IN NUMBER);
TBD
 
SMART_RELEASE_ORDWAIT
Undocumented dbms_ra_pool.smart_release_ordwait(
p_dbkey IN NUMBER,
p_error IN BOOLEAN,
p_force IN BOOLEAN);
-- demo code from recover.bsq
dbms_ra_pool.smart_release_ordwait(p_task_rec.db_key, FALSE);
 
TRIM_PLAN
Undocumented dbms_ra_pool.trim_plan(p_dfkey IN NUMBER);
TBD
 
VALIDATEDB
Undocumented dbms_ra_pool.validateDB(p_dbkey IN NUMBER);
-- demo code from recover.bsq
dbms_ra_pool.validateDB(l_db_key);
 
VALIDATE_DF_KEY
Undocumented dbms_ra_pool.validate_df_key(
p_dbkey   IN  NUMBER,
p_dfkey   IN  NUMBER,
p_sort    IN  NUMBER,
p_vbkey   IN  NUMBER,
p_allblks IN  BOOLEAN,
p_ext     IN  BOOLEAN,
p_output  OUT VARCHAR2);
-- demo code from recover.bsq
LOOP
  dbms_ra_pool.validate_df_key(p_dbkey, f.df_key, l_sort, p_vbkey,
  dbms_ra_pool.s_blocks_diag, p_deb_ext, l_output);
  IF l_output IS NOT NULL THEN
    dbms_output.put_line(l_output);
    trc(l_output);
  END IF;
END LOOP;

Related Topics
Built-in Functions
Built-in Packages
Database Security
DBMS_RA
DBMS_RA_DUMP
DBMS_RA_INT
DBMS_RA_MISC
DBMS_RA_SBT
DBMS_RA_SCHEDULER
DBMS_RA_STORAGE
KBRSI_ICD
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2021 Daniel A. Morgan All Rights Reserved
  DBSecWorx