Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

679

October 11th, 2012 02:00

Database and log files

Dear Oracle experts,

I'm just curious about something and for you guys this shouldn't be a hard question, but with MS SQL you have db and transaction logs, which should be placed on 2 separate LUNs on the storage, but with Oracle I heard it's a bit different. So what are the variants here? db, transaction logs and archive logs? So what's the difference between archive logs and transacction logs? And why should I backup both? What are performance requirements for these 2 types of logs?

1 Rookie

 • 

14.3K Posts

October 16th, 2012 12:00

SQL calls it transaction logs.  Oracle calls it archived logs.  That would be simple backup perspective.  More deeper view is following. Oracle places changed into something called online redo log which is used to replay SQL statements. If your database is not in archive log mode, then this redo files gets eventually rotated and you loose point to which you can recover. This is why redo log gets archived into something that is called archive log and for that your database needs to be in archived log mode. Once redo files fill, they archive content. When doing backups, you can also execute switch before you start archive log backup. Best practice is to have datafiles, redo logs and archive logs on separate volumes.

In SQL, you have so called recovery model which similar to archive log enables you to use or not to use transaction logs (eg. simple recovery model will always produce full database backup if you try to run transaction log backup). Transaction logs also keep a track of changes and enable you as with Oracle PiT recoveries. Unlike redo log concept which can switch, transaction log continue to grow and grow and unless you run the transaction log backup, it will grow and grow.. You may expect that transaction log will be truncate it once transaction log backup is done, but it won't. Instead, the file will get new data inside (internal rotation if you want). To truncate it, you will need to run transaction log backup and shrink it from SQL. As of SQL 2005, MS does not recommend truncate to be used with backup statements. I'm not sure how this exactly is now in SQL 2012 which I heard follows logic of Exchange, but I really didn't touch it yet. In practice, I have seen people keeping SQL logs on separate partitions/disk for multiple databases (same as for datafiles), but in case you plan to use some snapshot technologies you will need to split those.

1 Rookie

 • 

5.7K Posts

October 29th, 2012 03:00

Thank you

No Events found!

Top