RMAN Backup Script not running in cron tab
Hi,
I am having rman backup script which is being executed successfully through shell.
but when scheduled in cron the script is being called but RMAN commands are not getting executed.
i have scheduled cron using oracle user.
Attached below the rman script for taking LEVEL 1 backup
#! /bin/ksh
DATE=`date +%Y-%m-%d`
export ORACLE_SID=ACIDC
export ORACLE_BASE='/home/app/oracle/product/10.2.0'
PATH=$PATH:${ORACLE_HOME}/bin
export PATH
export ULIMIT=unlimited
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib
export LIBPATH=$LD_LIBRARY_PATH:/usr/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
cd $ORACLE_HOME/bin
rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log
backup incremental level 1 database;
report obsolete;
delete noprompt obsolete;
exit;
EOF
exit 0
Attached cron script
SHELL=/bin/sh
PATH=:/usr/ucb:/bin:/usr/bin
10 17 * * 2 /oraclebkp/rmanscripts/rmandclvl1.sh 2>&1 >/oraclebkp/cronlogs/delobs.log
Files delobs.log
and oraclebkp/rmanlogs/ACIDC/$DATE.log are being created but with 0 bytes .
Thanks in Advance
HariPriya,
rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log Change this line to and try..
$ORACLE_HOME/bin/rman TARGET= / << EOF > /oraclebkp/rmanlogs/ACIDC/$DATE.log
Similar Messages
-
WLST script not running in CRON...
i have written a WLST scrit to connect to WLS and find the DS driver Information ....the script runs pretty good when i manulay run it ...however when i added the script to CRON it just invokes WLST and fails...I have the shell script (.sh) first set the env by invokin <WLS-HOME>/server/bin/setWLSEnv and then execute the WLST script....like i said everything is fine when run manually but the cron job fails......
when i chek the log file for the output i just see this
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
but when run manually its connecting....
There is no ownership issue as such coz other cron jobs with the same owner run succesfully....!!!
Please advise......
Thanks in advance....
Edited by: user10620079 on Feb 6, 2009 11:42 AMThnaks for all your replies....
I actually just made this change ...
instead of setWLSEnv...i invoked setDomainEnv.sh and then cd to the dir where i have the .py script and the rest as it is and now it works...!!!!!!
This tells me that may be setWLSEnv doesnt set all the required env variables for the .py script to run in cron....correct me if am still doing something wrong!!!!
Thanks all for your help really appreciate it!!!!
Edited by: user10620079 on Mar 16, 2009 1:20 PM -
What is causing the "script not running"? Why so long to open? Etc.
Hi Donekes,
First off I need a little more information to help with troubleshooting. You say that an error occurs when you "try to re-open the same problem app before the old session completely exits". Does the error have an error code or dialog display? It may also be possible to receive an error log. Here is a knowledge base that explains how to retrieve error logs.
http://digital.ni.com/public.nsf/websearch/54E361E3FF477EC186256C320068184F?OpenDocument
If you are able to get that information then please post. Have a good day.
Brian K. -
Upgraded my mac to yosemite and my toshiba backup will not run
I upgraded my Macbook Pro (June 2012 model) to Yosemite and now my Toshiba /backup will not run. I can see it when I attach it and am able to open the file. The last backup was in November 2014. Is there a fix or do I have to purchase another backup drive?
Custom will show automatically as soon as you just edit some options. So just go ahead, you don't need to select "custom"
-
Hi ,
I am getting the following error when i am executing manbackup shell script.
Message file RMAN<lang>.msb not found
Verify that ORACLE_HOME is set properly
RMAN Script
DATE=`date +%Y%m%d.%H%M`
#su - oracle
#<<EOF
export ORACLE_HOME=/home/app/oracle/product/10.2.0/db_1
echo $ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin
#export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=ACILOC
echo $ORACLE_SID
rman cmdfile=/oraclebkp/rmanbackupscripts/rmanlevel0bkp.bck log=/oraclebkp/rmanbackupscripts/rmanACILOClev0$DATE.log
export ORACLE_SID=ACIDC
echo $ORACLE_SID
rman cmdfile=/oraclebkp/rmanbackupscripts/rmanlevel0bkp.bck log=/oraclebkp/rmanbackupscripts/rmanACIDClev0$DATE.log
#EOF
level0bkp.bck
connect target `/'
run
backup incremental level 0 database;
but I am able to take RMAN backups by connecting as RMAN TARGET /
Thanks in advance
Priyaconnect target `/'Dont give / in quotations just connect as
connect target /
backup incremental level 0 database;
}Thanks
Close the threads as answered if helpful/correct.
user11342455
Handle: user11342455
Status Level: Newbie
Registered: Feb 18, 2010
Total Posts: 22
Total Questions: 10 (8 unresolved)
Edited by: CKPT on Jan 5, 2011 12:17 PM -
Hi,
I have script bellow. I want to run in one script on linux as shell script: how can i do that. i have very limited knowledge about it:
setenv TNS_ADMIN "/location/network/admin"
setenv ORACLE_HOME "/location/db1"
setenv TWO_TASK "DB1"
setenv ORACLE_SID "DB1"
rman run {
# Shutdown database for backups and put into MOUNT mode
shutdown immediate
startup mount
# Allocate channel. Important: This must be done after
# database has been mounted!!!
allocate channel t1 DEVICE TYPE DISK FORMAT '/backuplocation/DB1RMAN/%U' ;
# Perform full database backup
backup Database format '/backuplocation/DB1RMAN/%d_FULL_%U.bck';
# Open database after backup complete
sql 'alter database open';
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';
release channel t1;
}user12020966 wrote:
Hi,
I have script bellow. I want to run in one script on linux as shell script: how can i do that. i have very limited knowledge about it:
setenv TNS_ADMIN "/location/network/admin"
setenv ORACLE_HOME "/location/db1"
setenv TWO_TASK "DB1"
setenv ORACLE_SID "DB1"
rman run {
# Shutdown database for backups and put into MOUNT mode
shutdown immediate
startup mountWhy the shutdown? are you running in norachivelog mode?
# Allocate channel. Important: This must be done after
# database has been mounted!!!
allocate channel t1 DEVICE TYPE DISK FORMAT '/backuplocation/DB1RMAN/%U' ;Above not needed if you set it as part of the rman config:
oracle> rman target /
rman> CONFIGURE DEFAULT DEVICE TYPE TO DISK FORMAT '/backuplocation/DB1RMAN/%U';
# Perform full database backup
backup Database format '/backuplocation/DB1RMAN/%d_FULL_%U.bck';Your use of "format" is redundant with your channel allocation.
# Open database after backup complete
sql 'alter database open';
sql 'ALTER DATABASE BACKUP CONTROLFILE TO TRACE';No need to shell out to sql. those commands are accepted directly by rman.
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 285212672 bytes
Fixed Size 1267068 bytes
Variable Size 146803332 bytes
Database Buffers 134217728 bytes
Redo Buffers 2924544 bytes
RMAN> alter database open;
database opened
RMAN>
release channel t1;
}I'd strongly suggest you go to amazon.com and look up the books on rman backup and recovery by Hart and Freeman. You are making waaay too much work for yourself. -
OS windows 2000 server
database 9i
I am planning following script for backup of database.
run{
allocate channel ch1 type disk;
backup
format 'E:\oracle\backup\/%d_%s'
database plus archivelog delete input;
release channel ch1;
Want to overwrite the backup on every sunday on disk.
1.What changes should I make in script so that RMAN should not create new file
and overwrite older one.Thanks.
Now I can schedule backup job through above script.
With this script
run{
allocate channel ch1 type disk;
backup
format 'E:\oracle\backup\/%d_%s'
database plus archivelog delete input;
release channel ch1;
and CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
I want to delete obsolete backup
run{
allocate channel ch1 type disk;
backup
format 'E:\oracle\backup\/%d_%s'
database plus archivelog delete input;
delete obsolete;
release channel ch1;
It is not working as delete obsolete command asks for confirmation (YES/NO)?
How to do it ? -
RMAN Backup script for RAC Database..please suggest
Hi All,
I am currently working on backup policy for RAC Database for my client.The client requirement is to backup while database is shutdown(mount state).I have made below script and could any one please suggest what further things should I need to add with below rman script.
echo "Shutdown Database";date
srvctl stop database -d PROD
srvctl status database -d PROD
echo "Database shutdown on";date
echo "Mount Database ";date
srvctl start instance -d PROD -i "PROD1" -o mount
srvctl status database -d PROD
echo "Start Full Database Backup on";date
$ORACLE_HOME/bin/rman target / nocatalog <<EOF
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/BACKUP/PRODBKP/%F';
run{
allocate channel c1 device type disk connect 'sys/******@node1-vip:1521/PROD';
allocate channel c2 device type disk connect 'sys/*****@node2-vip:1521/PROD';
backup format '/BACKUP/PRODBKP/PROD_df_%t_%s_%p.bak'(database);
backup format '/BACKUP/PRODBKP/archive_%t_%s_%p.bak' archivelog all;
copy current controlfile to '/BACKUP/PRODBKP/PROD.ctl';
delete noprompt obsolete;
release channel c1;
release channel c2;
exit
EOF
echo "RMAN Backup Finished on";date
echo "Shutdown Database";date
srvctl stop database -d PROD
echo "Start Database";date
srvctl start database -d PROD
srvctl status database -d PROD
Please share your experiences.
RegardsHi,
Some tweaks for your script.
echo "Shutdown Database";date
srvctl stop database -d PROD
srvctl status database -d PROD
echo "Database shutdown on";date
echo "Mount Database ";date
srvctl start instance -d PROD -i "PROD1" -o mount1. If you database does not shutdown properly , does your script stops the execution of next step?
2. configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to '/BACKUP/PRODBKP/%F';(Why you need to configure this every time) ?
It's persistent at db level one time setting (until some other script changes the settings by other dba - else remove that - set the configuration at db level once for all)
- Pavan Kumar N
3. -
Need Advice on RMAN backup script
Hi;
Can any one advice if any error or guide to make RMAN backup proper :
Backup Policy are:
1. 0 level backup
2. current log file is arvhived before backing up
3. backup whole database (datafiles)
4. backup separate control file
5. backup is done on disk
6. control file auto backup ON
7. only 7 days archive log are need to be preserve ; old need to be deleted
### one time paramters seting
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'O:\rman\backup\Auto_Ctrl_weekly_%F';
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
### Command for weekly 0 level backup
run {
allocate channel c1 type disk;
sql 'alter system archive log current';
backup incremental level 0 tag = weekly_database format 'o:\rman\backup\full_weekly_%d_%s_%p_%t'(database);
release channel c1;
configure controlfile autobackup format for device type disk to 'o:\rman\backup\auto_ctrl_weekly_%f';
allocate channel c1 type disk;
backup tag = weekly_arch archivelog until time 'sysdate-7' format 'o:\rman\backup\archive_weekly_%d_%s_%p_%t';
delete archivelog until time 'sysdate-7';
release channel c1;
Regards
SmithDear Pierre F.;
Actually, I just added in my backup plan to have daily backup through RMAN, instead of COLD backup.
I have planned to take cold backup once a week. here is the side of data:
*** datafile 410
*** size of database : 86 GM
*** relog files size : 250MB
*** daily archive logs are : 250MB * 4(number of files) = 1GM aprox.
yes, time constraint is there; just because of the size of database. and we r going for 24/7
Is this script going to run only one per week ?
Ans: no I this was level 0 backup; i will take level 1 incremental backup with same script daily too.
Do you have any other RMAN script ?
ANS: no, I will modify same script for incremental.
after local copy of backup all backup files (RMAN) will be copy over network to backup server or we can install LTO tape device to copy directly from database server.
kindly advise me I am new in RMAN.
regards;
SMITH -
Tmadmin in unix script not executed in cron
Hi,
I have a script in HP UX that is using tmadmin and pclt to know the no of users that are currently using the system.
Let me call this script as myscript.sh.
#!/bin/sh
count = ' echo pclt | tmadmin | grep <search string> | wc -l '
echo $count
When the script is run in command line, (./myscript.sh) I am getting the results or the no of users. BUT when the script is put in cron , I have '0' output. It appears that tmadmin is not being executed when the script is called inside crontab.
I did specified the PATH environment variable, and hard coded the directory when tmadmin is located but still tmadmin is not executed.
Can someone help me on this ? Thanks.Hi,
You need more than the Tuxedo bin directory in your path. You also need the TUXDIR, APPDIR, and TUXCONFIG environment variables set. Add setting those to your script before invoking tmadmin and you should be good to go, assuming the account the cron job is running under has access to the TUXDIR and APPDIR directories.
Regards,
Todd Little
Oracle Tuxedo Chief Architect -
Hi,
We currently have an RMAN script that runs nightly to backup the database, including the archivelogs and purge. We are using flashback and would like to keep the archivelog available for 3 days.
I changed this:
backup check logical as compressed backupset archivelog all format '${RMAN_DIR}/%d_ARC_%Y%M%D_%s_%p'
delete input;
To this:
backup check logical as compressed backupset archivelog until time 'sysdate-3' format '${RMAN_DIR}/%d_ARC_%Y%M%D_%s_%p'
delete input;
I changed "all" to "until time 'sysdate-3'" and want to confirm this before I do anything. Thanks.Kamran's video would clear you everything.
I just want to add few quick steps from my side.
Step1.Make sure RMAN is connected to the right target database and the recovery catalog.
Then run the CREATE SCRIPT command, as shown in this example:
CREATE SCRIPT full_bkup
allocate channel ch1 type disk format '/backups/rman/%n%M%D%Y%s%U.bak' maxpiecesize 4G;
sql 'alter system archive log current';
sql 'alter system switch logfile';
backup incremental level 0 tag=rman_10 filesperset=5 database include current controlfile;
sql 'alter system archive log current';
sql 'alter system switch logfile';
release channel ch1;
Step2.Create a shell script rman_bkup_10g.ksh as below and initiate execution of the above script from this shell script.
rman target sys/sys-pwd@tgt-db-conn-str catalog rman/rman-pwd@rec-cat-conn-str
run {execute script *full_bkup*;}
exit
Step3.Schedule the shell script rman_bkup_10g.ksh in crontab as below(The example shows,the shell script gets executed everyday at 05:30)
30 05 * * * /path/to/script/rman_bkup_10g.ksh >> /path/to/log/rmanbkup.log
You may please tailor the scripts as per your need.
Edited by: bharathDBA on Aug 8, 2011 3:27 AM
Edited by: bharathDBA on Aug 8, 2011 3:52 AM
Edited by: bharathDBA on Aug 8, 2011 3:54 AM -
VB startup script not running on Win7
Hi,
my startup VB script not working on Windows 7. The script should install or uninstall office 2010 based on group membership.
I tested scipt on Windows XP and everything works. When I run script manually, it works.
Quite similiar batch file works, office are installed but not same functionality for me.
I turn UAC off, bot not working.. Also add dword EnableLinkedConnections but nothing change.
Batch file works but VBScript not!
Any advice? ThxHi Tomas Cink,
Based on my understanding, the start VB script which is deployed via GPO could not works fine on Windows 7 clients, although it can works fine on Windows XP clients and it can
run sucessfully if manually. Right?
Firstly, please run the following command on the problematic workstation.
Gpresult /h > C:\temp\gpresult.html (“C:\temp\” is the path of the gpresult.html, you can set it by yourself)
This file is used for checking the result of Group Policy information. Open the file to check if the GPO has applied.
If the GPO has applied, please follow the following step to narrow down the issue:
Change the script to the following command: add > %SystemDrive%\Users\test.txt
to the script.
Log on to a client with a regular user account, run
gpupdate/force, and then re-log on to this client.
Check if the test.txt file exists in this location
%SystemDrive%\Users.
If the
test.txt file exists, the GPO with startup script is applied successfully. But the result of running logon script achieves the goal we excepted or not which is still not sure.
Regards,
Lany Zhang -
Server side script not running on stand-alone XE
Hello,
In my application I created a Server side script (AJAX) which presents a select-list based on other fields on the page. The very same application runs on a 10g+APEX3.0.1 database AND on a standard XE+APEX2.1 database, which are both accessed via a HTTP-server. The application with the script runs fine on this platform (XP).
I have two other XP-machines on which I also installed XE+APEX2.1. Both are stand-alone versions NOT accessed via a HTTP-server. I installed exactly the same application which runs on the platform with HTTP server on both of the machines. While testing the correct functioning, I noticed that everything works ok, EXCEPT the server side script which gives me a better select list. Instead of this I get the old-fashioned version of the select-list which is not able to use the value elsewhere on the page.
I found a similar problem on the XE forum (Re: Server side scripts features ) but it doesn't answer my question how to get the script working on a standalone version of XE (= without access via a HTTP-server).
Can anybody please help me?
Thanks & regards,
Jan.
Message was edited by: Jan
J. HulsingCarl,
Thanks for your suggestion to install FireFox and the Firebug tool (which I wasn't aware of).
After having looked at the problem for hours, I found what I think is the problem: the htmldb_html_elements.js script.
As already mentioned, the properly functioning XE on my local PC is accessed via a HTTP-server, as well as the 10gR2+APEX3.0.1 version also running on that PC.
On the laptop, not running HTTP-server, I get the message: <br>
<FONT COLOR="RED">$x is not defined <BR>
<FONT COLOR="BLUE"> f_21_select_kpn<FONT COLOR="RED">(<FONT COLOR="BLUE">input<FONT COLOR="BLACK">#P21_GBREKNR 405<FONT COLOR="RED">, "P21_KOSTENPOST") <BR>
<FONT COLOR="BLUE">onblur<FONT COLOR="RED">(<FONT COLOR="BLACK">blur <FONT COLOR="RED">)
</FONT><BR>
That is in the 'Console' of Firebug.
When changing to Script I do see a remarkable difference.
On the PC there the following text is found in the first lines of htmldb_html_elements.js:
/*htmld_elements will contain the lower level html access js*/<br>
var gDebug = true;<br>
var gkeyPressTime;<br>
var gLastTab=false;<br>
var gRegex=false;<br>
var ie=(document.all)?true:false;<br>
if(ie){document.expando=true;}<br>
var gDebugWindow = false;<br>
/*<br>
$x functions have to do with either single elements or array of elements<br>
$v functions have to have to do with manipulating values or interaction based off a value<br>
$xml function have to do with manipulating xml values<br>
$a functions are based on ajax<br>
$d functions are specific dhtml constructs<br>
*/<br>
/* begin $x functions */<br>
function $x(pNd){<br>
try{<br>
var node;<br>
...<br><br>
On the laptop however the first few lines are:<br><br>
/*htmld_elements will contain the lower level html access js*/<br>
<br>
var gDebug = true;<br>
var gkeyPressTime;<br>
var gLastTab=false;<br>
var gRegex=false;<br>
if(document.all){document.expando = true;}<br>
// Elements //<br>
<br>
function html_GetElement(pNd){<br>
try{<br>
var node;<br>
switch(typeof (pNd)){<br>
...<br><br>
I think that the difference is in these two scripts.
But why are the scripts different: it is the same XE that is installed on the laptop and the PC.<br>The answer I found in the images/javascript directory of APEX3.0.1 which is located in the APACHE directory-tree (you have to copy the images to APACHE when you use the HTTP-server). And indeed: the htmldb_html_elements.js has exactly the same text as what I see in Firebug on the PC. So XE on the PC is using the javascripts in the image-directory of APACHE on the PC and not the XE-version of the scripts, embedded in XE.
<br><br>
So the answer seems to be: copy the APEX3.0.1 versions of the script over to the PC and try to get them into the database. Or...???
<br>
Can it be loaded into the database? Will XE accept it?
<BR><br>
Would be nice to have answers if the conclusion I found is the right one and if it can be fixed by loading the js into XE.
<br>
Best regards and thanks for your help so far.
<br>
Jan. -
GPO Startup/Shutdown scripts not running
I am running server 2003 SBS with windows 8.1 Pro workstations.
My workstations run 1 start-up script and 2 shutdown scripts. All are BAT files.
They were all working fine last week before I ran the update for 8.1.1, now they do not run at the appropriate time on any of those systems. However, if I execute them manually they work as expected.
I have checked to see if the BAT files are still located in the GPO and they are there. They are stored locally on each machine, I have even tried to delete and re-add them and then run GPUPDATE to no avail.
Any help here would be great, as they deal with local encrypted containers and are specific to each workstation.Hi Sebastian,
Thanks for posting.
Whether the GPO with start-up/shutdown scripts are linked to the OU containing computers?
FYI - Logon/Logoff scripts could only be applied to users, whereas Start-up/Shutdown scripts applies to computers.
Also, checkout the below thread on similar discussion,
http://social.technet.microsoft.com/Forums/windowsserver/en-US/b193e8a9-9b2a-4993-bd74-836c65c51dc3/gpo-with-a-startup-script-is-not-working
Regards,
Gopi
www.jijitechnologies.com -
WMI Scripts not Running Across VPN
Hi
I have a strange problem where i have 2 sites connected using a VPN on 2 CISCO877. But WMI scripts are not running across the link. if i pull these out an replace them with a Draytek, the scripts run fine.
Broad Lane LAN ----- Cisco 877 ========= Internet & VPN Tunnel ============== Cisco 877 ---- Southam LAN1.0.39.0/8 1.0.39.253 192.168.55.1 192.168.55.0/24 The server at Broad Lane is GIMILI (1.0.39.109) and at Southam is FRODO (192.168.55.4). The following will not work through the tunnel from Broad Lane LAN. Set objWMIService = GetObject("winmgmts:\\192.168.55.4\root\cimv2") if err.number=0 then serverexist=true else serverexist=falsemsgbox(server.exist)
Is is possible for the CISCO877 to block WMI traffic?
Any suggestions please?
Rgds
PhilPhil,
Thank you for your question. This community is for Cisco Small Business products and your question is in reference to a Cisco Elite/Classic product. Please post your question in the Cisco NetPro forums located here: http://forums.cisco.com/eforum/servlet/NetProf?page=main This forum has subject matter experts on Cisco Elite/Classic products that may be able to answer your question.
Bill
Maybe you are looking for
-
Itunes wont launch, no error message, no blue screens, just wont open
itunes wont launch, i get no error message, no blue screen, it just wont open. I've tried to delete and reinstall, but once i close itunes i still have same issue. it wont open again.
-
How to add a JDBC driver jar to ESB project?
I am developing an EJB project in JDeveloper 10.1.3.1. I am trying to connect MS SQL Server DB to the ESB. I set up the JDeveloper so it can connect to the MS SQL Server, list the tables&data. I put a DB Adapter using the existing connection to the d
-
Dear Gurus, How do we make it possible to accept external services that are not covered by a purchase order or exceed the scope of services covered by a purchase order? Thanks..
-
How can I delete the existing objects and Relation ships in OM?
Hi One and All, Hope all of you doin well, I want to delete the all existing objects in OM, like Org units, positions, jobs and etc... and also relationships. Please guide me. Thanks, Potru.
-
Burning slideshow to disc using iPhoto 5
I have a number of slideshows that I want to burn to disc to make prints of slideshow photos. Can this be done or do I have to drag photos from the library?