Database Availability State Statuses
The possible values in the State and State_Desc columns of sys.databases are: 0 = ONLINE 1 = RESTORING 2 = RECOVERING 3 =…
Read MoreThe possible values in the State and State_Desc columns of sys.databases are: 0 = ONLINE 1 = RESTORING 2 = RECOVERING 3 =…
Read MoreReading the SQL Server Log file – and undocumented command
1 2 3 4 5 6 7 8 9 10 11 12 |
SELECT [Current LSN], [Operation], [Transaction ID], [Parent Transaction ID], [Begin Time], [Transaction Name], [Transaction SID], [Lock Information], [Description] FROM fn_dblog(NULL, NULL) WHERE [Operation] IN ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT', 'LOP_MODIFY_ROW', 'LOP_DELETE_ROWS', 'LOB_INSERT_ROWS') |
to get all the column, execute this:
1 2 3 |
SELECT TOP 100 * FROM fn_dblog(NULL, NULL) ORDER BY [Current LSN] DESC |
Here is a blog…
Read MoreHere is what to do when the tempDB log file runs out of space. You will not be able to run any sp_Who*…
Read More* Checkpoints commit all dirty pages to disk. Therefore the very last checkpoint is the true starting point for SQL Server to start…
Read MoreHere are a few SQL commands that you can use if you simply want to delete a database that is in “Recovering” or…
Read MoreHere is the SQL to display the last LSN applied to the database (think log-shipping)
1 2 3 4 5 |
SELECT redo_start_lsn FROM sys.master_files WHERE database_id = DB_ID('SecondaryDatabaseName') AND type = 0 |
Views – 2850
Read MoreSQL Server 2012 Posted from TechNet The Transact-SQL programming language provides DBCC statements that act as Database Console Commands for SQL Server. Database…
Read MoreHere is a short script to quickly shrink your log file if you DO NOT NEED to ever recover the database before the…
Read More