— SELECT name, log_reuse_wait_desc FROM sys.databases



Displays information about the oldest active transaction and the oldest distributed and nondistributed replicated transactions, if any, within the specified database.

Results are displayed only if there is an active transaction or if the database contains replication information.

An informational message is displayed if there are no active transactions.

— dbcc opentran;

Virtual log files in the log file

–dbcc loginfo

Fix is:

BACKUP LOG dbname TO DISK=’backup_path’ (or CHECKPOINT if recovery model is Simple)

DBCC SHRINKFILE (log_logical_file, 1);

ALTER DATABASE dbname MODIFY FILE (NAME=log_logical_file, SIZE=new_size);

–SELECT sdb.Name AS DatabaseName,

–COALESCE(CONVERT(VARCHAR(12), MAX(bus.backup_finish_date), 101),’-‘) AS LastBackUpTime

–FROM sys.sysdatabases sdb

–LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.name

–GROUP BY sdb.Name

–SELECT B.name as Database_Name, ISNULL(STR(ABS(DATEDIFF(day, GetDate(),

–MAX(Backup_finish_date)))), ‘NEVER’) as DaysSinceLastBackup,

–ISNULL(Convert(char(10), MAX(backup_finish_date), 101), ‘NEVER’) as LastBackupDate

–FROM master.dbo.sysdatabases B LEFT OUTER JOIN msdb.dbo.backupset A

–ON A.database_name = B.name AND A.type = ‘L’ GROUP BY B.Name Osdatabases;RDER BY B.name

SELECT B.name as Database_Name, A.type, backup_start_date, backup_finish_date

FROM master.dbo.sysdatabases B LEFT OUTER JOIN msdb.dbo.backupset A

ON A.database_name = B.name

–and a.database_name = ‘Auditworks’

–AND A.type = ‘D’

order by backup_start_date desc

–select * from msdb.dbo.backups