Solved

rman hot backup script

Posted on 2009-07-01
6
1,585 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
  • 3
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 450 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 450 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry.

This is the error I am receiving.

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Oracle SQL Query Syntax 6 84
Number Format 1 43
Oracle Finace 3 42
Calculating total percentage per row in Oracle Query 2 37
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to take different types of Oracle backups using RMAN.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now