The Oracle `LIST` command is still used to provide information about backup sets, file copies, and archived log files. It is a versatile command that can be used to display details about various aspects of Oracle database backups and archives. Here are some of the key things you can do with the `LIST` command:
List backup sets: The `LIST` command can be used to list all backup sets in the Oracle Recovery Catalog, including their creation date, size, and status. You can also filter the list by specifying the backup set type, such as full backup or incremental backup.
List file copies: The `LIST` command can be used to list all file copies in the Oracle Recovery Catalog, including their creation date, source file, and destination file. You can also filter the list by specifying the file copy type, such as RMAN file copy or user-managed file copy.
List archived log files: The `LIST` command can be used to list all archived log files in the Oracle Recovery Catalog, including their creation date, sequence number, and status. You can also filter the list by specifying the archived log file type, such as online redo log file or standby redo log file.
In addition to these basic functions, the `LIST` command also offers a variety of options for controlling the output format and sorting the results. This makes it a powerful tool for managing and monitoring Oracle database backups and archives. Here is an example of how to use the `LIST` command to list all full backup sets in the Oracle Recovery Catalog:
LIST FULL BACKUP SET;
This will display a list of all full backup sets, including their creation date, size, and status. For example, the output might look like this:
NAME CREATION SIZE STATUS
---------------------- ----------- -------- --------
FULL BACKUP SET 1 2023-11-25 100MB COMPLETED
FULL BACKUP SET 2 2023-11-24 90MB COMPLETED
FULL BACKUP SET 3 2023-11-23 80MB COMPLETED
As you can see, the `LIST` command is a valuable tool for managing and monitoring Oracle database backups and archives.
Provides Information about Backup Sets
In this lesson, you will learn how to use the list command. The list command provides information about your
backup sets,
file copies, and
archived log files.
Keep in mind that the report command provides a deeper analysis of the recovery catalog than the list command.
Syntax and Examples for the list Command
Below are the more frequent uses of the list command. To obtain a detailed listing, please refer to the Oracle8 documentation.
When you use the list command, you must connect to both the target database and the recovery catalog. Following the previous examples, this would be:
The
`rman80` target system/manager@mydb
is deprecated for Oracle 12c and later. The recommended target for Oracle 12c and later is rman.
This target is more secure and provides better performance. Here are some of the reasons why the `rman80` target is deprecated:
Security: The `rman80` target uses the `system/manager` account, which has SYSDBA privileges. This account is very powerful and can be used to make unauthorized changes to the database. The `rman` target uses a less privileged account, which is more secure.
Performance: The `rman` target uses a new recovery catalog API that is more efficient than the API used by the `rman80` target. This can improve the performance of RMAN backup and recovery operations.
If you are still using the `rman80` target, you should migrate to the `rman` target as soon as possible. To do this, you will need to create a new RMAN target and then migrate your existing backups and archives to the new target.
Steps to migrate to the `rman` target
Here are the steps on how to migrate to the `rman` target:
Create a new RMAN target using the following command:
CREATE TARGET rman TARGET_TYPE=RMAN;
Migrate your existing backups and archives to the new target using the following command:
RMAN> DUPLICATE TARGET from rman80 TO rman;
Once you have migrated your backups and archives, you can drop the `rman80` target:
DROP TARGET rman80;
Once the `rman80` target is dropped, you should start using the `rman` target for all of your RMAN backup and recovery operations.
Backup Sets and Data File Copies
The following syntax can be used to list information on backup sets and copies of data files for your database or a specific tablespace.
It can also be used to list backup sets and copies containing a specific range of archived log files. Below is a review of the basic syntax of the list command.
To list incarnation information about your database, use:
list incarnation of <values>
To list all the incarnations of your database, use:
list incarnation of database mydb
The following series of images below provides examples of the list command:
list Command in Oracle Database Backup and Recovery
The primary purpose of the LIST command is to list backup and copies. For example, you can list:
Backups and proxy copies of a database, tablespace, datafile, archived redo log, or control file
Backups that have expired
Backups restricted by time, path name, device type, tag, or recoverability
Archived redo log files and disk copies
The primary purpose of the LIST command is to list backup and copies. Besides backups and copies, the RMAN can list other types of data. The following table summarizes several useful objects that you can list.
RMAN> list copy of database;
RMAN> List copy of datafile;
RMAN> list incarnation of database;
The following section discusses the Oracle report command syntax.
You can run the following commands in Oracle 12c:
c days 10 database;
This command will display the number of days since the last successful incremental backup of the database.
report unrecoverable database;
This command will display information about any unrecoverable database objects.
report schema;
This command will display information about the Oracle schema, including tables, views, and procedures.
Here is a more detailed explanation of each command:
The `c days 10 database` command uses the `C` function to calculate the number of days since a specific event. In this case, the event is the last successful incremental backup of the database. The `10` specifies that the number of days should be rounded to the nearest whole number. The `database` keyword indicates that the command should be applied to the current database.
The `report unrecoverable database` command uses the `REPORT` function to generate a report on unrecoverable database objects. Unrecoverable database objects are objects that cannot be restored to a consistent state if the database is restored from a backup. The report will include information about the name, type, and location of each unrecoverable object.
The `report schema` command uses the `REPORT` function to generate a report on the Oracle schema. The schema is the collection of all objects that are defined in the database. The report will include information about the name, type, and owner of each object.
Reporting on RMAN Operations
The RMAN LIST and REPORT commands generate reports on backup activities based on the RMAN repository.
Use the SHOW ALL command to display the current RMAN configuration.
Listing Backups in Oracle
Run the LIST BACKUP and LIST COPY commands to display information about backups and datafile copies listed in the repository. For backups, you can control the format of LIST output with the options in the following tables.
LIST Options for Backups
Option
Example
Explanation
BY BACKUP
LIST BACKUP OF DATABASE BY BACKUP
Organizes the output by backup set. This is the default mode of presentation.
BY FILE
LIST BACKUP BY FILE
Lists the backups according to which file was backed up.
SUMMARY
LIST BACKUP SUMMARY
Displays summary output. By default, the output is VERBOSE.
To generate reports of database files and backups:
Start RMAN and connect to a target database.
Run the REPORT command at the RMAN prompt.
The following example reports backups that are obsolete according to the currently configured backup retention policy:
REPORT OBSOLETE;
The following example reports the datafiles and tempfiles in the database:
REPORT SCHEMA;
In the next lesson, you will learn about stored scripts.