- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script archive log transfer to standby db
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 01:15 AM
тАО02-06-2003 01:15 AM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 01:29 AM
тАО02-06-2003 01:29 AM
Re: Script archive log transfer to standby db
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 01:36 AM
тАО02-06-2003 01:36 AM
Re: Script archive log transfer to standby db
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 01:39 AM
тАО02-06-2003 01:39 AM
Re: Script archive log transfer to standby db
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 03:02 AM
тАО02-06-2003 03:02 AM
Re: Script archive log transfer to standby db
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 03:22 AM
тАО02-06-2003 03:22 AM
Re: Script archive log transfer to standby db
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 03:29 AM
тАО02-06-2003 03:29 AM
Re: Script archive log transfer to standby db
To compare two directories, you can use 'dircmp(1)'. Have a look at its man pages.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 03:32 AM
тАО02-06-2003 03:32 AM
Re: Script archive log transfer to standby db
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 06:11 AM
тАО02-06-2003 06:11 AM
Re: Script archive log transfer to standby db
see:
http://hpux.asknet.de/hppd/hpux/Networking/Admin/rsync-2.5.5/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 07:08 AM
тАО02-06-2003 07:08 AM
Re: Script archive log transfer to standby db
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 07:34 AM
тАО02-06-2003 07:34 AM
Re: Script archive log transfer to standby db
John.
livelogno()
{
remsh ptihp1 'ls -t /archive/oradata/PAULIVE/*.ARC | head -n 1 | cut -c 37-46'
}
stdbylogno()
{
ls -t /archive/oradata/PAULIVE/*.ARC | head -n 1 | cut -c 37-46
}
livelogcount=`livelogno`
stdbylogcount=`stdbylogno`
filestocopy=`expr $livelogcount - $stdbylogcount`
echo $livelogcount
echo $stdbylogcount
echo $filestocopy
for arcfile in `remsh ptihp1 'ls -t /archive/oradata/PAULIVE/*.ARC' | head -n $filestocopy`
do
echo $arcfile
echo `rcp ptihp1:$arcfile $arcfile`
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 10:21 AM
тАО02-06-2003 10:21 AM
SolutionHere is the script that I wrote to do what you are talking about. It assumes that you are running with OFA standards (/var/opt/oracle/arch/
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2003 10:24 AM
тАО02-06-2003 10:24 AM
Re: Script archive log transfer to standby db
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 01:08 AM
тАО02-07-2003 01:08 AM
Re: Script archive log transfer to standby db
Thanks for the script. My one works but it is probably not the best. I now have 3 scripts 1) to swithch logs on the current system 2) copy log files 3) import log files. All work but I have no logging or error checking so all scripts posted are useful.
As you can see my scripting knowledge is basic and I have a question on your script. Take for example the copy file line
rcp ${j} ${2}:${3}
What do the {} do?
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 06:59 AM
тАО02-07-2003 06:59 AM
Re: Script archive log transfer to standby db
I am doing just what you are asking.
On the Primary Server:
I force a log switch.
I copy the archive logs to a safe directory and another directory for the standby server to pickup and write a file there is only there when there are files for the Standby server to get. Then I remove the files from the Archive Log directory.
On the Standby Server:
The scripts checks to see if there are new files get. When there is it gets them from the primary server and then copies then to a save directory and to the archive log directory. Then it tells Oracle to do the "recover standby database". Then it removes the flag from the Primary server so it will get new files ready.
There are many other things that happen in these scripts. Files are compressed; the program will not run if the primary or standby processes are already running. It checks to see what the last log# was so when the standby was updated the log# should match on both servers. Much more.
I'm using rsync, ssh, sftp and gzip. And the two servers are 1000 miles apart. Oh! 1600km
Also using Oracle 8.0.5 and HP-UX 11.0
I'm in the process of rewriting the scrip to clean it up. Would like to see it?
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 08:01 AM
тАО02-07-2003 08:01 AM
Re: Script archive log transfer to standby db
I am allways willing to learn something so I would like to see your scripts. However I am using HP-UX 10.20 and I don't think rsync is available.
Thanks,
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 01:37 PM
тАО02-07-2003 01:37 PM
Re: Script archive log transfer to standby db
ie: Run the following:
export ORACLE=temp
export ORACLE_SID=BLAH
echo ${ORACLE_SID}
echo ${ORACLE}_SID
It is a good idea to use brackets around the variable just to make sure that something doesn't get parsed that you dont want to get parsed.
I will also post the apply script.
Brian