Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for Copying Archives from one server to another

Status
Not open for further replies.

KOG

MIS
Jan 31, 2002
303
GB
Hi Folks

The next project I will be working on is to set up IBM 6E1 server for oracle standby database. Due to limit budget we are using oracle 8.1.7 standard edition which means I have to manually copy the archived redo log files from one server to another so that both databases are in sync with each other - this is important for database recovery in failover situation.

I would like to learn how to create a short script to check and compare the existing archived files on the 6E1 server and compare it against those on the live box .. and if any new archived files have been generated then copy it over.

Have any of you worked on this kind of project? If so I would appreciate a copy of aix script.

Any suggestions would be greatly appreciated.

Regards

K
 
hi ,

It depends whether your secondary server is an NT box or another UNIX box / and whether you want to compress the archive log files before you copy them over .

The steps you can follow are as follows:-

1. Check if the secondary server is active i.e ping the server if all o.k continue otherwise stop and send warning server is not responding

2. if 1 is o.k cd into directory , note if you want to zip the files before copying over do :-

LOOP for each archivefile
fuser filename
if in use then leave otherwise gzip filename

END LOOP

3. Another LOOP to copy zipped files
for each filename.gz
do
either
ftp -n SECONDARY SERVER > /tmp/errTEMP 2>&1 <<-EOD
user REMOTEUSER REMOTEPASSWD
bin
put
quit
EOD
check /tmp/errTEMP for errors if any
remove /tmp/errTEMP
done END LOOP

OR you can

rcp *.gz SECONDARYSERVER:DIRECTORY



Hopefully this should get you started


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top