Home » RDBMS Server » Backup & Recovery » Automating RMAN backup jobs in Windows (3 Merged) (Oracle 10g on Windows Server)
Automating RMAN backup jobs in Windows (3 Merged) [message #558822] Tue, 26 June 2012 14:27 Go to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
Hello! I am just asking for someone to review my automated RMAN backup plan and let me know what you think. The four files will be run in this order. Thanks!

ShutdownDB1.bat
set oracle_sid = pldg
C:\oracle\product\10.2.0\bin\sqlplus.exe /nolog @c:\oraclebackup\shutdowndb2.sql


ShutdownDB2.sql (called by the previous batch file)
set echo on
spool C:\oraclebackup\ShutdownDB.log
connect /@pledgemaker as sysdba
shutdown immediate
spool off
exit


<Here there will be a thirty minute window or so while I XCOPY the Oracle Inventory and Oracle Home directories.>

RMANBackup1.bat
set oracle_sid=pldg
C:\oracle\product\10.2.0\BIN\rman.exe target / cmdfile = 'c:\oraclebackup\rmanbackup2.scr' \
log = 'c:\oraclebackup\RMANBackup.log'



RMANBackup2.scr (called by the previous batch file)
startup mount
backup database
alter database open
exit

[Updated on: Tue, 26 June 2012 23:19] by Moderator

Report message to a moderator

Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558825 is a reply to message #558822] Tue, 26 June 2012 14:35 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10629
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Pretty standard.
I usually would worry about the recovery process.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558826 is a reply to message #558825] Tue, 26 June 2012 14:40 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
True - the backup process is performed solely for the purpose of recovery if necessary. I'm new to Oracle administration so I just wanted some expert opinions on my scripts/commands. Everything looks OK?
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558827 is a reply to message #558826] Tue, 26 June 2012 14:46 Go to previous messageGo to next message
John Watson
Messages: 4709
Registered: January 2010
Location: Global Village
Senior Member
Why do you shutdown the database? You could do all that while the database is open, cold backups are barbaric. And you must also backup your archive logs.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558829 is a reply to message #558827] Tue, 26 June 2012 14:57 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
John Watson wrote on Tue, 26 June 2012 15:46
Why do you shutdown the database? You could do all that while the database is open, cold backups are barbaric. And you must also backup your archive logs.


1) I am a newbie DBA and I am trying to keep the process as simple as possible - at least for now. I've researched hot backups and have read that managing the archive logs can be a pain, so I decided to get a cold backup up and running first. Although I agree that hot backups are the way to go and I am interested in learning how to do them.
2) Per the people in charge, a nightly backup is enough for the organization and it doesn't hurt to take down the database each night as far as I know. There are no jobs or overnight processes that rely on the database being online at 2am.
3) We are moving away from this DBMS/application this year so I figured it'd suffice.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558830 is a reply to message #558827] Tue, 26 June 2012 14:57 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
John Watson wrote on Tue, 26 June 2012 15:46
Why do you shutdown the database? You could do all that while the database is open, cold backups are barbaric. And you must also backup your archive logs.


Also, you can't copy the Oracle Inventory and the Oracle Home directory while the database is open - can you?

[Updated on: Tue, 26 June 2012 14:58]

Report message to a moderator

Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558832 is a reply to message #558830] Tue, 26 June 2012 15:13 Go to previous messageGo to next message
BlackSwan
Messages: 22926
Registered: January 2009
Senior Member
>Also, you can't copy the Oracle Inventory and the Oracle Home directory while the database is open - can you?
The key, important files within these two directory trees, will only change after doing some Oracle upgrade.
They do NOT need to be backed weekly.
It is like giving chicken soup to a dead man. It won't hurt anything to do so.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558833 is a reply to message #558832] Tue, 26 June 2012 15:16 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
BlackSwan wrote on Tue, 26 June 2012 16:13
>Also, you can't copy the Oracle Inventory and the Oracle Home directory while the database is open - can you?
The key, important files within these two directory trees, will only change after doing some Oracle upgrade.
They do NOT need to be backed weekly.


Okay I see. That is what someone else told me also and it makes sense to me, but then I searched the entire Oracle Home directory for all files that were modified within the past few weeks or so and maybe fifty files came up. But there is a good chance that these are not the "key/important" files that you're talking about.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558834 is a reply to message #558833] Tue, 26 June 2012 15:36 Go to previous messageGo to next message
BlackSwan
Messages: 22926
Registered: January 2009
Senior Member
> and maybe fifty files came up
ORACLE_HOME may contain new files, files created after the initial installation; like log files, etc.
By definition these are not required files, or they would have existed as part of the original installation.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558836 is a reply to message #558829] Tue, 26 June 2012 16:10 Go to previous messageGo to next message
John Watson
Messages: 4709
Registered: January 2010
Location: Global Village
Senior Member
Quote:
3) We are moving away from this DBMS/application this year so I figured it'd suffice.
That depends on whether you are prepared to lose a whole day's work. I would fire any DBA who lost one row of data.
Your employer is using Oracle, and paying accordingly, because it is the most reliable database yet developed. But only if you manage it properly.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558837 is a reply to message #558836] Tue, 26 June 2012 16:26 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
John Watson wrote on Tue, 26 June 2012 17:10
Quote:
3) We are moving away from this DBMS/application this year so I figured it'd suffice.
That depends on whether you are prepared to lose a whole day's work. I would fire any DBA who lost one row of data.
Your employer is using Oracle, and paying accordingly, because it is the most reliable database yet developed. But only if you manage it properly.


I like your attitude - it's good that you're pushing me to do things properly and to be responsible.

I am very close to getting the nightly cold backup working. Once it's in place, I'll start working on hot backups.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558838 is a reply to message #558837] Tue, 26 June 2012 17:02 Go to previous messageGo to next message
BlackSwan
Messages: 22926
Registered: January 2009
Senior Member
>I am very close to getting the nightly cold backup working.
having working cold back is only one third of the challenge.
The real challenge is to be able to restore from the cold backup & obtain a working instance.
Unless & until you can actually successfully restore DB, any & all previous efforts have been wasted.
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558840 is a reply to message #558838] Tue, 26 June 2012 19:33 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
So after shutting down the database, I ran these two files.

RMANBackup1.bat
set oracle_sid=pldg
set echo off
C:\oracle\product\10.2.0\BIN\rman.exe target / cmdfile = 'c:\oraclebackup\rmanbackup2.scr' \
log = 'c:\oraclebackup\RMANBackup.log'


RMANBackup2.scr (called by the previous batch file)
startup mount;
backup database;
alter database open;
exit;


..but it didn't work as planned. Here are the results from the log file:
Recovery Manager: Release 10.2.0.5.0 - Production on Tue Jun 26 18:34:21 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database (not started)
RMAN> startup mount;
2> backup database;
3> alter database open;
4> exit;
Oracle instance started
database mounted


...so the startup mount; command ran just fine (and the instance started and the database mounted as you see at the bottom), but then the RMAN prompt went away starting on the backup database; line.

Any advice? Thanks!

[Updated on: Tue, 26 June 2012 23:20] by Moderator

Report message to a moderator

Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558841 is a reply to message #558840] Tue, 26 June 2012 19:40 Go to previous messageGo to next message
BlackSwan
Messages: 22926
Registered: January 2009
Senior Member
>connected to target database (not started)

You need to expand the COPY to include the actual command line invoking the rman utility.

bcm@bcm-laptop:~$ rman help

Argument     Value          Description
-----------------------------------------------------------------------------
target       quoted-string  connect-string for target database
catalog      quoted-string  connect-string for recovery catalog
nocatalog    none           if specified, then no recovery catalog
cmdfile      quoted-string  name of input command file
log          quoted-string  name of output message log file
trace        quoted-string  name of output debugging message log file
append       none           if specified, log is opened in append mode
debug        optional-args  activate debugging
msgno        none           show RMAN-nnnn prefix for all messages
send         quoted-string  send a command to the media manager
pipe         string         building block for pipe names
timeout      integer        number of seconds to wait for pipe input
checksyntax  none           check the command file for syntax errors
-----------------------------------------------------------------------------
Both single and double quotes (' or ") are accepted for a quoted-string.
Quotes are not required unless the string contains embedded white-space.

Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558843 is a reply to message #558841] Tue, 26 June 2012 19:50 Go to previous messageGo to next message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
BlackSwan wrote on Tue, 26 June 2012 20:40
>connected to target database (not started)

You need to expand the COPY to include the actual command line invoking the rman utility.


I don't understand. COPY?
Re: Automating RMAN backup jobs in Windows (3 Merged) [message #558848 is a reply to message #558843] Tue, 26 June 2012 21:24 Go to previous message
SpaceBolt
Messages: 12
Registered: October 2011
Junior Member
In the cmdfile (RMANBackup2.scr), I think I need to put the commands inside of a RUN block, like this:
RUN {
  backup database;
  alter database open;
}
EXIT;
Previous Topic: To retrieve the dropped tables
Next Topic: Backup
Goto Forum:
  


Current Time: Thu Oct 30 12:05:09 CDT 2014

Total time taken to generate the page: 0.09200 seconds