rman hot backup script

Hi members,
Here is my RMAN hotback up script getting ready to be tun daily on our windows 2003 server running oracle 10.2.0.3 . Actually, the same will be used by backup exec 12.5 agent. The idea is to back up the database and also backup the FRA to tape.  Can you please take a look? I will appreciate any suggestions or mistakes or changes to script and if the order needs any changes. Please let me know if you have a better script for this. Thanks in advance.
run {
host 'copy D:\oracle\product\10.2.0\db_1\database\spfiletest.ora E:\oracle\flash_recovery_area\TEST';
host 'copy D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora E:\oracle\flash_recovery_area\TEST';
host 'copy D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora E:\oracle\flash_recovery_area\TEST';
configure backup optimization on;
crosscheck backup of database;
crosscheck backup of controlfile;
crosscheck archivelog all;
delete noprompt obsolete;
delete force noprompt expired backup of database;
delete force noprompt expired backup of controlfile;
delete force noprompt expired archivelog all;
backup as compressed backupset database plus archivelog;
crosscheck backup of database;
backup flash recovery area;
}
exit

Open in new window

dbguy0Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mrjoltcolaCommented:
It looks good, except it does appear to be a lot of crosschecking for a backup script.

You have two "crosscheck backup of database" lines, only one should be needed, unless you are somehow deleting something from outside of RMAN.

Also make sure you have: "configure controlfile autobackup on;" in your RMAN config.

Other than that, it looks good.

Specifically:  backup as compressed backupset database plus archivelog;


Will correctly backup your DB plus flush your archivelog so you'll have a full backupset to recover from. This is often an oversight.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
garysadlerCommented:
I agree.

Do you have a retention policy configured?  That will dictate how the DELETE OBSOLETE statement behaves.  If you're not sure, just do

SHOW RETENTION POLICY;

to see what it's set to.  Also the BACKUP FLASH RECOVERY AREA seems redundant.  What are you aiming for with that step?
0
dbguy0Author Commented:
Hi there. Thanks for asking this question.
I have corrected BACKUP FLASH RECOVERY AREA  to BACKUP RECOVERY AREA  ;
The idea is to backup flash recovery area to tape soo after the backup finishes. Would that back up to the default tape media attached? Because in my show all;  command listing, no specific tape media has been specified. It is also not specified in the script . The back up exec agent will invoke this script, will it back it up the tape drive attached to the machine where the back up exec software runs? Thank you!
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

mrjoltcolaCommented:
It will backup to whatever default device you have set, otherwise you must allocate a channel for SBT device type.

RMAN> show all;

To see your default device type. The SBT device must be configured properly to work with your tape driver. See the RMAN setup guide for specific instructions, usually the tape vendor provides specific config string for RMAN.

0
dbguy0Author Commented:
Thanks members.
 It worked for some time well. It started giving this error and I tried a few ways but it didn't work..

I tried both
allocate channel for delete device type disk;
allocate channel for maintenance device type disk;  before running the script with no luck.


Here is my new script


run {
host 'copy D:\oracle\product\10.2.0\db_1\database\spfileDIATEST.ora E:\oracle\flash_recovery_area\DIATEST';
host 'copy D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora E:\oracle\flash_recovery_area\DIATEST';
host 'copy D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora E:\oracle\flash_recovery_area\DIATEST';
configure backup optimization on;
configure controlfile autobackup on;
crosscheck backup of database;
crosscheck backup of controlfile;
crosscheck archivelog all;
delete noprompt obsolete;
delete force noprompt expired backup of database;
delete force noprompt expired backup of controlfile;
delete force noprompt expired archivelog all;
backup as compressed backupset database plus archivelog;
allocate channel ch01 device type sbt;
backup recovery area;
release channel ch01;
}

show all;

RMAN> show all;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFDIATEST.ORA'; # default


0
dbguy0Author Commented:
Sorry.

This is the error I am receiving.

RMAN-06091 no channel allocated for maintenance (of an appropriate type)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.