This discussion is archived
8 Replies Latest reply: Sep 16, 2013 4:28 AM by DK2010 RSS

rman run block

user472167 Newbie
Currently Being Moderated

I am trying to do an incremental backup level 1 using the following commands and works fine.

connect target /

backup incremental level 1 device type disk database;

backup device type disk archivelog all not backed up delete all input;

allocate channel for maintenance type disk;

delete noprompt obsolete device type disk;

release channel;

 

If I put the commands in a run block (except the connect) the following error occurs:

 

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Sep 16 12:35:17 2013

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

RMAN> connect target *

2> run {

3> backup incremental level 1 device type disk database;

4> backup device type disk archivelog all not backed up delete all input;

5> allocate channel for maintenance

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-00558: error encountered while parsing input commands

RMAN-01009: syntax error: found "for": expecting one of: "channel_id, double-quoted-string, identifier, single-quoted-string, "

RMAN-01007: at line 5 column 18 file: Backup_Incremental.rman

  • 1. Re: rman run block
    Paul M. Oracle ACE
    Currently Being Moderated

    2> run {

    3> backup incremental level 1 device type disk database;

    4> backup device type disk archivelog all not backed up delete all input;

    5> allocate channel for maintenance

    RMAN-00571: ===========================================================

    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

    RMAN-00571: ===========================================================

    RMAN-00558: error encountered while parsing input commands

    RMAN-01009: syntax error: found "for": expecting one of: "channel_id, double-quoted-string, identifier, single-quoted-string, "

    RMAN-01007: at line 5 column 18 file: Backup_Incremental.rman

    In ALLOCATE CHANNEL FOR MAINTENANCE you can read

     

    Execute this command only at the RMAN prompt, not within a RUN block.

  • 2. Re: rman run block
    user472167 Newbie
    Currently Being Moderated

    Is there any problem to run the above block without the run?

     

    I know that we Use the RUN command to group a series RMAN commands into a block to be executed sequentially.


    If I do not use the run block how are the commands will be executed?


    Is there any difference between the above scripts?

  • 3. Re: rman run block
    DK2010 Guru
    Currently Being Moderated

    Hi,

     

    You can use

    RMAN >run{

    backup incremental level 1 device type disk database;

    backup device type disk archivelog all not backed up delete all input;

    delete noprompt obsolete device type disk;

    }

     

    after completion you can  run

    RMAN>allocate channel for maintenance type disk;


    Hope this Help

  • 4. Re: rman run block
    nagulan.selvakumar Journeyer
    Currently Being Moderated

    Hi,

     

    Both (with and without run block) serves the same purpose in this case.

    You don't have to allocate channel for maintenance manually as RMAN will automatically allocate channels.

     

    Thank you!!

  • 5. Re: rman run block
    user472167 Newbie
    Currently Being Moderated

    Is there any essential difference between the following 2 scripts:

     

    RMAN >run{

    backup incremental level 1 device type disk database;

    backup device type disk archivelog all not backed up delete all input;

    delete noprompt obsolete device type disk;

    }

     

    RMAN >backup incremental level 1 device type disk database;

    backup device type disk archivelog all not backed up delete all input;

    delete noprompt obsolete device type disk;

     

     

    As it is written in the manual "the RUN command to group a series RMAN commands into a block to be executed sequentially".

    Is there any case that, during the 2nd script without the run, the commands will be executed in a non sequential order?

  • 6. Re: rman run block
    DK2010 Guru
    Currently Being Moderated

    Hi,

    No, there is no difference, other then you have to wait till finish the first command to run the second command on the  RMAN prompt. and so on..

  • 7. Re: rman run block
    user472167 Newbie
    Currently Being Moderated

    Since i ran these commands using a batch file it means no difference at all.

  • 8. Re: rman run block
    DK2010 Guru
    Currently Being Moderated

    Hi,

     

    No, difference. while you are using batch the run block would be better option to manage. and  for Maintain Task you  only keep  it out from your run block.

     

    HTH

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points