Operating System - HP-UX
1751980 Members
5066 Online
108784 Solutions
New Discussion юеВ

Re: Script archive log transfer to standby db

 
SOLVED
Go to solution
John Flanagan
Regular Advisor

Script archive log transfer to standby db

Hi,

I have just setup a standby db (Oracle 8.0.5) and everything works fine but I would like to script the transfer for archive log files from one computer to the other. Please submit any scripts to do this.

John.
16 REPLIES 16
RAC_1
Honored Contributor

Re: Script archive log transfer to standby db

you have few options here.

1 you have remsh/rlogin enabled for the user. (Not secure)
2 ftp.(not so secure)
ftp -in hostname << EOF
user username password
bin
cd /dir_you want
put file_you_want
close
EOF

Put this in script and run it at the time you want.

3 Scp - secure copy. a part of ssh.
There is no substitute to HARDWORK
Ian Dennison_1
Honored Contributor

Re: Script archive log transfer to standby db

John,

I did this last year at my old employer.

Basic Steps to follow,...

Check if another copy of this script is already running
Check if any logs to transfer (keep a record of the last log transferred)

Check if connection to remote server is available

Build list of files to transfer

For each file to transfer
Compress and relocate (ftp, rcp, or ssh)
Check File arrived at remote site
Update record of last log transferred
end loop

At the standby server end, you are going to have to ensure that the logs you apply are in sequence and alerts if anything if wrong.

Share and Enjoy! Ian
Building a dumber user
Christian Gebhardt
Honored Contributor

Re: Script archive log transfer to standby db

Hi

4. you can use nfs, it's easy to script, you only need the copy-command, maybe a little bit slow.

5. Do you have EMC? There's a software from EMC called timefinder to split VG's and mount them on other hosts, very quick and expensive.

Chris
Yogeeraj_1
Honored Contributor

Re: Script archive log transfer to standby db

Hi,

If Oracle is not archiving logs automatically to the standby site, then manually transfer the logs to the desired location on the standby host using an appropriate operating system utility for transferring binary data. For example, enter:

Using NFS:

% cp /oracle/arc_dest/*.arc /standby/arc_dest


Or Remote command:
% rcp remote_server:/oracle/arc_dest/*.arc /standby/arc_dest

Both assuming you have a high speed LAN interconnecting the servers. (otherwise, you may have to use compression/decompression techniques to reduce the size of the files for faster transmission.

After you have transferred the log files, you would issue a RECOVER statement to place the standby database in manual recovery mode.

For example, execute one of the following statements:

RECOVER STANDBY DATABASE # uses location for logs specified in
# initialization parameter file
RECOVER FROM '/logs' STANDBY DATABASE # specifies nondefault location


Note that: As Oracle generates archived redo logs, you must continually transfer and apply them to the standby database to keep it current.

Hope this helps!
Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
John Flanagan
Regular Advisor

Re: Script archive log transfer to standby db

Thanks everybody, but the bit I need help on is how to compare the 2 directories and copy across only the new files.

John
James R. Ferguson
Acclaimed Contributor

Re: Script archive log transfer to standby db

Hi John:

To compare two directories, you can use 'dircmp(1)'. Have a look at its man pages.

Regards!

...JRF...
Ian Dennison_1
Honored Contributor

Re: Script archive log transfer to standby db

John,

If you keep a record of the last Redo Log 'shipped' to the remote site by your script, and perform an 'll -lt *.dbf |head -n 2' on your local archive directory, this will give you the information you require.

Note: My version of this also detected the last Archive Log applied by the Standby Database ('archive log list' in svrmgrl), and confirmed the sequential number for the Redo Logs (in case the Redo Log Archiving Tools you use delete the Redo Log before you can ship it to the Remote site).

Share and Enjoy! Ian
Building a dumber user
Ralph Grothe
Honored Contributor

Re: Script archive log transfer to standby db

If you want to avoid redundant file transfers you might consider rsync

see:

http://hpux.asknet.de/hppd/hpux/Networking/Admin/rsync-2.5.5/
Madness, thy name is system administration
John Flanagan
Regular Advisor

Re: Script archive log transfer to standby db

resync sounds nice but it seems to only be available on 11. I am still using 10.20. I am creating a script to try to solve the problem.

John.