Home » RDBMS Server » Backup & Recovery » RMan from Windows Bat file w/o RCAT
RMan from Windows Bat file w/o RCAT [message #73894] Fri, 30 July 2004 10:13 Go to next message
Calvin Matsumoto
Messages: 3
Registered: July 2004
Junior Member
Hi......I'm running RMAN on AIX using a script that is executed through CRON.  I want to set up a similar process on Windows using a .bat file and scheduling through Windows AT.  This is on Oracle 9i and I would like to avoid using a recovery catalog which I assume prevents me from using the cmdfile as a solution.  Can this be done???  I did a simple .bat file and can make the RMAN connection but it stops there and doesn't execute the rest of the commands within the .bat file.  An example would be very helpful.  Thanks so much for any advice/suggestions.

Cal
Re: RMan from Windows Bat file w/o RCAT [message #73906 is a reply to message #73894] Mon, 02 August 2004 07:09 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Hi,

You can use the RMAN "cmdfile" option with, or without, using a Recovery Catalog. The "cmdfile" option just specifies the name of the input command file.

Your problem is probably syntax, but since you haven't posted your script, we cannot comment on it.

Best regards.

Frank
Re: RMan from Windows Bat file w/o RCAT [message #73907 is a reply to message #73906] Mon, 02 August 2004 10:11 Go to previous messageGo to next message
Calvin Matsumoto
Messages: 3
Registered: July 2004
Junior Member
Hi Frank....thank you for your reply.
In regards to your response of being able to use the cmdfile option w/o a recovery catalog:
I think that I have made some progress but now I can't seem to get the logging part to work. I searched Google and Metalink and found a variety of options. I found a few from Oracle: One stating that the msglog only works from a command line and not batch file. There was another one from Oracle stating that the syntax has changed and is now "log=/path/logfile.log".
I saw others about having to use double quotes and double "//", etc.....

Here is what I am trying (as a .bat file):
rman target='rman/Rmanpw@SID'
cmdfile "D:TestRman.sql" >>D:TestRman.log

I get the Rman.log but it's empty. If I use the "log=/path/logfile.log" I do not get any output file at all.

I will gladly try any other suggestions...thanks for the assistance.....Cal
Re: RMan from Windows Bat file w/o RCAT [message #73908 is a reply to message #73907] Mon, 02 August 2004 10:32 Go to previous messageGo to next message
Frank Naude
Messages: 4579
Registered: April 1998
Senior Member
Unfortunately I don't have a Windows system to test, but you can try the following:

rman target rman/Rmanpw@SID cmdfile D:TestRman.sql log D:TestRman.log


Note, there is no "=" between "target" and the connect string!

Best regards.

Frank
Re: RMan from Windows Bat file w/o RCAT [message #73909 is a reply to message #73908] Mon, 02 August 2004 12:35 Go to previous messageGo to next message
Calvin
Messages: 2
Registered: March 2003
Junior Member
Thanks Frank.....unfortunately that doesn't seem to work and I'm back to no longer getting any output file. I guess this is part of the frustrating side of working with Oracle. I would think that the syntax should be pretty well set, standard and well documented. A good example is the "target=" The Oracle Press Rman and Recovery has it with the "=" and I've been using it this way on Unix where I am running it from Cron. Thanks again for your help...

CM
Re: RMan from Windows Bat file w/o RCAT [message #74377 is a reply to message #73907] Wed, 01 December 2004 05:28 Go to previous messageGo to next message
evan p
Messages: 2
Registered: December 2004
Junior Member
Hi guys,

did you ever get to a solution for this ?

I'm trying to setup RMAN online and offline scripts, but my Windows batch scripting is near non-existant !

I have setup a *.bat file to schedule which contains the following:

rman target backup_admin/backup_admin@doratest msgno log='C:Documents and SettingsEFREEMANMy DocumentsOraclelogsonline_backup.log' append cmdfile='C:Documents and SettingsEFREEMANMy DocumentsOraclescriptsonline_backup.sql'

The cmdfile contains:

backup database plus archivelog delete input;

I've previously set the database to ARCHIVELOG and configured the RMAN parms. Everything works as advertised from the cmd line. This batch combo gives the following output:

C:Documents and SettingsEFREEMANMy DocumentsOraclescripts>online_backup.bat

C:Documents and SettingsEFREEMANMy DocumentsOraclescripts>rman target backup_admin/backup_admin@doratest msgno log=
'C:Documents and SettingsEFREEMANMy DocumentsOraclelogsonline_backup.log' append cmdfile='C:Documents and Setting
sEFREEMANMy DocumentsOraclescriptsonline_backup.sql'
RMAN> RMAN>
C:Documents and SettingsEFREEMANMy DocumentsOraclescripts>

Any help would be appreciated. I'm using 9.2 on XP for this.

regards

evan p
Re: RMan from Windows Bat file w/o RCAT [message #74379 is a reply to message #74377] Wed, 01 December 2004 08:06 Go to previous messageGo to next message
Calvin Matsumoto
Messages: 3
Registered: July 2004
Junior Member
Hello Evan,

I'm running RMAN (9i) on both AIX and Windows 2000. For Windows I am not using a tape interface but going directly to disk and letting Veritas pick up the file backups to tape. Here is an example of a .bat file that I set up and run through scheduled tasks:

rman target='rmanadmin/RmanPW@OrclInstance'cmdfile "d:RMANRmanScriptsRmanBkpL0.txt" log "d:RMANRmanRptsWeekendSundayL0.txt"

Note the double quotes. This example is for a Base Level 0 incremental which backs up the past 2 days of the archive logs (redundancy) and also deletes off any archive logs older than 7 days. Also using 2 channels and setting a file limitation of 2 gb's:

Run {allocate channel c1 device type disk
format 'f:RManMircaldwBkp1MIRCALDW_%U.bak' maxpiecesize=2000M;
allocate channel c2 device type disk
format 'h:RmanMircaldwBkp2MIRCALDW_%U.bak' maxpiecesize=2000M;
Backup incremental level = 0 database;
Backup archivelog from time 'sysdate - 2';
Delete Noprompt archivelog all completed before 'sysdate - 7';
Release Channel c1;
Release Channel c2;
}

Hope this helps......

Calvin Matsumoto
State of CA - HHSDC
Re: RMan from Windows Bat file w/o RCAT [message #74384 is a reply to message #74379] Thu, 02 December 2004 01:00 Go to previous messageGo to next message
evan p
Messages: 2
Registered: December 2004
Junior Member
Thanks for the speedy reply, Calvin !

I had tried quite a few variations with the quotes and without. I've gotten away with single quotes. The problem seemed to be with referencing directories that included a space ! I now use different directories and it works fine.

I also configured RMAN prior so I don't have to use 'run' blocks. Makes it all a bit easier if your settings will remain static. I do dual copies to different disk channels too.

ciao

evan p
Re: RMan from Windows Bat file w/o RCAT [message #74602 is a reply to message #74379] Mon, 17 January 2005 07:31 Go to previous message
Paola
Messages: 2
Registered: August 2002
Junior Member
could u please send me some example about how can i do the scripts for windows(rman)
Previous Topic: error in cloning using RMAN error while looking up datafile: 82
Next Topic: recovery in archive mode; no archived logs
Goto Forum:
  


Current Time: Fri Mar 29 00:43:37 CDT 2024