ORA-20021: database not set: Select From RC_BACKUP_FILES Table failed

Error Description
SQL> select distinct BS_TAG from rc_backup_files;
select distinct BS_TAG from rc_backup_files
*
ERROR at line 1:
ORA-20021: database not set
ORA-06512: at "RMAN.DBMS_RCVMAN", line 22314
ORA-06512: at "RMAN.RC_LBRECSETIMPL_T", line 58

Solution Description
RC_BACKUP_FILES table can be used to see the backup files information for all the backups. Before querying the RC_BACKUP_TABLE you have to set the DBID by calling DBMS_RCVMAN.SETDATABASE package.
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
341     356     DEVDB01  3252474133       PARENT  1          05-SEP-10
341     342     DEVDB01  3252474133       CURRENT 972274     27-SEP-11
396087  396226  DEVDB01  3262395812       PARENT  256993740  18-JAN-12
396087  396088  DEVDB01  3262395812       CURRENT 257131859  18-JAN-12
13041888 13042126 DEVDB01  3275757920       PARENT  204390627  09-DEC-11
13041888 13041889 DEVDB01  3275757920       CURRENT 11161007302822 18-JUN-12

SQL> CALL DBMS_RCVMAN.SETDATABASE(null,null,null,3262395812);

Call completed.

Now your query should work as usual. 
Try it out. J
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google