Hi,
I would like to save the RMAN script as a command file and schedule the job to be done at night. Could someone give me some idea or a simple example? Thanks in advance.
Printable View
Hi,
I would like to save the RMAN script as a command file and schedule the job to be done at night. Could someone give me some idea or a simple example? Thanks in advance.
Since you didn't post your OS and version, I am assuming Solaris and 8.1.7.2.
You can use cron to automatically kick off a script.
Inside your script, you will run rman from the command line similar to:
rman catalog rmanuser/rmanuser@rcvcat target / cmdfile=your_command.rman msglog=backup.out
[Edited by marist89 on 01-22-2002 at 04:38 PM]
What is your OS?
Sam
Thank you very much for responding. My OS is win2000 and the database server is 9i.
Go to Start --> Accessories --> System Tools --> Scheduled taskes
Create a new task and doble click on the task and that will bring up a detail window, there you specify the task that you want to run and the time frame at which it should be ran and etc.
Sam
Thanks Jeff and Sam. I solved the problem! I had tried to look for a solution for a while before I put my message on the web site. I am so glad that you guys help me out. In case of someone who has the same question as I did. I would like to share my experience with them. If there is anything incorrect, please feel free to correct me. The following are what I did:
1. Create RMAN script use Notepad and save the work as xxxxx.rman file. Example:
run {allocate channel c1 type disk;
backup database
tag ='rman_offline_backup'
format '\oracle\orabkup\tech\rmbkup\db_t%t_s%s_p%p'
(database);
backup current controlfile
tag='tech_contrlfile';
backup archivelog all;
release channel c1;
sql 'alter database open';}
2 Create Command file that will run the xxxxx.rman file. example:
sqlplus/nolog @ startrmbkup.sql ----- (execute the startrmbkup.sql to shutdown the target database and restart it in mount mode in order to perform consistent full database backup.)
rman rcvcat rmanuser/rmanuserpwd@recatalogname target dbusername/password @ targetdbname cmdfile=mytest.rman ------ (mytest.rman is the file I created in step one)
3 Schedule your job at the Command Prompt with the ‘at’ command.
Here are few suggestions that I would like to contribut towards your script.
1. Make sure that you have enough disk space.
2. In the backupscript, include the option of deleting the archivelog files as they get backed up.3. Mention files per set option to the backup, such that your recovery would get speeded upCode:backup archivelog all
delete input;
4. IF your database is of Enterprise, then you might want to think of adding more channels. On the other hand if it were to be of standard edition, then you can use only one channel at a time.
5. One other thing is that you can put them all in a script and then
call those scripts as
6. Then the last but not the least, try a recovery and get your self accustomed to it with a recoveryCode:run { execute script script_name; }
7. Make sure that you periodically clean the backup both from the catelog and disk, based on your shop's backup policy.
Sam
Hi Sam,
Thank you very much for your suggestions. Your last suggestion is exactly what I am looking for but don’t know what to do yet. It would be greatly appreciated if you could give me some clue on how to clean up the backup file both from the recovery catalog and disk and how often should I do it. Thanks again.
Depending on your OS, check for the files:
$ORACLE_HOME/rdbms/demo/*.rcv
They have a number of sample scripts on how to do an RMAN, HOT/COLD, FULL/INCREMENTAL backup.
You may use that as your template to refine your code. IF you need any assistance, please feel free to let us know.
Sam
Tang
I'd like to use RMAN. Could you please send me any scripts you have including suggestions on how you went about setting it up.
Oracle 8.1.7 Win2K Advanced server, WinNT.
Thanks
I am sorry I really don't have any scripts for Rman set up. For RMAN set up you can take a look at the article in http://technet.oracle.com. Doc ID:104798.1. go to the web site --->training&support---->metalink---->forums--->advance search----->select Doc ID---->type in 104798.1
I am sorry I really don't have any scripts for RMAN set up. For information on how to set up RMAN go to http://technet.oracle.com --->metalink--->advance search--->check Doc ID----> type in 104798.1
Joyce,Quote:
Originally posted by joyce_ank
Tang
I'd like to use RMAN. Could you please send me any scripts you have including suggestions on how you went about setting it up.
Oracle 8.1.7 Win2K Advanced server, WinNT.
Thanks
Refer to the directory location demo for scripts and that was more methodiced one. If you don't undestand any scripts there, feel free to post your questions on a new thread.
Also I would suggest you to go through the follwing URL which explains on how to work on with RMAN http://otn.oracle.com/docs/products/...a76990/toc.htm
Have fun.
Sam
Hi there,
I read the documents a couple of times as Sam recommanded. I have a couple of questions. Firstly I am confused about the even of the back up failure. Is that mean that I should include Not backed up since time ‘sysdate-1’ in my backup script? For example:
startup force dba;
shutdown immediate;
startup mount;
backup incremental level 0 database filesperset 4;
not backed up since ‘sysdate-1’;
alter database open;
Secondly If I am going to back up data to tape, do I have to use third party software such as Veritas? Are there any other way that I can back up data to tape directly? Any clues?
Thanks to Sam and anybody who are willing to help.
OS:MS 2000
Oracle 8.1.7.2
I am also trying to create the cmdfile for Rman like you, i named it rman.cmd when I double click on it or try to run it from command line nothing happens it just keeps running the statement over and over again and the screen gets blurry. But when I type the same command(from the cmd file) it runs perfectly, am I doing something wrong the way I am running the cmd program.
Thanx a lot in advance
Normally when you say Level0, it will check the catalog repository and back the database fully. If you have already done a backup, the present backup would be from the last level0 to the latest point of start. http://technet.oracle.com/docs/produ...onc.htm#436081
Comming to look into Knarayana's problem, could you please post your proceedures you followed in step by step form.
Sam
1.create a file in notepad similar to :
run {allocate channel c1 type disk;
backup database
tag ='rman_offline_backup'
format '\oracle\orabkup\tech\rmbkup\db_t%t_s%s_p%p'
(database);
backup current controlfile
create a file in notepad that similar to :
tag='tech_contrlfile';
backup archivelog all delete input;
release channel c1;
sql 'alter database open';}
save this file with rman extension xxxxx.rman.
2.create another file in notepad similar to:
connect system/password@connectstringtotargetdabase as sysdba
shutdown immediate
startup mount
exit;
save this file with the sql extension xxxxx.sql
this file shutdown the target database and restart the instance in mount mode
3.again in notepad create the command file that connects to target database and recovery catalog and runs the two files above. Code similar to
sqlplus/nolog @xxxxx.sql(file created in the second step)
rman rcvcat rmanuser/rmanuserpwd@connectstringtorecoverycatalog target dbusername/password @ connectstringtotargetdatabase cmdfile = xxxxx.rman(file created in the first step)
save this file with the batch file extension xxxxx.bat
4. double click the file created in the step 3, it will do all the job for you. You can also schedule the job to be done at anytime using the windows ‘at’ command. I hope this helps.
I want to schedule a full online backup everyday, here's what I have:
This is the backup script(cmdfile) created as a txt file for Rman to run:
run {
allocate channel t1 type disk;
set maxcorrupt for datafile 1,2,3,5,6,7,8 to 0;
backup
FULL
tag FULL_DEV4
format 'c:\mnt\ora_backup\DEV4\df_t%t_s%s_p%p'
database;
copy current controlfile to 'c:\mnt\ora_backup\dev4\CONTROL_t%t.ctl';
sql 'alter system archive log current';
backup
format 'c:\mnt\ora_backup\dev4\al_t%t_s%s_p%p'
(archivelog all delete input);
release channel t1;
}
and this is the command which works perfectly from dos prompt but when I run it as a rman.cmd or rman.bat file doesn't work:
rman nocatalog target sys/change_on_install @c:\mnt\ora_backup\scripts\bkpdev4.txt log=c:\mnt\ora_backup\scripts\bkpdev4.log
I have no clue why it doesn't run as a bat file or when I schedule it from the schedule task manager.
Please help!!