RMAN Backups by using a batch File

All posts relating to Oracle database administration.

Moderator: Tim...

RMAN Backups by using a batch File

Postby M.Shakeel Azeem » Sat Sep 30, 2006 6:11 am

i have created the batch for rman backup which have contens like
rman_backup.bat
rman target sys/gateway@wizmen catalog rman/rman@catdb script 'week_backup'
log c:\backup\rman_output.log

The script week_backup is working fine when i execute this from rman prompt
RMAN >run{execute script week_backup;}

When i run this batch file manually it did not work
it did not create any log file either,it also didn't generate any error
can u pinpoint that where i am having a problem?
M.Shakeel Azeem
Senior Member
 
Posts: 208
Joined: Fri Sep 08, 2006 9:35 am

Postby Tim... » Sun Oct 01, 2006 3:33 pm

There is no SCRIPT command line option in this version of RMAN:

http://download-west.oracle.com/docs/cd ... .htm#44793

This shows you how to run scripts:

http://download-west.oracle.com/docs/cd ... htm#438594

You need to use the "@filename" or "cmdfile filename" options to run scripts from the commandline. These script may then reference stored scripts.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17953
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Batch File Scheduling

Postby M.Shakeel Azeem » Tue Oct 03, 2006 10:14 am

is it possible to schedule the batch file to run by using dbms_job
if it is then can u plz guide me how to do it?
thanx in advance
M.Shakeel Azeem
Senior Member
 
Posts: 208
Joined: Fri Sep 08, 2006 9:35 am

Postby Tim... » Tue Oct 03, 2006 10:22 am

Hi.

This article shows you how to call OS shell commands fom PL/SQL using a Java stored procdure:

http://www.oracle-base.com/articles/8i/ ... mPLSQL.php

Implement this functionality, then test it by calling your batch file from PL/SQL. Once that is working you can use the DBMS_JOB scheduler to schedule the proceduer call.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17953
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Postby amansharma81 » Tue Oct 03, 2006 10:35 am

Hi Shakeel,
For your question, I googled a little and this has come up as like in top 5 responses.Hope it will be helpful for you to get started.Have a look:
[url]
http://forums.oracle.com/forums/thread. ... 26&#340726[/url]
[url]
http://asktom.oracle.com/pls/ask/f?p=49 ... 12348067,Y[/url]
Regards
Aman....
Last edited by amansharma81 on Tue Oct 03, 2006 10:40 am, edited 1 time in total.
Aman....
"As our circle of knowledge expands, so does the circumference of darkness surrounding it."--Einstein
"All men die, few men ever truly live" -- Braveheart
"You can get help from teachers, but you are going to have to learn a lot by yourself, sitting alone in a room." --Dr. Seuss
"Know me for what I do and for not what I am. Judge me for what I can do and not for what I have done."-Unknown
"Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend."- Albert Camus
"Never argue with an idiot. They drag you down to their level and then beat you with experience." - Unknown
amansharma81
Advisor
 
Posts: 391
Joined: Sat Jul 30, 2005 12:07 pm
Location: India

Postby Tim... » Tue Oct 03, 2006 10:40 am

Hi.

The first link uses the same Java approach I suggested.

The other method using the pipe is very old fashioned (Oracle 7 style), but quite interesting. I remember doing somethng similar a long time ago. We had a process written in Pro*C that read off a pipe and executed OS commands. :)

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17953
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

OOPS!!

Postby amansharma81 » Tue Oct 03, 2006 10:52 am

Hi Sir,
When I posted your post was not there.Than I had to edit my post for a spelling mistake.In the mean time, your post came along I guess.I just saw your post when I refreshed the page.So sorry for the confusion that I created.Power(Aman*Silly,Infinite)!
And I wont forget one more thing from now (that I didnt do today) and that is, look in Oracle-Base.com before searching anywhere else. :)
regards
Aman....
Aman....
"As our circle of knowledge expands, so does the circumference of darkness surrounding it."--Einstein
"All men die, few men ever truly live" -- Braveheart
"You can get help from teachers, but you are going to have to learn a lot by yourself, sitting alone in a room." --Dr. Seuss
"Know me for what I do and for not what I am. Judge me for what I can do and not for what I have done."-Unknown
"Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend."- Albert Camus
"Never argue with an idiot. They drag you down to their level and then beat you with experience." - Unknown
amansharma81
Advisor
 
Posts: 391
Joined: Sat Jul 30, 2005 12:07 pm
Location: India

Postby Tim... » Tue Oct 03, 2006 11:01 am

Hey no problem mate. He might prefer the solutions you posted over mine anyway. Provided they answer the questions, any posts are good :)

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17953
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Thanks alot sir!!

Postby amansharma81 » Tue Oct 03, 2006 11:06 am

Thanks alot for your encouraging support sir.You are the best !
With best regards,
Aman....
Aman....
"As our circle of knowledge expands, so does the circumference of darkness surrounding it."--Einstein
"All men die, few men ever truly live" -- Braveheart
"You can get help from teachers, but you are going to have to learn a lot by yourself, sitting alone in a room." --Dr. Seuss
"Know me for what I do and for not what I am. Judge me for what I can do and not for what I have done."-Unknown
"Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend."- Albert Camus
"Never argue with an idiot. They drag you down to their level and then beat you with experience." - Unknown
amansharma81
Advisor
 
Posts: 391
Joined: Sat Jul 30, 2005 12:07 pm
Location: India

Postby Tim... » Wed Oct 04, 2006 10:35 am

:)
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17953
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK


Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 1 guest