?
Solved

10g RMAN for Windows

Posted on 2009-02-24
5
Medium Priority
?
1,173 Views
Last Modified: 2013-12-18
I am getting ready to put our DB in archive log mode and would like to set up RMAN for Backups.
Can some one advise me how should I plan and what should I consider and if some one has step by step or sample Rman Script that I can use as a template would be great.
Thanks.
0
Comment
Question by:bonna
5 Comments
 
LVL 48

Accepted Solution

by:
schwertner earned 1000 total points
ID: 23724904
There are many sources,
but I use the Oracle documentation from OTN.
RMAN scripts 
--------------------------------- 
###TO BACKUP THE CONTROLFILE USING RMAN: 
run{ 
 allocate channel dev1 type disk format 'c:\backup\%U'; 
 backup current controlfile; 
 } 
 
###TO CHECK THE BACKUP OF CONTROLFILE USING RMAN: 
list backup of controlfile; 
 
###TO RECOVER USING BACKUP CONTROLFILE: (startup nomount) 
run { 
 allocate channel dev1 type disk; 
 restore controlfile; 
 alter database mount; 
 restore database; 
 recover database; 
 sql "ALTER DATABASE OPEN RESETLOGS"; 
 } 
 
 
###TO BACKUP ALL DATAFILES AND CONTROLFILE USING RMAN: 
run { 
 allocate channel dev1 type disk; 
 backup full tag = 'full backup' database include current controlfile  format = 'c:\backup\db_t%t_s%s_p%p'; 
 release channel dev1; 
 } 
 
###TO CHECK ALL BACKUP OF DATAFILES USING RMAN: 
list backupset; 
 
###TO RESTORE BECAUSE OF MISSING FILE (First MOUNT the database and run RMAN) 
run { 
 allocate channel dev1 type disk; 
 restore database; 
 recover database; 
 } 
 
###RESTORE UNTIL TIME 
The 'SET UNTIL TIME' must match with the variable NLS_DATE_FORMAT. 
Prior logging on RMAN set the NLS_DATE_FORMAT in the desired format. 
For example: 
If unix ===> export NLS_DATE_FORMAT='YYYY-MM-DD:HH24:MI:SS'; 
If on windows nt ===> set this vaiable in the registery. 
run { 
 set until time 'May 1 2000 08:00:00'; 
 allocate channel dev1 type disk; 
 shutdown abort; 
 startup nomount; 
 restore controlfile; 
 alter database mount; 
 restore database; 
 recover database; 
 sql 'alter database open resetlogs'; 
 }	 
 
 
###TO PURGE OBSOLETE BACKUPS:  
report obsolete redundancy 3 device type disk; #REPORTS ANY BACKUP WITH MORE THAN 3 COPIES 
report obsolete orphan; #USE THIS REPORT TO FILL IN THE XXXXX BELOW 
 
run { 
 allocate channel for maintenance type disk; 
 allocate channel for delete type disk; 
 change backuppiece 'C:\BACKUP\xxxx' delete; 
 release channel; 
 
run { 
 allocate channel for maintenance type disk; 
 allocate channel for delete type disk; 
 change datafilecopy 'C:\BACKUP\xxxx' delete; 
 release channel; 
 
###TO BACKUP ALL ARCHIVE LOGS  
run{ 
 allocate channel dev1 type disk format 'c:\backup\%U'; 
 backup archivelog all; 
 } 
 
###TO REMOVE ALL ARCHIVE LOG FILES AFTER BACKUP UPDATE TO THIS LINE 
 backup archivelog all delete input; 
 
###SKIP AN ARCHIVE LOG FILE THAT CAN NOT BE READ OR MANUALY DELETED UPDATE TO THIS LINE 
 backup archivelog skip inaccessible 
 
###TO REMOVE ONE ARCHIVE LOG THAT YOU MANUALY DELETED AND NOW GET AN RMAN-6089 <= 8.0 
allocate channel for delete type disk; or 'SBT_TAPE';  
change archivelog 'path/filename' delete; 
and/or 
 resync catalog; 
 
###TO REMOVE ONE ARCHIVE LOG THAT YOU MANUALY DELETED AND NOW GET AN RMAN-6089 <= 8.1 
allocate channel for maintenance type ....'   
change archivelog <name> uncatalog 
 
Note: 
The channels for delete and maintenance do not require the run command enclosed in {}. 
           

Open in new window

0
 
LVL 23

Assisted Solution

by:David
David earned 1000 total points
ID: 23724972
Hi bonna, I feel I'd be doing you a disservice to throw a couple of scripts or links your way.  Let me instead try to help you lay a foundation -- I assume you at least have access to Oracle Metalink and to the Oracle technology sites. .  RMAN is such a common (and problematic?) topic that EE has over a thousand hits on previously asked questions (http://www.experts-exchange.com/simpleSearch.jsp?q=rman&searchSubmit=1&cid=315&redirectURL=%2F&gSearch=0).   My personal approach, FWIW, was to buy the Hart & Freeman book from Oracle Press.  At 600+ pages, it stil doesn't cover everything.
In my opinion, you should consider details such as:

  • Can you use flashback and the recycle bin to manage your very short term needs, such as restoring a particular table
  • How frequently do you need to have full versus incremental backups
  • How frequently do you need to restore from a backup
  • Can you back up directly to disk, or do you have to write directly to media devices.  Also, what are your storage and performance limitations
  • Do you prefer to maintain a separate (database) catalog, or keep the catalog in the database being backed up
  • DO NOT impliment in production UNTIL AFTER you have documented AND tested recoveries under different conditions.
I'll be back after others have checked in.

0
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 23725246
In addition to great information provided by dvz and schwertner ... Please goto this site and bookmark it for reference use in future. I find this site very handy.

http://www.psoug.org/reference/rman.html

0
 
LVL 48

Expert Comment

by:schwertner
ID: 23725341
I also think that the clasic backup is the best choice for beginners.
RMAN is complex product as DVZ said and you have to learn and to train it first.
0
 
LVL 1

Author Comment

by:bonna
ID: 23727053
Hello dvz
Thanks so much for your advise. You are absolutely right that we cannot just pick up a script and put it in. This needs to be planned and tested before it goes in production.
Thanks to all of you for the suggestions.
Bonna.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

621 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