Tuesday, 5 April 2011

ADMINISTRATION

The Administration chapter cover the following topics:

1-crosscheck
2-list
3-report
4-delete

1-crosscheck
Crosscheck check that cataloged backups exist on disk or tape;
 if they don't exist they are marked as expired;
 if they exist but are no longer required to satisfy the redundancy policy, it mark the backups as obsolete.

Obsolete and expired backups can be removed from disk and the catalog later with the delete obsolete/expired commands.

#!/usr/bin/tcsh
source ./set-environment
echo Executing Command : CROSSCHECK
echo
rman TARGET $dbauser/$dbapwd@$datadb CATALOG $rmanuser/$rmanpwd@$rmandb <<eof
CROSSCHECK BACKUP; # checks backup sets, proxy copies, and image copies
CROSSCHECK COPY OF DATABASE;
CROSSCHECK BACKUPSET;
CROSSCHECK ARCHIVELOG ALL;
eof
exit

2-list

List produces a report of existing backups, different kind of oracle files can be listed separately with the list command.

#!/usr/bin/tcsh
source ./set-environment
echo Executing Command : LIST
rman TARGET $dbauser/$dbapwd@$datadb CATALOG $rmanuser/$rmanpwd@$rmandb log=scrlog
<<eof
LIST ARCHIVELOG ALL;
LIST BACKUPSET;
LIST EXPIRED BACKUPSET;
LIST FAILURE;
LIST RECOVERABLE BACKUPSET;
eof
more scrlog
rm scrlog
exit

3-report

Report produces a concise list of existing backups, including the full path to the backup files.

#!/usr/bin/tcsh
source ./set-environment
echo Executing Command : REPORT
echo
rman TARGET $dbauser/$dbapwd@$datadb CATALOG $rmanuser/$rmanpwd@$rmandb log=scrlog <<eof
REPORT SCHEMA;
REPORT OBSOLETE;
REPORT NEED BACKUP;
REPORT UNRECOVERABLE;
REPORT SCHEMA AT TIME 'SYSDATE-1';
eof
more scrlog
rm scrlog
exit

4-delete

Delete remove obsolete backups from disk; obsolete backups are not required to satisfy the retention policy.
It does remove expired backups from the catalog also; expired backups exist on the catalog but were removed from disk.

#!/usr/bin/tcsh
source ./set-environment
echo Executing Command : DELETE
rman TARGET $dbauser/$dbapwd@$datadb CATALOG $rmanuser/$rmanpwd@$rmandb log=scrlog
<<eof
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUPSET;
eof
more scrlog
rm scrlog
exit

No comments:

Post a Comment