transaction-log

Where can I find the MySQL transaction log?

♀尐吖头ヾ 提交于 2019-12-02 18:20:50
Does MySQL keep a transaction log and if so where could I find it? A number of rows have mysteriously been deleted from a table and I want to try and see how and when it occurred. If you turned on - mysql can track binary log , which contains all the modifications (to be clear - it contains the queries that had changed something). But anyway, it is useless if you do not have the initial dump, which precedes the binlog turning on. Also i suppose if you made the dump and turned on binlog - you would not ask such question :-S http://dev.mysql.com/doc/refman/5.1/en/query-log.html http://dev.mysql

SQL Server 2005 Transaction Log too big

让人想犯罪 __ 提交于 2019-12-01 20:03:55
问题 I am running SQL Server 2005. My db backup scheme is: Recovery model: FULL Backup Type: Full Backup component: Database Backup set will expire: after 0 days Overwrite media: Back up to the existing media set, Append to the existing backup set The db is writing to 250GB drive (232GB actual). My _Data.mdf file is over 55GB and my _Log.ldf is over 148GB. We ran into a situation where our drive was filled today. I moved our ab_ Full.bak and ab _Log.bak files to another drive to make space - about

SQL - shrink database log file

丶灬走出姿态 提交于 2019-12-01 07:15:42
问题 I am trying to shrink my database log file. I have tried to run: USE databasename BACKUP log databasename WITH truncate_only DBCC shrinkfile (databasename_log, 1) I get the error message: Msg 155, Level 15, State 1, Line 3 'truncate_only' is not a recognized BACKUP option. Am I missing something? 回答1: SQL Server 2008 no longer allows the NO_LOG / TRUNCATE_ONLY options. To truncate your transaction log, you either have to back it up (for real) or switch the database's Recovery Model to Simple.

SQL Job having issues with transaction log

雨燕双飞 提交于 2019-12-01 01:30:59
I have a SQL job that simply executes a stored procedure. Each morning when the job attempts to run, I get the following error: The current transaction cannot be committed and cannot support operations that write to the log file. When I keep trying to restart the job, it keeps giving me that same error. However, if I just execute the store procedure without using the Job it works fine. And here's the really really tricky part. If I just run the stored procedure, cancel it, and then run the Job, the job works perfectly fine. Has anyone come across this rather unique problem or have any ideas

SQL Job having issues with transaction log

前提是你 提交于 2019-11-30 20:43:10
问题 I have a SQL job that simply executes a stored procedure. Each morning when the job attempts to run, I get the following error: The current transaction cannot be committed and cannot support operations that write to the log file. When I keep trying to restart the job, it keeps giving me that same error. However, if I just execute the store procedure without using the Job it works fine. And here's the really really tricky part. If I just run the stored procedure, cancel it, and then run the

How can I delete expired data from a huge table without having the log file grow out of control?

情到浓时终转凉″ 提交于 2019-11-30 04:28:55
问题 I have a huge table (3 billion rows), which unfortunately contains mostly expired data. I want to simply delete all of these expired rows, and keep the rest. I can execute a statement like this: delete from giganticTable where exp_date < getDate() The execution plan somehow estimates that about 400 million rows will be deleted. When executed, not only does this not finish after an hour, but the database transaction log file is also growing from 6 GB to 90 GB. Note that the database was in

DBCC SHRINKFILE on log file not reducing size even after BACKUP LOG TO DISK

自作多情 提交于 2019-11-28 13:57:44
问题 I've got a database, [My DB], that has the following info: SQL Server 2008 MDF size: 30 GB LDF size: 67 GB I wanted to shrink the log file as much as possible and so I started my quest to figure out how to do this. Caveat: I am not a DBA (or even approaching a DBA) and have been progressing by feel through this quest. First, I just went into SSMS, DB properties, Files, and edited the Initial Size (MB) value to 10. That reduced the log file to 62 GB (not exactly the 10 MB that I entered). So,

How to perform SQL Roll back from transaction logs

夙愿已清 提交于 2019-11-28 02:01:10
I have transaction log file that goes back 6 months. I need to roll back everything that happened after 5/20/2013 from a database. Can anyone please enlighten me on how to do this? First of all, copy the database MDF and LDF files. Better safe than sorry The database can be restored to a point in time in SQL Server 2008R2 , also. There's no need to create a transaction log backup first, it'll be done automatically by SQL Server. You can find more about the log-tail backup here: Tail-Log Backups Select to restore the database in the database context menu Leave Database as Source. Click Timeline

How to undo a delete operation in SQL Server 2005?

て烟熏妆下的殇ゞ 提交于 2019-11-27 07:19:51
问题 Our Test DB is suddenly missing rows. We want them back. Is there a way to sift through everything that has happened to the database today? Each SQL statement? I presume this kind of stuff is in the transaction log, but am not sure how to view it. Is there a way to undo delete operations? BTW: Yes, we do have a backup, but would prefer to find the cause of the deletion as well... 回答1: You can do this with some of Red Gate's tools, but it costs. Take a look at SQL Log Rescue. Otherwise, I'd be

How to perform SQL Roll back from transaction logs

人盡茶涼 提交于 2019-11-26 22:06:39
问题 I have transaction log file that goes back 6 months. I need to roll back everything that happened after 5/20/2013 from a database. Can anyone please enlighten me on how to do this? 回答1: First of all, copy the database MDF and LDF files. Better safe than sorry The database can be restored to a point in time in SQL Server 2008R2, also. There's no need to create a transaction log backup first, it'll be done automatically by SQL Server. You can find more about the log-tail backup here: Tail-Log