Huge transaction log with SQL Server database in simple recovery mode
Date : March 29 2020, 07:55 AM
Hope this helps It means you once had a single transaction that lasted for so long that it forced the log to grow 410GB. The log cannot be reused if there is an active transaction since the rollback information cannot be erased. Such an example would be if someone open an SSMS query, starts a transaction, updates a record and then goes in vacation. The transaction will be active and force the log to grow until is eventually committed or rolled back. When the transaction eventually ends the used space can finally be reclaimed, leaving a huge empty log file. Another scenario is if you had about 200GB of data updated in a single transaction. The log will store the before and after images of the changes thus consuming twice the space, and it cannot be reused, again because is all one single transaction.
|
Persisting to MySQL using Spring Framework, Hibernate and JPA failed, not really persisting to the database
Tag : java , By : Hans-Inge
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The forum post Transactions are not starting saved my life. You need to update (see the question): <tx:annotation-driven mode="proxy"
transaction-manager="transactionManager" />
|
In-memory H2 database, insert scripts not persisting
Date : March 29 2020, 07:55 AM
this one helps. See Where are the Database Files Stored? in the FAQ. With the database URL you used, jdbc:h2:file:db_test, the files are stored in the current working directory. Depending on where you start your application, this is a different place, so a different database is used. I suggest to use jdbc:h2:~/db/test_db... instead.
|
rspec not seeing database changes even though not in transaction mode
Date : March 29 2020, 07:55 AM
seems to work fine Found the reason. The insert query is using a calendar table. By running the tests, this table got truncated everytime which caused the insert not to insert anything. The solution is to exclude the calendar table in the truncation like this: excluded_tables = %w[calendar]
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation, {except: keep_tables})
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction, {except: keep_tables}
FactoryGirl.reload
end
|
Transaction log is full (due to NOTHING)... but this database is in simple recovery mode
Date : March 29 2020, 07:55 AM
I hope this helps . Got it, help received from stackexchange. https://dba.stackexchange.com/questions/241172/transaction-log-is-full-due-to-nothing-but-this-database-is-in-simple-recov?noredirect=1#comment475763_241172SELECT
db.name AS [Database],
mf.name AS [File],
CASE mf.[type_desc]
WHEN 'ROWS' THEN 'Data File'
WHEN 'LOG' THEN 'Log File'
END AS [FileType],
CAST(mf.[size] AS BIGINT)*8/1024 AS [SizeMB],
CASE
WHEN mf.[max_size] = -1 THEN 'Unlimited'
WHEN mf.[max_size] = 268435456 THEN 'Unlimited'
ELSE CAST(mf.[max_size]*8/1024 AS NVARCHAR(25)) + ' MB'
END AS [MaxSize],
CASE [is_percent_growth]
WHEN 0 THEN CONVERT(VARCHAR(6), CAST(mf.growth*8/1024 AS BIGINT)) + ' MB'
WHEN 1 THEN CONVERT(VARCHAR(6), CAST(mf.growth AS BIGINT)) + '%'
END AS [GrowthIncrement]
FROM sys.databases db
LEFT JOIN sys.master_files mf ON mf.database_id = db.database_id
where mf.name like 'aspnetdb%'
ALTER DATABASE aspnetdb MODIFY FILE (
NAME = aspnetdb_log
, SIZE = 1GB
) --this fixes the problem
GO
ALTER DATABASE aspnetdb MODIFY FILE (
NAME = aspnetdb_log
, SIZE = 1025MB
, MAXSIZE = UNLIMITED
, FILEGROWTH = 10MB
) -- now we have autogrowth
GO
USE aspnetdb
DBCC SHRINKFILE(aspnetdb_log,1) --now we can shrink the DB back to a sane minimum since autogrowth is in place
GO
|