DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Issuing O/S command from inside RMAn script

  1. #1
    Join Date
    Mar 2001
    Location
    New York , New York
    Posts
    577
    Hi,

    How do I issue a O/S Command from inside RMAn script.

    I know we can use the Host command but the command takes you to the command prompt.

    How do I do it without breaking the continuity of the program.

    something like

    run{
    allocate...
    host copy c:\a.txt d:\ (this does not work. i am looking for something similar)
    }
    Thanks
    Ronnie
    ronnie_yours@yahoo.com

    You can if you think you can.

  2. #2
    Join Date
    May 2002
    Posts
    42
    Why not just do a rman copy?

    copy datafile mydatafile to '/path/to/mydatafile.dbf.bk'

    If you us an O/S command you will have to put the tablespace into hotbackup mode. If you copy through rman then the rman server process will do the copy and you will not have to put the tablespace into hotbackup mode.

    Andrew

  3. #3
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    You can use the OS command in quotes. e.g.

    RMAN>host "ls -l";

    But as Andrew said it is better to use RMAN copy instead of OS copy.
    If you use OS copy you will have to put TS in backup mode and also you will have to catalog the datafile copy in recovery catalog.

    Sanjay

  4. #4
    Join Date
    Mar 2001
    Location
    New York , New York
    Posts
    577
    Thanks a lot guys. It was teh quote.

    I wanted to know this to copy init.ora files.

    Thanks again
    Ronnie
    ronnie_yours@yahoo.com

    You can if you think you can.

  5. #5
    Join Date
    Apr 2002
    Posts
    28
    Another alternative is to wrap the RMAN code within a Perl script - then use the Perl system() command to perform any other tasks you might desire. I find that having a full-feature programming language available to me is a great help with many of the sys admin and DBA tasks I need to perform.

    Here is a full-featured RMAN backup script I like to use for situations where I am not using a recovery catalog:
    http://www.dotcomsolutionsinc.net/pr...in901_29_.html

    In this script I use File::Copy::copy() to copy the init.ora and orapwd files to back them up before doing the RMAN backup.


    David Simpson
    www.dotcomsolutionsinc.net

Posting Permissions

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


Click Here to Expand Forum to Full Width