Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    May 2004
    Posts
    40

    Unanswered: customize script rman

    Does anyone familiar with rman autorun script without cold shutdown database immediate


    The script as follows seems can't run
    1. should I paste the following script and rename it as "backup.bat"
    2. On the Scheduled task, i then schedule this "backup.bat" run on 11:00pm. but it seems doesn't work
    3. I don't want any cold close immediate for the database. I guess the scripts following missing something
    Please see


    Script content want to run auto scheduling:
    __________________________________________________ _
    rman target sys/password nocatalog
    rman>run{
    allocate channel c1 type disk1;
    backup current controlfile format 'c:\backups\%U';
    release channel c1;
    }

    rman>run{
    allocate channel c1 type disk1;
    backup archivelog all delete input format 'c:\backups\%U';
    release channel c1;
    }







    thanks
    gary

  2. #2
    Join Date
    May 2006
    Posts
    132
    Database version?

    What errors are you getting?

    At just a quick glance, the syntax of your commands are not correct.

    allocate channel c1 type disk1;

    should be,

    allocate channel c1 device type disk;

  3. #3
    Join Date
    May 2004
    Posts
    40
    how to enable those script to scheduel and auto run on
    command prompt "cmd"


    this script saved as "backup.ba" but doens't know runing on command prompt.

  4. #4
    Join Date
    May 2004
    Posts
    40

    backup.bat invoke the cmd

    how to enable those script to scheduel and auto run on
    command prompt "cmd"


    this script saved as "backup.bat" but doens't know runing on command prompt.

  5. #5
    Join Date
    May 2006
    Posts
    132
    If you can't get your script to run manually from the command prompt, then why are you worried about scheduling it?

    See my comments above !!

  6. #6
    Join Date
    Sep 2004
    Posts
    60
    Why you want to run it from cmd prompt?? You can put Your script into cron ( schedular) to run at specified time.


    ebrian,
    Both the stmt in your post are correct. (with or without 'device')

  7. #7
    Join Date
    May 2006
    Posts
    132
    Quote Originally Posted by abhishekdixit
    ebrian,
    Both the stmt in your post are correct. (with or without 'device')
    My point was that disk1 was incorrect !

  8. #8
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    Besides having incorrect syntax, the script only backup's the controlfile and the archive logs, NOT the database!
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  9. #9
    Join Date
    Sep 2004
    Posts
    60

    Thumbs up

    ebrian,

    You are correct about DISK1.

    My appologies. Interpreted it incorrectly.

  10. #10
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Just as a help, the following is the run command from a test machine at our site

    run {
    allocate channel ch1 type disk;
    set limit channel ch1 kbytes 2000000;
    backup database
    format 'c:\backup\%U';
    sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
    allocate channel ch1 type disk;
    set limit channel ch1 kbytes 2000000;
    backup archivelog all delete input;
    backup current controlfile;
    }
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  11. #11
    Join Date
    May 2006
    Posts
    132
    Bill, my guess is you are on at least 9i ?

    Just curious for the need of "sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';" ?

    Nevertheless, this should help the OP.

  12. #12
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Quote Originally Posted by ebrian
    Bill, my guess is you are on at least 9i ?

    Just curious for the need of "sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';" ?

    Nevertheless, this should help the OP.
    That is used to flush the current redo log to an archive log before the archive logs are backed up. Also, while we have a number of different versions of oracle, the script is from an 8.1.7.4 machine.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  13. #13
    Join Date
    May 2006
    Posts
    132
    Ahhhh...gotcha. Ok, I had 9i on my mind, where they switch out the archive logs automatically.

    Thanks.

  14. #14
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    This works for me in 8.1.7:
    Code:
    RUN {
    ALLOCATE CHANNEL ch01 TYPE DISK;
    ALLOCATE CHANNEL ch02 TYPE DISK;
    
    BACKUP
        INCREMENTAL LEVEL=0
        SETSIZE=2000000
        FORMAT "D:\backup\dbsid_0_dbf_s%s_p%p"
        DATABASE;
    
    SQL "ALTER SYSTEM ARCHIVE LOG CURRENT";
    
    BACKUP
        FORMAT "D:\backup\dbsid_0_arc_s%s_p%p"
        ARCHIVELOG ALL
        DELETE INPUT;
    
    RELEASE CHANNEL ch01;
    RELEASE CHANNEL ch02;
    }

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  15. #15
    Join Date
    May 2004
    Posts
    40
    Quote Originally Posted by abhishekdixit
    Why you want to run it from cmd prompt?? You can put Your script into cron ( schedular) to run at specified time.


    ebrian,
    Both the stmt in your post are correct. (with or without 'device')

    Please then instruct how to put my current script into cron (schedular) please show and should I need to give a name of the script into a file.

    Many 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
  •