RMAN-Managed the LIST and REPORT commands
Introduction
As a DBA, you
are responsible for obtaining backup
information using the LIST and REPORT
commands. Your job�s responsibilities
dictate that you should at least be informed
of the following basic fundamental subjects:
Performing the
LIST and REPORT commands
Creating a
RMAN script
Replacing a
RMAN script
Deleting a
RMAN script
Running a RMAN
script
Connecting to
the RMAN tool using the Recovery Catalog
database
Listing all of
the backup sets and the associated backup
pieces
Listing all of
the expired backup sets
Listing the
backup of the data files for a tablespace
Listing a
database incarnations registered in a
database
Displaying
objects that need a backup and a confirmed
retention policy
Listing all of
the backup sets and image copies that are
OBSOLETE
Listing all of
the schemas of the database that can be
deleted
Commands:
RMAN> CONNECT
CATALOG
RMAN> CONNECT
TARGET
RMAN> LIST
BACKUP;
RMAN> LIST
EXPIRED BACKUPSET;
RMAN> LIST
BACKUP
RMAN> LIST
INCARNATION OF DATABASE;
RMAN> REPORT
NEED BACKUP;
RMAN> REPORT
OBSOLETE;
RMAN> REPORT
SCHEMA;
RMAN> RUN
RMAN> REPLACE
SCRIPT
RMAN> DELETE
SCRIPT
RMAN> exit;
Hands-on
In this
exercise we will learn how to perform the
LIST and REPORT commands in the RMAN tool.
Also, we'll learn how to create, replace,
delete, and run a RMAN script.
First, let's connect to the SCHOOL database
as the SYSTEM/MANAGER user.
SQL> CONNECT
system/manager
Run the RMAN tool.
DOS> RMAN
Connect to the RMAN tool using the Recovery
Catalog database.
RMAN> CONNECT
CATALOG RMAN/password@dbs4RMAN
Connect to the target database.
RMAN> CONNECT
TARGET system/manager@yourhost
LIST command
List all of the backup sets and the
associated backup pieces.
RMAN> LIST BACKUP;
List all of the expired backup sets.
RMAN> LIST EXPIRED
BACKUPSET;
List the backup of the data files for the
TOOLS tablespace.
RMAN> LIST BACKUP
OF TABLESPACE tools;
List the database incarnations registered in
the database.
RMAN> LIST
INCARNATION OF DATABASE;
REPORT command
Display the objects that need a backup and
confirm the retention policy.
RMAN> REPORT NEED
BACKUP;
List all of the backup sets and image copies
that are OBSOLETE and can be deleted.
RMAN> REPORT
OBSOLETE;
List all of the schemas of the database that
can be deleted.
RMAN> REPORT
SCHEMA;
Create a
script
Create a RMAN script and name it
BACKUP_TOOLS, since it is backing up only
the TOOLS tablespace.
RMAN> CREATE
SCRIPT backup_tools
{
BACKUP TABLESPACE tools;
}
Execute a
script
Run
the BACKUP_TOOLS script.
RMAN> RUN
{EXECUTE SCRIPT backup_tools;}
Modify a
script
Change or replace the
BACKUP_TOOLS script to not only back up the
TOOLS tablespace, but also back up the
archive log files.
RMAN> REPLACE SCRIPT backup_tools
{
BACKUP TABLESPACE tools PLUS ARCHIVELOG;
}
Delete a script
Delete the
BACKUP_TOOLS script.
RMAN> DELETE SCRIPT
backup_tools;
Exit the RMAN.
RMAN> exit;
Questions:
Q: How do you
perform a LIST and REPORT commands in the
RMAN tool?
Q: How do you
write a RMAN script?
Q: How do you
replace a RMAN script?
Q: How do you
delete a RMAN script?
Q: How do you
run a RMAN script?
Q: How do you
get a list of the backup of the datafiles
for a tablespace?
Q: How do you
get a list of objects that need backup?
Q: How do you
get a list of objects with their confirmed
retention policy?
Q: How do you
get a list of a database incarnations?
Q: How do you
get a list of the backup sets that are
obsolete?
Q: How do you
get a list of the image copies that are
obsolete?
Q: How do you
get a list of the schemas that can be
deleted?
Q: What do the
following RMAN commands do?
RMAN> CONNECT
CATALOG RMAN/password@dbs4RMAN
RMAN> LIST BACKUP;
RMAN> LIST EXPIRED
BACKUPSET;
RMAN> LIST BACKUP
OF TABLESPACE tools;
RMAN> LIST
INCARNATION OF DATABASE;
RMAN> REPORT
NEED BACKUP;
RMAN> REPORT
OBSOLETE;
RMAN> REPORT
SCHEMA;
RMAN> CREATE
SCRIPT backup_tools
{
BACKUP TABLESPACE tools;
}
RMAN> RUN
{EXECUTE SCRIPT backup_tools;}
RMAN> REPLACE
SCRIPT backup_tools
{
BACKUP TABLESPACE tools PLUS ARCHIVELOG;
}
RMAN> DELETE
SCRIPT backup_tools; |