|
|
|
|
|
Re: Help about Log file Oracle [message #621688 is a reply to message #621629] |
Sat, 16 August 2014 08:07   |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
numbood wrote on Fri, 15 August 2014 02:58Anyone help me:
In Oracle have logfile when i update, delete data.. in to db or not?
if answer is yes so where is it?
Sorry for my poor english level.
I presume you are talking about an equivelent to MSSQL log file.
Of course Oracle has a transaction logging mechanism. Without such a mechanism, it would be impossible to recover a database. Every real database product has that mechanism in some form or another, but they all vary in the details.
Computers fundamental principal: All changes must happen first in memory.
In oracle this means any change to any data (creation of a new row, modifying an existing row, marking a row for deletion) happens in a data buffer, at the level of a data block.
Oracle then writes information about that changed data block to an online redo log (file), along with information to identify the block in space (disk file location) and time (the database sequence in which the change happened).
Online redo logs are pre-allocated and fixed in size. Ideally, they are multiplexed into log file groups. There must be a minimum of two log file groups, with a minimum of one file each.
When the log group is filled, oracle performs a log switch and begins writing the changes to the next log group. Then the next, then the next. When the last log group is filled, it will simply come back to the first and start over-writing the data that was in it, and continue like this, filling each log file group in sequence in round-robin fashion.
To preserve the change data that would be overwritten a database can (and should be, at least for production data) placed in archivelog mode. When configured thus, when a log group is filled and log writing switches to the next group, the another process will start making a copy of the just-filled group to a file known as an archivelog file. This file is uniquely named so there is no overwriting of the archivelogs. The collection of archivelog files present an unbroken chain of all changes to the database and is a key part of any database recovery operation.
I've left out a lot of details, but that should give you enough of an overview to start digging into the details in the docs at docs.oracle.com. Your key reference should be the Concepts Manual.
|
|
|
Re: Help about Log file Oracle [message #621693 is a reply to message #621629] |
Sat, 16 August 2014 09:49   |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
numbood wrote on Fri, 15 August 2014 13:28
In Oracle have logfile when i update, delete data.. in to db or not
It would be good if you provide more information about your requirement.
I would step back and here is my thought, if you have a table for which you need to log the changes done through DML transactions, and assuming the tables are not a part of batch process(too frequent insert/update/delete). You can have user defined audit table to log the details of the DML changes via trigger, else it would slow down the process.
For example, if I have a table employee, and I want to log the changes about the employees. If the employee details are not updated much frequently, I would have an audit table to insert the old records into the audit table depending on the DML transaction.
So, would you please provide more information about your requirement.
|
|
|
|
Re: Help about Log file Oracle [message #621708 is a reply to message #621706] |
Sat, 16 August 2014 11:24  |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Michel,
I agree, and I don't deny to what has been provided in the thread. I want to know from OP about his requirement in detail. I tried to explain OP about a small requirement regarding logging DML details against a table. If he is content with any of our solutions, then our job is done.
|
|
|