Shell Script for automatic backup
Hello Every one,
We have windows network and sun solaris sparc box. (both from Sun Box and from Windows machine I can communcate using Telnet.)
I wish to take data backup of a system having windows operating system, into
the sun solaris sparc box automatically by week end .
Can anyone help me with the shell script which does this operation.
Regards,
Dwarak
first of all, is there nfs running? and on windoze box, do u have any nfs client program running?
you cant transfer files frm the windoze machine via telnet..
once you can settle the above, what you can do is a simple copy script and put it in your crontab.
Similar Messages
-
HI,
i have written some java code Database backup but there are some problems with that so now i need to write shell script for db backup.
what i was doing in java code i was running command like that
/usr/local/bin/tar cvzf /export/home/monitor/FILE_20091005.tar.gz FILES/*20091005.*which compress the all *20091005* files (myisam table files)
but after compression file doesn't extract
so i have to write shell script for that ..... can any body guide me how can i write that kind of script and put it in cron job.
thankssoundar wrote:
Hi all,
I have migrated database from 8i to 10gr2.For Backup in 8i, we used a RMAN shell script (scheduled uding cron tab) to backup the database to Tape.(VERITAS BACKUP).
I am new to 10G.I checked out the options to backup the database using Oracle Enterprise manager DB console.
http://www.oracle.com/technology/obe/10gr2_db_single/ha/rman/rman_otn.htm#t1d
I am planning to take a test backup using the steps mentioned inthe above url.Could any one suggest whcih is the best option for database backup,eiether to use Oracle Enterprise manager DB console or thru RMAN shell script for backup..?
Edited by: soundar on Mar 9, 2010 10:53 PMDear soudar
I woudn't suggest you to work with EM if you want to be a professional DBA. Start learning RMAN and use CLI instead of GUI
Those who live by the GUI, die by the GUI -
Hi,
on 10G R2 in AIX 6.1
I'm looking for Shell script for RMAN backup.
Moreover , if we should connect like this :
rman nocatalog target sys/password@myDB << EOF
backup as compressed backupset format '$savdir/ctl_%d_%T_%s_%p' current controlfile;
exit
EOFHow to avoid writting password in shell script ?
Thank you.user522961 wrote:
Can you please tell me in case of having a catalog , how to connect to catalog without writting password in script ? I mean , how to write the following in a way without password :
#!/usr/bin/ksh
export ORACLE_SID=myDB
ORACLE_ENV_ASK=NO
. /usr/local/bin/oraenv
export savedir=/backups/myDB
rman target / << EOF
connect catalog rman/password@myrepository
backup as compressed backupset
format '$savdir/ctl_%d_%T_%s_%p'
include current controlfile;
exit
EOF:p -
Shell script for export backup in oracle 11g
Hi,
Oracle version 11.2.0..
O/S-AIX
How to write shell script for export full backup in oracle 11g and also need to remove 2 days of old backup.
Regards,
RajuHow to write shell script for export full backup in oracle 11g
Do you mean that export is your backup strategy ? is your database running in noarchivelog mode ? if so, then why ? if not so, then why not RMAN ?
need to remove 2 days of old backup.
If that mean remove files older than 2 days, you can use something like this :
$ find <absolute directory path> -mtime +2 -exec rm {} \; -
Shell scripting for hot backup
Hi,
can you please give me shell scripting and it's explanation for taking hot backup. and which shell scripts are frequently use in real time.
thank a lot in advance.HAve you ever heard about RMAN ? Much better than reinvent the wheel.
http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmquick.htm
Nicolas. -
Shell script for Automatic Awr Report
Hi Good Morning,
I have a requirement to generate the AWR report daily between (10AM - 06PM , 10AM - 01PM , 01PM - 10PM) . I have the below script for this . But the issue is this script is working only when i run it two times and before running i have to delete snap_list.lst file. Please let me know what is the problem in this script and how to resolve it.
Script :
dt=`date +%d%m%Y`
cd /orabkp/awr_report
chmod 777 *
rm -rf snap_list.lst
touch snap_list.lst
#rm -rf snap_list.lst
#rm -rf snap_list.lst
sqlplus -s " /as sysdba " <<EOF > snap_list.lst
host sleep 10
@/oracle/scripts/cron_scripts/rpt1.sql;
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-01PM.html
prompt 2
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
`cat snap_list.lst | grep "18:0" | awk '{print $1}'`
awrrpt\_$dt\_01PM\-06PM.html
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "18:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-06PM.html
@?/rdbms/admin/addmrpt.sql
`cat snap_list.lst | grep "06:0" | awk '{print $1}'`
`cat snap_list.lst | grep "12:0" | awk '{print $1}'`
ADDM_REPORT\_$dt\_10AM\-06PM.txt
EOF
exit
cat /oracle/scripts/cron_scripts/rpt1.sql
host echo 1
host sleep 10
@?/rdbms/admin/awrrpt.sql
HTML
1
`cat snap_list.lst | grep "10:0" | awk '{print $1}'`
`cat snap_list.lst | grep "13:0" | awk '{print $1}'`
awrrpt\_$dt\_10AM\-01PM.html
Regards
RajasekarHi,
Modify & Try this script used for rac awr ..
#!/bin/ksh
set -x
ORACLE_SID=DBSID
ORACLE_HOME=/u01/app/ora11g/product/11.2.0/db_1
export ORACLE_HOME
TERM=vt100
export TERM
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/local/bin:/usr/bin/X11:/bin:/sbin:.
PATH=$ORACLE_HOME/bin:$PATH
export DT=`date '+%d_%b_%Y_%HH_%MM'`
export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH DT
echo $DT
MAIL="[email protected]"
CMAIL="[email protected]"
AWRR="/u01/DBA_Scripts/AWR_REPO"
sqlplus -s "/ as sysdba"<<EOFSQL
set head off
set feed off
spool /tmp/bsnap.lst
select max(SNAP_ID)- 3 from dba_hist_snapshot;
spool off
spool /tmp/esnap.lst
select max(SNAP_ID) from dba_hist_snapshot;
spool off
spool /tmp/iname.lst
select instance_name from v\$instance;
spool off
spool /tmp/dname.lst
select database_name from v\$database;
spool off
spool /tmp/inum.lst
select instance_number from v\$instance;
spool off
spool /tmp/dbid.lst
select dbid from v\$database;
spool off
EOFSQL
BSNAP=`cat /tmp/bsnap.lst | tail -1 | awk '{ print $1}'`;export BSNAP
ESNAP=`cat /tmp/esnap.lst | tail -1 | awk '{ print $1}'`;export ESNAP
INAME=`cat /tmp/iname.lst | tail -1 | awk '{ print $1}'`;export INAME
DNAME=`cat /tmp/dname.lst | tail -1 | awk '{ print $1}'`;export DNAME
INUM=`cat /tmp/inum.lst | tail -1 | awk '{ print $1}'`;export INUM
DID=`cat /tmp/dbid.lst| tail -1 | awk '{ print $1}'`;export DID
echo "Begin Snap : $BSNAP"
echo "End Snap : $ESNAP"
#echo "InstanceName: $INAME"
echo "DB Name : $DNAME"
#echo "InstanceId : $INUM"
echo "DB ID : $DID"
sqlplus -s "/ as sysdba"<<EOFSQL
define inst_num = $INUM;
define num_days = 12;
define inst_name = 'ALL';
define db_name = '$DNAME';
define dbid = $DID;
define begin_snap = $BSNAP;
define end_snap = $ESNAP;
define report_type = 'html';
define report_name = $AWRR/Awr_report_$DT.html
@@?/rdbms/admin/awrgrpti
EOFSQL
cat /u01/DBA_Scripts/mail_body.txt | mailx -a $AWRR/Awr_report_$DT.html -c $CMAIL -s "DB Report - DB " $MAILThanks,
Ajay More
http://www.moreajays.com -
I wrote shell scriptevery thing is working like showning me names of datafiles
but now showing member of redo logs
and name of controlfile
#!/usr/bin/sh
TNS_ADMIN=/disk2/oracle/product/10.2.0/Db_1/network/admin
export TNS_ADMIN
ORACLE_HOME=/disk2/oracle/product/10.2.0/Db_1
export ORACLE_HOME
DEST=/disk2/PSFSTRN/PSFSTRN_BACK`date '+%Y%m%d'`
mkdir $DEST
sqlplus -s sys/testing@PSFSTRN as sysdba <<EOFSQL
set echo off
set feedback off
set heading off
set pagesize 500
spool coldbkup.sh
select 'cp '||file_name ||' /disk2/PSFSTRN' from dba_data_files;
select 'cp '||member||' /disk2/PSFSTRN' from v$logfile;
SELECT 'cp '||member||' g:\orclbkp'||to_char(sysdate,'ddmonyyyy')||'' from v$logfile order by member;
select 'cp '||name||' /disk2/PSFSTRN' from v$controlfile;
spool off
shutdown immediate;
exit;
EOFSQL
sh coldbkup.sh
sqlplus sys/testing@PSFSTRN as sysdba <<EOFSQL
startup
set echo on
set feedback on
EOFSQLWhat issue are you facing, exactly? You said:
"I wrote shell scriptevery thing is working like showning me names of datafiles
but now showing member of redo logs
and name of controlfile"
That's what the script looks like it's supposed to do. Did you mean to say "not showing member of redo logs and name of controlfile" instead of "now"? -
Can anybody provide AIX shell script for Oracle Apps R12 instance backup
Hi
Can anybody provide AIX shell script for Oracle Apps R12 instance backup? Manually, i am able to backup but i donot have shell script to schedule through crontab.
Help me please.
ThanksRman can be used for Database, not for Application tier. Again, I assumed you are looking for a script to backup the database. For the application tier, you can simply do a filesystem backup.
I still do not understand your concern? Is it about using crontab? If so, then check here --> man crontab <-- -
Need Help in creating Unix Shell Script for database
Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
Here is the condition which i want to implement.
1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
2. Increase size of redolog file.
3. Load sample schema.
4. dump the schema.
5. Create empty db (Script should check if db already exists and drop it in this case).
6. Create backup using rman.
7. restore backup which you have backed up.This isn't much of a "code-sharing" site but a "knowledge-sharing" site. Code posted me may be from a questioner who has a problem / issue / error with his code. But we don't generally see people writing entire scripts as responses to such questions as yours. There may be other sites where you can get coding done "for free".
What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
But the expectation here is for you to write your own code.
Hemant K Chitale -
Want to create unix shell script for Clone procedure in 11i and r12
Want to create unix shell script for Clone procedure in 11i and r12 .Can anyone help me on this as I m new to oracle apps and scripting.
Thanks in advance .user11958935 wrote:
Thanks but I want it for application cloning ie adcfgclone and autoconfig etc .Please see old threads for similar topic/discussion.
https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+Rapid+AND+Clone&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
https://forums.oracle.com/forums/search.jspa?threadID=&q=Automate+AND+AutoConfig&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
Thanks,
Hussein -
Shell scripting for sftp command
Guy's
you may wondering how i can ask these question in this forum,actually it's related to abap,we have create
unix script that will upload file from remote sftp server
and put it into AL11 transcation (take any location from
your point of view),but instead of using shell script
that is having ftp the want to go for sftp,for your undersatnding following thing's i am working with
<b>Tcode</b>:sm69,sm49
<b>function module</b>:SXPG_COMMAND_EXECUTE
script that need to have sftp instead of ftp
Connecting to ftp server to get the file on the current server
SOURCE_FILE_NAME=TSPAR_`date +%Y%m%d`.txt
TARGET_FILE_NAME=TSPAR_`date +%Y%m%d`.txt
cd /interf/torrance/TCW/FI
ftp -nv << EOF
open 10.252.8.73
user sanju sanju
cd /home/sanju
get $SOURCE_FILE_NAME
EOF
cp SOURCE_FILE_NAME TARGET_FILE_NAME
rm SOURCE_FILE_NAME
<b>note:</b>above script is working ,but we want' sftp not ftp
don't try above script as such,because value's are
changed for sake of securityTry to execute same command using your OS .
ksh + x ( is for debugging ) shell script and see where its failing . I also did the same thing in last project as i have written 5 different shell scripts , for backup , append file , sending file to FTP location and then create email ...
Hope thisll help you
Thanks -
Getting error while running script for online backup
Hi,
I am running a script for online backup but ended up with an the below error.
*ERROR* [Backup Worker Thread] com.day.crx.core.backup.Backup Failed to create temporary directory
Please help out in resolving this.
Thanks in Advnace.
MaheswarHi mahesh,
If you are using backup feature from crx console, I mean http://localhost:4502/crx/config/backup.jsp I can say that we had also some problems with this functionalities.
First off all what you need to check are the permissions, because when you check a source code there is line which creates a File object using a path specified by you to make a backup of repository.
File targetDir = new File(req.getParameter("targetDir", listDir.getParentFile().getAbsolutePath()));
You need to have sure that the proper read write access has been granted for this path.
Another issue is that maybe there was already prepared some hotfix if you are using CQ5.4. Please refer to the following link:
http://dev.day.com/content/kb/home/Crx/CrxSystemAdministration/CRXOnlineBackup.html
and also to this one:
http://dev.day.com/content/docs/en/crx/current/release_notes/overview.html which contains a hotfix number #34797 which was applied to backup.jsp file.
Regards,
kasq -
Shell script for archive log transfer
hi
I dont want to reinvent the wheel.
I am looking for shell script for log shipping to provide standby db.
What I want to do is, get the last applied archived log number from alert.log
Copy the files from archive destination according to this value.
CheersIf you don't want to re-invent the wheel you use Dataguard, no scripts.
And your script should use the dictionary, instead of some bs method to read the alert.
v$archived_log has all information!
Also as far as I know, the documentation describes manual standby.
So apparently you not only don't want to reinvent the wheel, but you want the script on a silver plate on your doorstep!
Typical attitude of most DBAs here. Use OTN for a permanent vacation.
Sybrand Bakker
Senior Oracle DBA -
Shell script for below pl/sql script dbms_file_transfer
Please let me know how tt write the shell script for below pl/sql script dbms_file_transfer it is
I have trasfer the files from asm into filesystem .
it is working . but i have to put in the loop
begin
dbms_file_transfer.copy_file(
source_directory_object => 'src',
source_file_name => 'ncsn',
destination_directory_object => 'dest',
destination_file_name => 'ncsn');
end;
Edited by: user8680248 on 27/10/2009 20:55user8680248 wrote:
Please let me know how tt write the shell script for below pl/sql script dbms_file_transfer it is
I have trasfer the files from asm into filesystem .
it is working . but i have to put in the loop
begin
dbms_file_transfer.copy_file(
source_directory_object => 'src',
source_file_name => 'ncsn',
destination_directory_object => 'dest',
destination_file_name => 'ncsn');
end;What database version?
What are you trying to do exactly?
It's working but you have to put it in a loop. Fine, what's the problem you are having?
begin
loop
exit when ... whatever the exit condition is ...
dbms_file_transfer.copy_file(
source_directory_object => 'src',
source_file_name => 'ncsn',
destination_directory_object => 'dest',
destination_file_name => 'ncsn');
end loop;
end; -
Shell script for batch compilation of forms 10g on AIX 5.3L AS
Hi All,
Can anybody provide me the Shell script for batch compilation of forms 10g and reports 10g on AIX 5.3L AS?
Regards,
SAMHi Alex,
I tried with the below script as well as the one you had posted.
ORACLE_HOME=/opt/oracle/OraHome_3
export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/jdk/jre/bin:$ORACLE_HOME/jdk/jre/bin/cla
ssic:$LIBPATH
export LIBPATH
cd ../forms
for i in `ls *.pll`
do
echo Compiling Library $i ....
$ORACLE_HOME/bin/frmcmp module=$i userid=mydbuser/mydbuser@mydb
batch=yes module_type=library
compile_all=yes window_state=minimize
done
export ORACLE_HOME=/opt/oracle/OraHome_3
export ORACLE_TERM=vt220
export LD_LIBRARY_PATH=/opt/oracle/OraHome_3/lib:/opt/oracle/OraHome_3/jdk/jre/l
ib:/opt/oracle/OraHome_3/jdk/jre/lib/i386:
cd ../forms
for i in `ls *.pll`
do
echo "Compiling Library $i ...."
/opt/oracle/OraHome_3/bin/frmcmp module_type=form userid=mydbuser/mydbuser@mydb
module=$i batch=yes compile_all=no
window_state=minimize upgrade=no
done
echo "PLL Compilation done"
But there was a same kind of error thst turning up all the time.
Compiling Library Agf.pll ....
Forms 10.1 (Form Compiler) Version 10.1.2.0.2 (Production)
Forms 10.1 (Form Compiler): Release - Production
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
PL/SQL Version 10.1.0.4.2 (Production)
Oracle Procedure Builder V10.1.2.0.2 - Production
Oracle Virtual Graphics System Version 10.1.2.0.0 (Production)
Oracle Multimedia Version 10.1.2.0.2 (Production)
Oracle Tools Integration Version 10.1.2.0.2 (Production)
Oracle Tools Common Area Version 10.1.2.0.2
Oracle CORE 10.1.0.4.0 Production
FRM-10043: Cannot open file.
Form not created
I hence updated the permissions on the pll as below
-rwxrwxrwx 1 oracle oinstall 335872 May 19 16:31 Agf.pll
But the problem is still persisting.
My environment details are as below.
I am working on Win XP machine. Connected to my AS via telnet and xmanager. I have set my DISPLAY to my local IP.
Is there any thing more that I need to do? If so then let me know.
Regards,
SAM
Maybe you are looking for
-
Installing Adobe CS6 on Windows 8 (2012) Consumer Preview
Hello, First off, yes I know it isn't supported by Adobe (yet), however, I want to present to you my case for future users. I have been investigating an issue I have ever since I got an Error 101 with Adobe Download Assistant where after extracting,
-
Error Msg says Firefox 4.0 "incompatible" with Mac OS 10.4.11?
Just downloaded 4.o and it will not launch. I deleted 3.6.16. so now: no Firefox. Advice would be appreciated! Thanks!
-
WinXP and iTunes 10.5.1.42 Home Sharing problem
The setup is WinXP SP3 patched iTunes 10.5.1.42 installed and reinstalled 2 iPhone 4S firmware 5.0.1 1 iPhone 4 firmware 5.0 All the devices and ITunes share the same Apple ID, ITunes Edit->Prefs->Sharing->Share My Library turned on, Advanced->Turn O
-
I just want to open a pdf from my websearch,, WHY do I have to join a forum? How did I geth here from customer support?
-
Is there a way to automatically save my keywords to the metadata?
I'm coming from Lightroom, and it does it all automatically.