Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1702
  • Last Modified:

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

0
dbguy0
Asked:
dbguy0
  • 3
  • 2
3 Solutions
 
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
 
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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now