transaction-log

Performance for RBAR vs. set-based processing with varying transactional sizes

一曲冷凌霜 提交于 2019-12-11 03:35:18
问题 It is conventional wisdom that set based processing of tables should always be preferred over RBAR - especially when the tables grow larger and/or you need to update many rows. But does that always hold? I have experienced quite a few situations - on different hardware - where set-based processing shows exponential growth in time consumption, while splitting the same workload into smaller chunks gives linear growth. I think it would be interesting either to be proven totally wrong - if I'm

View all transaction logs in SQL Server 2008

萝らか妹 提交于 2019-12-10 10:46:44
问题 The problem is this: t0: Insert is made into my database t1: Delete is executed t2: Full backup is made t3: Transaction log backup is made How can i recover the deleted record after t3 (which is now)? I want the database in a state between t0 and t1. The log level was Full. Edit: I have already run DBCC LOG(DB-Name, 3), but the log seems to be truncated. There are only 10 items although there must be thousands. 回答1: To replay log you always start from a full log, apply the differentials and

Restore SQL Server DB without transaction log

可紊 提交于 2019-12-09 07:23:12
问题 Given a SQL Server 2008 .bak file, is there a way to restore the data file only from the .bak file, without the transaction log ? The reason I'm asking is that the transaction log file size of this database is huge - exceeding the disc space I have readily available. I have no interest in the transaction log, and no interest in any uncompleted transactions. Normally I would simply shrink the log to zero, once I've restored the database. But that doesn't help when I have insufficient disc

Reverse changes from transaction log in SQL Server 2008 R2?

一曲冷凌霜 提交于 2019-12-06 16:00:03
We have a SQL Server 2008 R2 database that backs up transaction logs every now and then. Today there was a big error in the database caused at around 12am... I have transaction logs up to 8am and then 12am - 16pm - etc. My question is: can I sort of reverse-merge those transaction logs into database, so that I return to the database state at 8am? Or is my best chance to recover an older full backup and restore all transaction logs up to 8am? The first option is preferable since full backup has been performed a bit of a while ago and I am afraid to f*ck things up restoring from there and

View all transaction logs in SQL Server 2008

回眸只為那壹抹淺笑 提交于 2019-12-06 04:19:50
The problem is this: t0: Insert is made into my database t1: Delete is executed t2: Full backup is made t3: Transaction log backup is made How can i recover the deleted record after t3 (which is now)? I want the database in a state between t0 and t1. The log level was Full. Edit: I have already run DBCC LOG(DB-Name, 3), but the log seems to be truncated. There are only 10 items although there must be thousands. To replay log you always start from a full log, apply the differentials and then the log backups. The time line is always forward from the full backup, never backwards. So to get to the

SQL Server: How do I increase the size of the transaction log?

☆樱花仙子☆ 提交于 2019-12-04 05:14:04
How do I increase the size of the transaction log? Is is also possible to temporarily increase the transaction log? Let's say I have the following scenario. I have a Delete operation that's too big for the current transaction log. I wan't to: Increase the transaction log (can I detect the current size?, can I tell how large I need the transaction log to be for my operation?) (Perform my operation) Backup the transaction log Restore the size of the transaction log. Short answer: SQL 2k5/2k8 How to: Increase the Size of a Database (SQL Server Management Studio) (applies to log also), How to:

How to get the logical name of the transaction log in SQL Server 2005

孤人 提交于 2019-12-04 00:02:15
I am trying to write a T-SQL routine that shrink the transaction log file using DBCC SHRINKFILE based on the logical name of the database. The DB_NAME() function gives you the logical name of the database. Is there an equivalent one for the transaction log? If not, is there some other way to get this information? The default name for the transaction logs is <<Database Name>>_log , but I would rather not rely on this. You can use: SELECT name FROM sys.master_files WHERE database_id = db_id() AND type = 1 Log files have type = 1 for any database_id and all files for all databases can be found in

Restore SQL Server DB without transaction log

折月煮酒 提交于 2019-12-03 09:18:52
Given a SQL Server 2008 .bak file, is there a way to restore the data file only from the .bak file, without the transaction log ? The reason I'm asking is that the transaction log file size of this database is huge - exceeding the disc space I have readily available. I have no interest in the transaction log, and no interest in any uncompleted transactions. Normally I would simply shrink the log to zero, once I've restored the database. But that doesn't help when I have insufficient disc space to create the log in the first place. What I need is a way to tell SQL Server to restore only the

How Can I Manage SQL Server Log Size

走远了吗. 提交于 2019-12-03 07:03:33
问题 I'm trying to manage the size of a SQL Server 2008 log file. I have a reporting database that is loaded once a day. The Simple recovery model is the best fit as there are no transactions other than the morning load, and I can re-create those records. My goals are to have the transaction log at a fixed size, large enough that it doesn't have to allocate new space during the load. My problem is that the log keeps growing. I know that the log is supposed to be marked for re-use, but why does the

How Can I Manage SQL Server Log Size

感情迁移 提交于 2019-12-02 21:49:21
I'm trying to manage the size of a SQL Server 2008 log file. I have a reporting database that is loaded once a day. The Simple recovery model is the best fit as there are no transactions other than the morning load, and I can re-create those records. My goals are to have the transaction log at a fixed size, large enough that it doesn't have to allocate new space during the load. My problem is that the log keeps growing. I know that the log is supposed to be marked for re-use, but why does the log keep growing? The log_reuse_wait_desc shows "Nothing". I can shrink the log file to 1 MB, so I