0

After a power outage, where everything went down, all SharePoint databases have Recovery Pending status. It was a relatively fresh install and no backups have been made yet (don't shoot me, I'll do it myself).

When I try to open them I get not accessible like this one https://dba.stackexchange.com/questions/21817/sql-server-2008-the-database-dbname-is-not-accessible But the permissions had been fine until the outage, so I do not think it could be that. Currently I cannot assign permissions for the non-accessible databases, because they throw not-accessible error.

I tried restarting everything from the scratch, making sure that storage, witness disk, etc. were available before SQL service kicked in - same issue.

All non-SharePoint databases on that SQL are just fine, working, responding and fully available.
SQL 2014, clustered. SP 2016.
Please advise.

2 Answers 2

0

We had a similar situation with SharePoint DBs on a volume that ran out of drive space. After expanding the volume (something you don't need to do)...

Opened SQL Server Management Studio, right-clicked each DB, select “all tasks” “Take offline. Then “Bring Online”.

The databases mounted, with "Recovery Pending" message gone.

0

You won't be able to access the databases until the recovery process has completed.

You may be able to bring them back online with recovery like so:

RESTORE DATABASE YourDatabase WITH RECOVERY

During the recovery process, you can check the status/progress like so (from this article, for reference:

DECLARE @DBName VARCHAR(64) = 'databasename'

DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX))

INSERT INTO @ErrorLog
EXEC master..sp_readerrorlog 0, 1, 'Recovery of database', @DBName

SELECT TOP 5
     [LogDate]
    ,SUBSTRING([TEXT], CHARINDEX(') is ', [TEXT]) + 4,CHARINDEX(' complete (', [TEXT]) - CHARINDEX(') is ', [TEXT]) - 4) AS PercentComplete
    ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0 AS MinutesRemaining
    ,CAST(SUBSTRING([TEXT], CHARINDEX('approximately', [TEXT]) + 13,CHARINDEX(' seconds remain', [TEXT]) - CHARINDEX('approximately', [TEXT]) - 13) AS FLOAT)/60.0/60.0 AS HoursRemaining
    ,[TEXT]

FROM @ErrorLog ORDER BY [LogDate] DESC

Once the process has completed, assuming no corruption, the databases should once again be accessible. If they aren't, you may want to investigate for corruption and/or other errors like so:

DBCC CHECKDB (‘YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .