- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: preserve oracle 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
03-09-2006 10:35 AM
03-09-2006 10:35 AM
preserve oracle logs
The requirements are that once oracle creates a file, no one other than root be allowed to change or remove the files. Root is to copy the files elsewhere, then remove the originals.
What are some approaches to meeting these requirements?
- John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 11:22 AM
03-09-2006 11:22 AM
Re: preserve oracle logs
I don't know of a way to have the event triggered (maybe there is a way of putting a trigger on a system table...) but if they could give you a guideline of how long can a file be there before it must be moved, and then have your backup interval tighter than that...
Let's say you don't go the RMAN route, and decide to do it "by hand". Keep in mind that if you write some sort of a script that watches the directory to see if new files show up, you'll have to make sure that the file is finished being written to before trying to pick it up and move it. How would you know that it's finished?
A) You could wait until it is the "standard size" of the archive log files. Bzzzt wrong - archive log files can often be smaller than their standard size. Checkpoints, switchlogs, shutdowns, etc. can alter the standard size dramatically.
B) You could wait until another file shows up and assume that the prior file is finished. Bzzzt, that's not necessarily true either. At peak loads, you could be writing multiple of them at a time, finishing some later files before the first ones are done. It's rare (and indicates you need to do some archive log tuning), but possible, I've seen it myself.
C) You could wait until 20 files are written and assume that the last ones are finished. That's probably true, but BZZZT, that violates what you're trying to do - you can't leave 20 files out there w/o tending to them.
D) You could write a script to query from oracle what archive log files are out there, and whether or not they finished with, and have the result of this be used to create a UNIX script that something else can come along and run to move it out. I've done something similar to this (before RMAN), but the best precision you can get is 1 minute from cron, and even then, that's if you don't have files to copy. If you're already copying files, and plenty more files show up while copying... then that puts you behind.
E) Or, hey - I just thought of this - but when an archive file is completed being shifted out to disk - it's written in the Oracle database alert log.
You could write a program to watch that alert log, and if you see:
ARC1: Beginning to archive log 4 thread 1 sequence 32340
Creating archive destination LOG_ARCHIVE_DEST: '/path/to/arch/logs/filename.log'
Then you know a write started,
and keep in looking in the file for:
ARC1: Completed archiving log 4 thread 1 sequence 32340
When you see a sequence with the same number do a "Begin" and then a "Completed" entry in the alert log, you can go ahead with your copy/move/protect operation.
Those are some ideas to think about, but the critical question becomes how long of a period do you have to get those files moved out? The answer to that question tells you something of your approach and methodology.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 11:24 AM
03-09-2006 11:24 AM
Re: preserve oracle logs
There are a number of approaches here. One way is to start a script that queries the directory with a 'ls -t'. This builds you a list of the directroy in the order of most recently modified first; to least recently modified last.
Now, by skipping the first (most recent) log with 'head' or 'awk' you have the list of files that are *not* currently in-use by oracle and can be moved elsewhere.
The root user has infinite privilege, so if you script runs as root, you can otherwise restrict the query of the directory to Oracle and/or its group.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 11:40 AM
03-09-2006 11:40 AM
Re: preserve oracle logs
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1007790
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 11:56 AM
03-09-2006 11:56 AM
Re: preserve oracle logs
Sorry, I suppose I should have mentioned these are not archive logs. They're some other kind of log. I don't know how to describe them. I don't know oracle very well ( well, don't know much about it at all, never needed to, yet.) And DBA has left for the day. He explained, but I didn't understand and /or retain it very well. Also, I asked DBA if there was a way to hook into whatever mechanism oracle is using to trigger creation of these files to add the ability to trigger another process, and he says no.
Thanks John for extensive comments regarding ensuring that the files are done being written before I try to mess with them. I had been wondering exactly about those issues.
Possibly the creation of these logs is also noted in the alert log, and I will be able to use your ( John's) suggetion E approach.
- John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 12:16 PM
03-09-2006 12:16 PM
Re: preserve oracle logs
The location where the alert log and trace files are written to is controlled by the init
The alert log and trace files can be copied/moved at any time without affecting Oracle's operation. Delete the current alert log, and Oracle will just start a new file.
If these are still not the logs you're referring to, then some application process must be generating them, and you can use any method you like to move them without affecting the operation of the database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 12:23 PM
03-09-2006 12:23 PM
Re: preserve oracle logs
They contain info like this:
Thu Mar 9 16:32:00 2006
ACTION : 'd (+) = lo.object_id
and s.sid = hl.sid
and rtrim(hu.user_id (+)) = upper(rtrim(s.osuser))'
DATABASE USER: '/'
PRIVILEGE : SYSDBA
CLIENT USER: oracle
CLIENT TERMINAL:
STATUS: 0
Thu Mar 9 16:32:05 2006
ACTION : 'select 'exit'||chr(13)||chr(10) from dual'
DATABASE USER: '/'
PRIVILEGE : SYSDBA
CLIENT USER: oracle
CLIENT TERMINAL:
STATUS: 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 12:27 PM
03-09-2006 12:27 PM
Re: preserve oracle logs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 12:33 PM
03-09-2006 12:33 PM
Re: preserve oracle logs
( similar requirements for archive and alert logs will probably come dribbling down to my level eventually as well... )
- John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2006 12:33 PM
03-09-2006 12:33 PM
Re: preserve oracle logs
As long as once a file is closed it isn't modifed further (or isn't modified in parallel) after a succeeding file is opened, then the approach I first suggested should be applicable.
You can always add an additional check with 'fuser' to make sure that you don't have any processes associated with a file before you move (or copy) it.
Regards!
...JRF...