RMAN scheduled database backup

All posts relating to Oracle database administration.

Moderator: Tim...

RMAN scheduled database backup

Postby Ninadgarude » Wed Oct 24, 2012 12:39 pm

I have a 11.2.0.1 database windows 2008 server. I have RMAN with nocatalog.

I need to take daily RMAN backup of database at 6 PM.

I want to schedule this RMAN backup to run automatically.

I want to run this backup when I am not logged on.

Can you guys please tell me how can I go about it ? task scheduler or something ... ?
Ninadgarude
Member
 
Posts: 22
Joined: Thu Aug 09, 2012 11:09 am

Re: RMAN scheduled database backup

Postby Tim... » Wed Oct 24, 2012 12:51 pm

Hi.

1) Write a script that you can run to perform your backup.
2) Schedule that script using the task scheduler in windows, or the Oracle scheduler.

http://www.oracle-base.com/articles/mis ... hp#windows
http://www.oracle-base.com/articles/10g ... er-10g.php

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: 17935
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: RMAN scheduled database backup

Postby Ninadgarude » Fri Oct 26, 2012 9:38 am

Hi,

Before scheduling RMAN jobs through dbms_scheduler, I tried to run an expdp job through dbms_scheduler.

My Test_expdp.bat file is as below:

Code: Select all
set ORACLE_SID=TESTS

set ORACLE_HOME=E:\Oracle\product\11.2.0\dbhome

expdp system/**** DUMPFILE=expdp_test_"%date:~7,2%%date:~4,2%%date:~10,4%".dmp LOGFILE=expdp_test_"%date:~7,2%%date:~4,2%%date:~10,4%".log Schemas=TEST1 JOB_NAME=expdp_test

--------------------------------------------------------------------------------------------------------------

And I am creating job as below:

Code: Select all
begin
DBMS_SCHEDULER.create_job (
job_name => 'test_expdp',
job_type => 'EXECUTABLE',
job_action => 'c:\windows\system32\cmd.exe /c C:/Users/Mark/Desktop/Mark/Test_expdp.bat',
start_date => to_date('10/26/2012 14:52:00','mm/dd/yyyy hh24:mi:ss'),
repeat_interval => 'FREQ=DAILY;BYHOUR=14;BYMINUTE=52;BYSECOND=00',
enabled => TRUE);
end;
/

But this never runs or gives errors like below:

ORA-27301: OS failure message: The pipe has been ended.
ORA-27302: failure occurred at: sjsec 9
ORA-27303: additional information: The pipe has been ended.

FAILED 1
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
STANDARD_ERROR="'expdp' is not recognized as an internal or external command,
operable program or batch file."

Please suggest.
Ninadgarude
Member
 
Posts: 22
Joined: Thu Aug 09, 2012 11:09 am

Re: RMAN scheduled database backup

Postby Tim... » Fri Oct 26, 2012 4:00 pm

Hi.

You either need to use an explicit path to the executable, or add it to the path.

Code: Select all
set PATH=%PATH%;%ORACLE_HOME%\bin


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: 17935
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: RMAN scheduled database backup

Postby Ninadgarude » Tue Oct 30, 2012 11:46 am

TIm you are awesome .. thanks it worked :)
Ninadgarude
Member
 
Posts: 22
Joined: Thu Aug 09, 2012 11:09 am

Re: RMAN scheduled database backup

Postby Tim... » Tue Oct 30, 2012 12:06 pm

:)
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: 17935
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 2 guests

cron