Oracle DBMS_RCVCAT
Version 12.1.0.1

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
Purpose RMAN repository catalog maintenance
AUTHID CURRENT_USER
Constants
Name Data Type Value
RCVCAT_LEVEL_ZERO NUMBER 0
RCVCAT_LEVEL_MIN NUMBER 1
RCVCAT_LEVEL_LOW NUMBER 5
RCVCAT_LEVEL_MID NUMBER 9
RCVCAT_LEVEL_HI NUMBER 12
RCVCAT_LEVEL_MAX NUMBER 15
RCVCAT_LEVEL_DEFAULT NUMBER RCVCAT_LEVEL_MID
Data Types TYPE fullResyncActions_t IS RECORD
(
active boolean,
valid boolean,
lastobjno number,
objtype number,
actTaken resyncActionTaken_t,
actCount resyncActionCounts_t
);

fullResyncAction fullResyncActions_t; -- :=
-- fullResyncActions_t(FALSE, FALSE, -1, NULL,
-- RESYNC_ACTION_TAKEN_NONE,
-- RESYNC_ACTION_COUNTS_ZERO);
Dependencies
AL DBMS_OUTPUT SCR
ALL_USERS DBMS_RCVMAN SCRL
BCB DBMS_STANDARD SITE_DFATT
BCF DF SITE_TFATT
BCR DUAL TEMPRES
BDF FB TF
BP GRSP TS
BRL NODE TSATT
BS NRSP USER_DB_LINKS
BSF OFFR USER_OBJECTS
CCB ORL USER_ROLE_PRIVS
CCF PLITBLM USER_TAB_COLUMNS
CDF RCVER VPC_DATABASES
CKP RLH VPC_USERS
CONF RMAN_SEQ XAL
DB ROUT XCF
DBINC RSR XDF
DBMS_CATOWNER RT  
Documented No
First Available 12.1.0
Security Model Owned by SYS with EXECUTE granted to PUBLIC
Source {$ORACLE_HOME}/rdbms/admin/recover.bsq
Subprograms
ADDDBIDTOIMPORT CHECKTABLESPACE GETPACKAGEVERSION
BEGINARCHIVEDLOGRESYNC CHECKTEMPFILE GETPOLLEDREC
BEGINBACKUPCORRUPTIONRESYNC CHECKTEMPFILEFORSTANDBY GETREASON
BEGINBACKUPDATFILERESYNC CHECKTHREAD GETRESYNCACTIONS
BEGINBACKUPPIECERESYNC CKPTNEEDED GETSCRIPT
BEGINBACKUPREDOLOGRESYNC CLEANUPTEMPRESOURCE GETSCRIPTNAMES
BEGINBACKUPSETRESYNC CLEARRESYNCACTIONS GETTHISSITEKEY
BEGINBACKUPSPFILERESYNC CLEARUNARCHIVEDLOGS GETVALUEFROMCONFIG
BEGINBLOCKCORRUPTIONRESYNC COMMITCHANGES GETXMLFILEATTR
BEGINCKPT CREATESCRIPT GET_BUCKET
BEGINCONFIGRESYNC CREATETEMPRESOURCE GET_OBJECT
BEGINCONFIGRESYNC2 CREATEXMLFILE GRANT_CATALOG
BEGINCOPYCORRUPTIONRESYNC CREATE_VIRTUAL_CATALOG GRANT_REGISTER
BEGINDATAFILECOPYRESYNC DEBOK IMPORTSCHEMA
BEGINDATAFILERESYNC DELETECONFIG ISCRESYNCACTIONS
BEGINDATAFILERESYNCFORSTANDBY DELETECONFIG3 ISAMSCHEMA
BEGINDELETEDOBJECTRESYNC DELETESCRIPT ISDUPLICATERECORD
BEGINGUARNANTEEDRPRESYNC DELETEXMLFILE ISROUTDUPLICATERECORD
BEGININCARNATIONRESYNC DELETE_BUCKET LASTFULLCKPT
BEGINLOGHISTORYRESYNC DELETE_OBJECT LISTSCRIPTNAMES
BEGINOFLINERANGERESYNC DODUPLICATEMINING LOCKDBIDTOIMPORT
BEGINONLINEREDOLOGRESYNC DOREPLICATIONRECONCILE LOCKFORCKPT
BEGINPLUGGABLEDBINCRESYNC DROP_VIRTUAL_CATALOG LOCKTEMPRESOURCE
BEGINPLUGGA BLEDBRESYNC DUMPPKGSTATE PUTLINE
BEGINPROXYRESYNC DUMPRESYNCACTIONS PUT_BUCKET
BEGINRESTOREPOINTRESYNC ENABLERESYNCACTIONS PUT_OBJECT
BEGINRMANOUTPUTRESYNC ENDARCHIVEDLOGRESYNC READBACKUPSECTIONS
BEGINRMANSTATUSRESYNC ENDBACKUPCORRUPTIONRESYNC READFIXEDSECTIONS
BEGINTABLESPACERESYNC ENDBACKUPDATAFILERESYNC READXMLFILE
BEGINTEMPFILERESYNC ENDBACKUPPIECERESYNC REGISTERDATABASE
BEGINTEMPFILERESYNCFORSTANDBY ENDBACKUPREDOLOGRESYNC RENAMESITE
BEGINTHREADRESYNC ENDBACKUPSETRESYNC RENORMALIZE
BSSTATUSRECALC ENDBACKUPSPFILERESYNC REPLACESCRIPT
CANCELCKPT ENDBLOCKCORRUPTIONRESYNC RESETCONFIG
CHANGEARCHIVEDLOG ENDCKPT RESETCONFIG2
CHANGEBACKJUPPIECE ENDCONFIGRESYNC RESETDATABASE
CHANGEBACKUPSET ENDCONFIGRESYNC2 RESYNCADDDBUNAME
CHANGECONTROLFILECOPY ENDCOPYCORRUPTIONRESNC REVOKE_ALL
CHANGEDATAFILECOPY ENDDATAFILECOPYRESYNC REVOKE_CATALOG
CHANGEPROXYCOPY ENDDATAFILERESYNC REVOKE_REGISTER
CHECKARCHIVEDLOG ENDDATAFILERESYNCFORSTANDBY RSDELETEBACKUPPIECE
CHECKBACKUPCORRUPTION ENDDLEETEDOBJECTRESYNC RSWRITEWATERMARKS
CHECKBACKUPDATAFILE ENDGUARANTEEDRPRESYNC SANITYCHECK
CHECBACKUPPIECE ENDINCARNATIONRESYNC SETARCHIVEFILESCOPEATTRIBUTES
CHECKBACKUPREDOLOG ENDLOGHISTORYRESYNC SETBACKUPFILESCOPEATTRIBUTES
CHECKBACKUPSET ENDOFFLINERANGERESYNC SETCLONENAME
CHECKBACKUPSPFILE ENDONLINEREDOLOGRESYNC SETCONFIG
CHECKBLOCKCORRUPTION ENDPLUGGABLEDBINCRESYNC SETCONFIG2
CHECKCOPYCORRUPTION ENDPLUGGABLEDBRESYNC SETCONFIG3
CHECKDATAFILE ENDPROXYRESYNC SETDATABASE
CHECKDATAFILECOPY ENDRESTOREPOINTRESYNC SETDATAFILESIZE
CHECKDATAFILEFORSTANDBY ENDRMANOUTPUTRESYNC SETDEBUGOFF
CHECKDELETEDOBJECT ENDRMANSTATUSRESYNC SETDEBUGON
CHECKGUARANTEEDRP ENDTABLESPACERESYNC SETKEEPOUTPUTFORSESSION
CHECKINCARNATION ENDTEMPFILERESYNC SETREASON
CHECKLOGHISTORY ENDTEM[PFILERESNCFORSTANDBY TEMPFILETORESYNC
CHECKOFLINERANGE ENDTHREADRESYNC THROTTLE_ME
CHECKONLINEREDOLOG GETAMTSTLEVEL UNREGISTERDATABASE
CHECKPLUGGABLEDB GETCATALOGVERSION UNREGISTERSITE
CHECKPLUGGABLEDBINC GETCLONENAME UPDATEOLDESTFLASHBACKSCN
CHECKPROXYARCHIVEDLOG GETCONFIG UPDATERMANSTATUSROW
CHECKPROXYDATAFILE GETDBID UPDATEXMLFILE
CHECKRESTOREPOINT GETDBINC WRITEBACKUPSECTIONS
CHECKRMANOUTPUT GETLINE WRITEFIXEDSECTIONS
CHECKRMANSTATUS GETLOGHISTORYLOWSCN  
 
BEGINCKPT
Begin Checkpoint dbms_rcvcat.beginCkpt(
ckp_scn       IN NUMBER,
ckp_cf_seq    IN NUMBER,
cf_version    IN DATE,
ckp_time      IN DATE,
ckp_type      IN VARCHAR2,
ckp_db_status IN VARCHAR2,
high_df_recid IN NUMBER,
cf_type       IN VARCHAR2);
TBD
 
CHECKBLOCKCORRUPTION
Undocumented dbms_rcvcat.checkBlockCorruption(
bcr_recid       IN NUMBER,
bcr_stamp       IN NUMBER,
file#           IN NUMBER,
create_scn      IN NUMBER,
create_time     IN DATE,
block#          IN NUMBER,
blocks          IN NUMBER,
corrupt_scn     IN NUMBER,
corruption_type IN VARCHAR2);
TBD
 
CHECKRMANOUTPUT
Undocumented dbms_rcvcat.checkRMANOutput(
recid             IN NUMBER,
stamp             IN NUNBER,
session_recid     IN NUMBER,
session_stamp     IN NUMBER,
rman_Status_recid IN NUMBER,
rman_status_stamp IN NUMBER,
output            IN VARCHAR2);
TBD
 
CHECKRMANSTATUS
Undocumented dbms_rcvcat.checkRMANStatus(
recid            IN NUMBER,
stamp            IN NUMBER,
parent_recid     IN NUMBER,
parent_stamp     IN NUMBER,
row_level        IN NUMBER,
row_type         IN VARCHAR2,
command_id       IN VARCHAR2,
operation        IN VARCHAR2,
status           IN VARCHAR2,
mbytes_processed IN NUMBER,
start_time       IN DATE,
end_time         IN DATE,
ibytes           IN NUMBER,
obytes           IN NUMBER,
optimized        IN VARCHAR2,
otype            IN VARCHAR2,
session_recid    IN NUMBER, 
session_stamp    IN NUMBER,
odevtype         IN VARCHAR2,
osb_allocated    IN VARCHAR2);
TBD
 
COMMITCHANGES
Execute a commit dbms_rcvcat.commitChanges;
exec dbms_rcvcat.commitChanges;
 
CREATEXMLFILE
Undocumented dbms_rcvcat.createXMLFile(
name        IN VARCHAR2,
name_tag    IN VARCHAR2,
xmldoc      IN CLOB,
doctype     IN VARCHAR2,
xml_comment IN VARCHAR2,
schema_ver  IN VARCHAR2);
TBD
 
CREATE_VIRTUAL_CATALOG
Create the virtual RMAN catalog dbms_rcvcat.create_virtual_catalog;
exec dbms_rcvcat.create_virtual_catalog;
 
DROP_VIRTUAL_CATALOG
Drop the virtual RMAN catalog dbms_rcvcat.drop_virtual_catalog;
exec dbms_rcvcat.drop_virtual_catalog;
 
GETAMTSTLEVEL
Undocumented dbms_rcvcat.getAMTSTLevel
SELECT dbms_rcvcat.getAMTSTLevel
FROM dual;
 
GETCATALOGVERSION
Returns the database version of the RMAN catalog dbms_rcvcat.getCatalogVersion RETURN VARCHAR2;
SELECT dbms_rcvcat.getCatalogVersion
FROM dual;

GETCATALOGVERSION
------------------
12.01.00.01
 
GETCLONENAME
Undocumented dbms_rcvcat.getCloneName(
file#            IN NUMBER,
creation_change# IN NUMBER,
plugin_change#   IN NUMBER)
RETURN VARCHAR2;
TBD
 
GETCONFIG
Undocumented dbms_rcvcat.getConfig(
conf# OUT NUMBER,
name  IN  OUT VARCHAR2,
value IN  OUT VARCHAR2,
first IN  BOOLEAN);
TBD
 
GETDBID
Returns the catalog database's DBID dbms_rcvcat.getDBID RETURN NUMBER;
exec dbms_rcvcat.setDatabase;

SELECT dbms_rcvcat.getDBID
FROM dual;
 
GETDBINC
  dbms_rcvcat.getDBInc RETURN NUMBER;
exec dbms_rcvcat.setDatabase;

SELECT dbms_rcvcat.getDBInc
FROM dual;
 
GETLINE
Returns a line following a getScript dbms_rcvcat.getLine RETURN VARCHAR2;
SELECT dbms_rcvcat.getLine
FROM dual;
 *
ERROR at line 1:
ORA-20403: getScript not done
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 9359
 
GETLOGHISTORYLOWSCN
Returns the lowest SCN from a catalog resync dbms_rcvcat.getLogHistoryLowSCN RETURN NUMBER;
SELECT dbms_rcvcat.getLogHistoryLowSCN
FROM dual;
 *
ERROR at line 1:
ORA-20031: Resync not started
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 1037
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 5201
 
GETPACKAGEVERSION
Returns the internal version numer of, most likely, the DBMS_RCVCAT package dbms_rcvcat.getPackageVersion RETURN VARCHAR2;
SELECT dbms_rcvcat.getPackageVersion
FROM dual;

GETPACKAGEVERSION
-------------------
08.00.04.00
 
GETSCRIPT
Undocumented
Overload 1
dbms_rcvcat.getScript(name IN VARCHAR2);
TBD
Overload 2 dbms_rcvcat.getScript(
name IN VARCHAR2,
glob IN NUMBER);
TBD
 
GETSCRIPTNAMES
Undocumented dbms_rcvcat.getScriptNames(
dbname OUT VARCHAR2,
scnm   OUT VARCHAR2,
sccom  OUT VARCHAR2);
exec dbms_rcvcat.listScriptNames(1, 1);

DECLARE
 a VARCHAR2(30);
 b VARCHAR2(30);
 c VARCHAR2(30);
BEGIN
  dbms_rcvcat.getScriptNames(a, b, c);
  dbms_output.put_line(a);
  dbms_output.put_line(b);
  dbms_output.put_line(c);
END;
/
*
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 10635
ORA-06512: at line 6
 
GETTHISSITEKEY
Undocumented dbms_rcvcat.getThisSiteKey(db_unique_name IN VARCHAR2) RETURN NUMBER;
SELECT name
FROM v$database;

SELECT dbms_rcvcat.GetThisSiteKey('ORABASE2')
FROM dual;
 
GET_OBJECT
Undocumented dbms_rcvcat.get_object(
bktname IN VARCHAR2,
objname IN VARCHAR2,
parms   IN VARCHAR2)
RETURN CLOB;
TBD
 
GRANT_CATALOG
Grant privileges on the virtual private catalog

Overload 1
dbms_rcvcat.grant_catalog(
userid  IN VARCHAR2,
db_name IN VARCHAR2);
exec dbms_rcvcat.grant_catalog('UWCLASS', 'ORABASE');

exec dbms_rcvcat.revoke_catalog('UWCLASS', 'ORABASE');
Overload 2 dbms_rcvcat.grant_catalog(
userid             IN VARCHAR2,
dbid               IN NUMBER,
reg_db_unique_name IN VARCHAR2);
TBD
 
GRANT_REGISTER
Undocumented dbms_rcvcat.grant_register(userid IN VARCHAR2);
exec dbms_rcvcat.grant_register('ZZYZX');
*
ERROR at line 1:
ORA-20022: user ZZYZX not found
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 12455
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 12505
ORA-06512: at line 1


exec dbms_rcvcat.grant_register('UWCLASS');

exec dbms_rcvcat.revoke_register('UWCLASS');
 
LASTFULLCKPT
Undocumented dbms_rcvcat.lastFullCkpt RETURN NUMBER;
BEGIN
  dbms_output.put_line(dbms_rcvcat.lastFullCkpt);
END;
/
 
LISTSCRIPTNAMES
Undocumented dbms_rcvcat.listScriptNames(
glob     IN NUMBER,
allnames IN NUMBER);
See GETSCRIPTNAMES Demo Above
 
LOCKDBIDTOIMPORT
Undocumented dbms_rcvcat.lockDBIdToImport(idb IN VARCHAR2);
TBD
 
LOCKFORCKPT
Undocumented dbms_rcvcat.lockForCkpt(orsinspect IN BOOLEAN);
exec dbms_rcvcat.lockForCkpt(TRUE);
*
ERROR at line 1:
ORA-20020: Database incarnation not set
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 2108
ORA-06512: at line 1
 
LOCKTEMPRESOURCE
Undocumented dbms_rcvcat.lockTempResource
name      IN VARCHAR2,
data_type IN VARCHAR2,
RETURN BOOLEAN;
TBD
 
PUTLINE
Undocumented dbms_rcvcat.putline(line IN VARCHAR2);
exec dbms_rcvcat.putline('This is a test');
*
ERROR at line 1:
ORA-20402: createScript or replaceScript not done
ORA-06512: at "RMANADMIN.DBMS_RCVCAT", line 9287
ORA-06512: at line 1
 
REGISTERDATABASE
The recovery catalog can store information about many target databases. A target database must be registered before any information about it can be recorded in the recovery catalog. dbms_rcvcat.registerDatabase(
db_id          IN NUMBER
db_name        IN VARCHAR2
reset_scn      IN NUMBER
reseet_time    IN DATE
db_unique_name IN VARCHAR2
con_id         IN NUMBER
guid           IN RAW);
TBD
 
RENAMESITE
Renames the metadata stored in recovery catalog for the given standby node dbms_rcvcat.renameSite(
from_db_unique_name IN VARCHAR2
to_db_unique_name   IN VARCHAR2);
exec dbms_rcvcat.renameSite('orabase' orabase2');
 
REVOKE_ALL
Undocumented
Overload 1
dbms_rcvcat.revoke_all(userid IN VARCHAR2);
exec dbms_rcvcat.revoke_all('UWCLASS');
 
REVOKE_CATALOG
Undocumented

Overload 1
dbms_rcvcat.revoke_catalog(
userid  IN VARCHAR2,
db_name IN VARCHAR2);
See GRANT_CATALOG Demo Above
Overload 2 dbms_rcvcat.revoke_catalog(
userid             IN VARCHAR2,
dbid               IN NUMBER,
reg_db_unique_name IN VARCHAR2);
TBD
 
REVOKE_REGISTER
Undocumented dbms_rcvcat.revoke_register(userid IN VARCHAR2);
See GRANT_REGISTER Demo Above
 
SANITYCHECK
Undocumented dbms_rcvcat.sanityCheck;
exec dbms_rcvcat.setDatabase;

exec dbms_rcvcat.sanityCheck;
 
SETDATABASE
Change set control file attributes of remote db_unique_name site

Overload 1
dbms_rcvcat.setDatabase(
db_name        IN VARCHAR2,
reset_scn      IN NUMBER,
reset_time     IN DATE,
db_id          IN NUMBER,
db_unique_name IN VARCHAR2,
dummy_instance IN BOOLEAN,
cf_type        IN NUMBER,
site_aware     IN BOOLEAN,
ors_instance   IN BOOLEAN);
DECLARE
 db_name    VARCHAR2(9);
 reset_scn  NUMBER;
 reset_time DATE;
 db_id      NUMBER;
 db_uniq    VARCHAR2(30);
 dummy_inst BOOLEAN := FALSE;
 ub4_cf     PLS_INTEGER := 1;   -- control file: 1= current, 4 = standby
 s_aware    BOOLEAN := TRUE;
BEGIN
  SELECT db.dbid, db.name, dbinc.resetlogs_change#, dbinc.resetlogs_time,
         DECODE(db.controlfile_type, 'CURRENT', 1, 4),
         UPPER(db.db_unique_name)
    INTO db_id, db_name, reset_scn, reset_time,
         ub4_cf, db_uniq
    FROM v$database db, v$database_incarnation dbinc
   WHERE dbinc.status = 'CURRENT';
/*
  dbms_rcvcat.setDatabase(db_name        => db_name,
                          reset_scn      => reset_scn,
                          reset_time     => reset_time,
                          db_id          => db_id,
                          db_unique_name => db_uniq,
                          dummy_instance => FALSE,
                          cf_type        => ub4_cf,
                          site_aware     => TRUE); */
END;
/
Overload 2 dbms_rcvcat.setDatabase(
db_name        IN VARCHAR2,
reset_scn      IN NUMBER,
reset_time     IN DATE,
db_id          IN NUMBER,
db_unique_name IN VARCHAR2);
TBD
Overload 3 dbms_rcvcat.setDatabase(dbinckey IN NUMBER);
exec dbms_rcvcat.setDatabase(2);
Overload 4 dbms_rcvcat.setDatabase;
exec dbms_rcvcat.setDatabase;
 
SETDEBUGOFF
Disable debug mode dbms_rcvcat.setDebugOff;
exec dbms_rcvcat.setDebugOff;
 
SETDEBUGON
Enable debug mode dbms_rcvcat.serDebugOn(dbglevel IN NUMBER DEFAULT RCVCAT_LEVEL_DEFAULT);
exec dbms_rcvcat.setDebugOn;
 
THROTTLE_ME
Undocumented dbms_rcvcat.throttle_me(
p_oam_job_id    IN  VARCHAR2,
p_channels_reqd IN  NUMBER,
p_request_time  IN  DATE,
o_wait          OUT BOOLEAN,
o_error_str     OUT VARCHAR2);
TBD
 
UNREGISTERDATABASE
Unregister a database from the RMAN catalog

Overload 1
dbms_rcvcat.unregisterDatabase(
db_key IN NUMBER DEFAULT NULL,
db_id  IN NUMBER);
TBD
Overload 2 dbms_rcvcat.unregisterDatabase(idb IN VARCHAR2)
TBD

Related Topics
Backup & Recovery
DBMS_BACKUP_RESTORE
DBMS_RCVMAN
Packages
RMAN
RMAN Demos

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-2014 Daniel A. Morgan All Rights Reserved