Were working tech professionals who love collaborating. |, set CMDFILE=%ORATMP%\%FILENAME%_%TNS_ALIAS%.rcv, set LOGFILE=%ORALOG%\%FILENAME%_%TNS_ALIAS%.log, REM | REMOVE OLD LOG AND RMAN COMMAND FILES. The time we save is the biggest benefit of E-E to our team. The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. Multiple MVEs may be awarded each year. |, REM | USAGE : |, REM | rman_backup_hot_full_10g.bat "DBA_USERNAME" "DBA_PASSWORD" "TNS_ALIAS" |, REM | NOTE : As with any code, ensure to test this script in a |, REM | development environment. Our community of experts have been thoroughly vetted for their expertise and industry experience. 1996-2022 Experts Exchange, LLC. Come for the solution, stay for everything else. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. Hi, I have a windows .bat file that I would like to schedule in a .cmd file where I can execute the .bat file and not have to show the variables for the user and password. |, echo sql "alter system archive log current"; >> %CMDFILE%, echo CONFIGURE CONTROLFILE AUTOBACKUP ON; >> %CMDFILE%, REM echo format 'X:\rman\BACKUPSET\ora_df%%t_s%%s_s%%p' >> %CMDFILE%, echo (database include current controlfile); >> %CMDFILE%, echo format 'X:\rman\\ARCHIVE\log_%%t_%%s_%%r.arc'; >> %CMDFILE%, REM echo backup database plus archivelog delete input; >> %CMDFILE%, REM echo crosscheck backup of database; >> %CMDFILE%, REM echo crosscheck backup of controlfile; >> %CMDFILE%, REM echo crosscheck archivelog all; >> %CMDFILE%, REM echo delete noprompt force obsolete;>> %CMDFILE%, REM echo delete force noprompt expired backup of database; >> %CMDFILE%, REM echo delete force noprompt expired backup of controlfile; >> %CMDFILE%, REM echo delete force noprompt expired archivelog all; >> %CMDFILE%, REM | PERFORM RMAN BACKUP. |, rman target %DB_USERNAME%/%DB_PASSWORD%@%TNS_ALIAS% nocatalog cmdfile=%CMDFILE% msglog %LOGFILE%, REM | SCAN THE RMAN LOGFILE FOR ERRORS. Thanks again for your help could u please send me some example about how can i do the scripts for windows(rman), error in cloning using RMAN error while looking up datafile: 82, recovery in archive mode; no archived logs. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange. Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success. Our experts volunteer their time to help other people in the technology industry learn and succeed. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed. We can't always guarantee that the perfect solution to your specific problem will be waiting for you. HiI'm running RMAN on AIX using a script that is executed through CRON. I want to set up a similar process on Windows using a .bat file and scheduling through Windows AT. This is on Oracle 9i and I would like to avoid using a recovery catalog which I assume prevents me from using the cmdfile as a solution. Can this be done?? Welcome to our community! If you ask your own question - our Certified Experts will team up with you to help you get the answers you need. The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics. All rights reserved. Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. I guess this is part of the frustrating side of working with Oracle. |, REM +--------------------------------------------------------------------------+, REM | VALIDATE COMMAND-LINE PARAMETERS |, REM | VALIDATE ENVIRONMENT VARIABLES |, REM | DECLARE ALL GLOBAL VARIABLES. A good example is the "target=" The Oracle Press Rman and Recovery has it with the "=" and I've been using it this way on Unix where I am running it from Cron. |, REM | DBA_PASSWORD Database password RMAN will use to login |, REM | to the database. ? I did a simple .bat file and can make the RMAN connection but it stops there and doesn't execute the rest of the commands within the .bat file. An example would be very helpful. Thanks so much for any advice/suggestions. |, REM | TNS_ALIAS TNS connect string to the target |, REM | database. |. |, "C:\WINDOWS\sendmail\sendmail.exe" -messagefile=X:\somedirectorypath\logs\rman_backup_hot_full_10g.log -subject="RMAN Online Backup was Successful" email1@domain, "C:\WINDOWS\sendmail\sendmail.exe" -messagefile=X:\somedirectorypath\logs\rman_backup_hot_full_10g.log -subject="RMAN Online Backup Failed" email1@domain, REM | END THIS SCRIPT. This award is based off of nominations by EE users and experts. We're a community of IT professionals committed to sharing knowledge. Unfortunately I don't have a Windows system to test, but you can try the following: Thanks Frank..unfortunately that doesn't seem to work and I'm back to no longer getting any output file. With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. We can't guarantee quick solutions - Experts Exchange isn't a help desk. |, REM | |, REM | PARAMETERS : DBA_USERNAME Database username RMAN will use to login |, REM | to the database. This script uses the database control file as |, REM | the RMAN repository. I would think that the syntax should be pretty well set, standard and well documented. |, REM | WRITE RMAN COMMAND SCRIPT. When I access RMAN. Covered by US Patent. A command script will be dynamically |, REM | written to a temporary directory and run through RMAN. The command that I used for testing is: See if this solution works for you by signing up for a 7 day free trial. This user must have |, REM | the SYSDBA role. Its like crowd-sourced consulting. REM | FILE : rman_backup_hot_full_10g.bat modified 07/14/2011 |, REM | CLASS : WINDOWS Shell Scripts |, REM | PURPOSE : Used to perform a physical backup of an Oracle database |, REM | using RMAN.