Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Aug 2012
    Posts
    29

    Unanswered: RMAN scheduled database backup

    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 ... ?

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    First, you will need to create the rman script as a batch script (.bat) or powershell script. Once you can run that from the command line interactively, you can schedule it with the Windows Scheduled Tasks applet.

  3. #3
    Join Date
    Jun 2004
    Posts
    796
    Provided Answers: 1
    Are you using DBConsole or Grid Control? You can schedule RMAN backups through either of them.
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    in 11 you can use DBMS_SCHEDULE to run OS scripts to.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Aug 2012
    Posts
    29
    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:
    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:
    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.

  6. #6
    Join Date
    Jun 2004
    Posts
    796
    Provided Answers: 1
    What you're trying to do is export the database, which is not the same as using RMAN to back it up. Do you want to export it, or back it up? The two are VERY different things.
    90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.

  7. #7
    Join Date
    Aug 2012
    Posts
    29
    hey, i know that .... i was just trying to take export of a schema .. and its giving error thats it ...

    As mentioned in my post,

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

  8. #8
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Looks like expdb may not be in the PATH for the Oracle account. Schedule the following to make sure, though:
    Code:
    echo %PATH%
    Last edited by MCrowley; 10-26-12 at 10:29. Reason: fixed command

  9. #9
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    The path E:\Oracle\product\11.2.0\dbhome\bin

    should be added to your PATH environmental variable
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  10. #10
    Join Date
    Aug 2012
    Posts
    29
    you guys are awesome .. thanks it worked

  11. #11
    Join Date
    Aug 2012
    Posts
    29
    now I want to run rman full backup similar like above , I have set path and all but getting below error:

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

    Commands in batch file are as below:

    Code:
    set ORACLE_SID=TESTS
    
    set ORACLE_HOME=E:\Oracle\product\11.2.0\dbhome
    
    rman target / 
    run { 
    backup database;
    }
    I have also set the entire Path


    whats wrong ???

  12. #12
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    rman scripts need to be run with the rman executable. Before you get to scheduling one, you may want to put together a batch script that does the backup, and make sure you can run that from the commandline. After that, it should be easy to schedule this.

  13. #13
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    It sounds like first make it work; then make it fancy.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  14. #14
    Join Date
    Aug 2012
    Posts
    29
    Thank u guys ... I made it work and then I made it fancy !

  15. #15
    Join Date
    Sep 2014
    Posts
    1
    Quote Originally Posted by Ninadgarude View Post
    Thank u guys ... I made it work and then I made it fancy !
    Can you please share the final steps. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •