Solved

rman hot backup script

Posted on 2009-07-01
6
1,605 Views
Last Modified: 2013-12-19
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
Comment
Question by:dbguy0
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 450 total points
ID: 24758587
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
 
LVL 3

Assisted Solution

by:garysadler
garysadler earned 50 total points
ID: 24758798
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
 

Author Comment

by:dbguy0
ID: 24759539
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 450 total points
ID: 24759608
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
 

Author Comment

by:dbguy0
ID: 24784753
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
 

Author Comment

by:dbguy0
ID: 24784895
Sorry.

This is the error I am receiving.

RMAN-06091 no channel allocated for maintenance (of an appropriate type)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question