-
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
-
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
-
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
-
Thanks a lot guys. It was teh quote.
I wanted to know this to copy init.ora files.
Thanks again
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|