Physical Backups  «Prev 

Data Dictionary views useful for backup operations

V$RECOVER_FILE view

  1. V$DATAFILE: Contains a list of the names and status for all datafiles
  2. V$CONTROLFILE: Contains the names of all control files
  3. V$LOGFILE: Contains the names of all redo log files
  4. V$BACKUP: Contains information about which files are in backup mode
  5. V$ARCHIVE_LOG: Contains archived log information from control files
  6. V$ARCHIVE_DEST: Contains information about the current instance and archive log destinations
  7. V$LOG_HISTORY: Contains log file information from the control file
  8. V$DATABASE: Contains information about the current state of archiving
  9. DBA_DATA_FILES: Contains a list of all datafiles and their respective tablespaces

You can view data file numbers and data file names in the V$DATAFILE, V$DATAFILE_COPY, or V$DATAFILE_HEADER view. For example, to view data file numbers and data file names in your database, issue this SQL command:
RMAN> select file#, name from v$datafile;
You can also issue the RMAN report schema command to display data file names and numbers. Once you know the name or number for each file you want to back up, you can use the backup datafile command to perform the actual backup operation.

Does the missing data file physically exist?

Before you restore the data file from the RMAN backup, verify whether the missing data file physically exists at the OS level. Also confirm that the Oracle software owner has the appropriate read and write privileges on the missing data file and directory. We also recommend querying the data dictionary for more information. The V$DATAFILE_HEADER view derives its information from the data file headers and reports in the ERROR and RECOVER columns any potential problems.For example, a YES or null value in the RECOVER column indicates there is a problem:

Oracle RMAN Backup and Recovery
1) Verify whether the missing data file physically exists at the OS level

Also the V$RECOVER_FILE view displays the status of files needing media recovery. The V$RECOVER_FILE reads from the control file and displays information about files needing media recovery:
2) V$RECOVER_FILE view displays the status of files needing media recovery

Note I f you restore a control file from a backup, the V$RECOVER_FILE view will not contain accurate information.
Question: I want to display the maxsize for a tablespace data file.
Maxsize is the total of maxsize of datafiles in that particular tablespace which is the total of Megabytes allocated to the datafiles.
For example,
alter database datafile 'file1' size 10G autoextend on maxsize 32G;
alter database datafile 'file2' size 15G autoextend on maxsize 32G;

Normal tablespace scripts including the one on this site is having total of size of datafiles (that is 10g + 15g = 25g).
I am looking for script which will use maxbytes of datafiles (that is 32g + 32g = 64g).