- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Gzipping Oracle archive logs
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
Forums
Discussions
Discussions
Discussions
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
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
01-24-2001 01:22 AM
01-24-2001 01:22 AM
I'm running an Oracle database on a machine where space is a major consideration. Intermittantly huge batch loads occur on this machine & have on occasion blown away the archive logs filesystem. Currently I run a cron job (find) to gzip these archive logs every fifteen minutes if they are more than a day old. What I'd like to do is gzip every file in that area apart from the one that Oracle may currently be writing to. I could simply add a gzip * to cron but am afraid of the consequences should this clash with a file being written. I'm sure there is a fairly simple solution but I'm afraid I'm a bit slow. Can anybody suggest a good method?
Thanks
Phil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 01:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 01:50 AM
01-24-2001 01:50 AM
Re: Gzipping Oracle archive logs
I attached a script, that we usefor some time now.
I hope, it helps.
Rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 04:51 AM
01-24-2001 04:51 AM
Re: Gzipping Oracle archive logs
Here are my two cents...
1> suppose you want to gzip /ora1/*
2> use "find" with "newer" option to find those files.
You can generate the template file with
"touch -t
3> After finding those files, zipping them is simplest task.
Hope this helps...
Suhas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 08:49 AM
01-24-2001 08:49 AM
Re: Gzipping Oracle archive logs
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 09:04 AM
01-24-2001 09:04 AM
Re: Gzipping Oracle archive logs
To avoid 'gzipping' the files already zipped, you may use:
gzip `ls -t !(*.gz)| tail +2`
meaning "list all files not ending in .gz"
This works in Posix and Korn shell
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 09:09 AM
01-24-2001 09:09 AM
Re: Gzipping Oracle archive logs
gzip `ls -t /live/oraarch/*ARC | tail +2`
which is giving the same result I'd guess.
Yours does look a bit neater though.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2001 10:03 AM
01-24-2001 10:03 AM
Re: Gzipping Oracle archive logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2001 06:01 AM
01-25-2001 06:01 AM
Re: Gzipping Oracle archive logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2001 12:08 PM
01-25-2001 12:08 PM
Re: Gzipping Oracle archive logs
963580 2309305 104858624 arch_36645.log
954027 2454387 104858624 arch_36646.log
This seems to support the idea of a "full" archive log being deposited in my environment. YMMV, of course.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2001 06:37 AM
01-26-2001 06:37 AM
Re: Gzipping Oracle archive logs
This will vary due to a number of factors such as the logfile size and you do need to cater for it in your script.
What I do in my script is to check if the log is being written with the 'fuser' command. Something like:-
LOGS=$(ls arch*.log 2>/dev/null)
for LOG in ${LOGS}
do
if [[ -n $(fuser ${LOG} 2>/dev/null) ]];
then audit "Log ${LOG} is in use, ignoring..."
continue
fi
audit "compressing ${LOG}"
/usr/contrib/bin/gzip ${LOG}
# anything else you want to do to the log
done
I've just checked one of my servers and in the last three weeks, out of 523 logs being compressed, one was in use when the script was run (every 5 minutes).
Regards,
John