Home Microsoft SQL Server DigiMailing iRN Contact



You can use sp_add_log_file_recover_suspect_db to recover a suspect database which cannot be recovered because transaction log has run out of disk space. If you run out of transaction log space during recovery you will see an error 9002 in the error log. You can add a transaction log file which resides on a drive (or drive array) different from the rest of transaction log files' location. After the log file is added sp_add_log_file_recover_suspect_db resets suspect status and completes recovery. This procedure executes sys.sp_add_file_recover_suspect_db procedure in the resource database. Only members of sysadmin fixed server role are permitted to execute this procedure.


-- Name: sp_add_log_file_recover_suspect_db
-- Purpose: Adds a log file to a suspect database and runs
-- 		recovery on the database.  This SP should only be used
--		on databases that have been marked suspect due to
--		insufficient data (error 1105) or log (error 9002) space.

create procedure sys.sp_add_log_file_recover_suspect_db
	@dbName 	sysname			-- database name
	,@name		nvarchar(260)		-- logical file name
	,@filename	nvarchar(260)		-- OS file name
	,@size		nvarchar(20) 	= NULL	-- initial file size
	,@maxsize	nvarchar(20) 	= NULL	-- maximum file size
	,@filegrowth	nvarchar(20) 	= NULL	-- growth increment
	EXEC sys.sp_add_file_recover_suspect_db @dbName, 'LOG', NULL, @name, @filename, @size, @maxsize, @filegrowth

Last revision 2008RTM
See also

  sp_add_file_recover_suspect_db (Procedure)


  Query a named instance
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash