I have a SharePoint environment, but my problem is related to DB as I couldn't solve it in SharePoint ways.
I have a database that suddenly stopped working. It's appearing in SQL management studio, but without the + sign. If I right click on it to see the tasks, they're disabled.
I have full control over the server as am the one who installed SQL and Windows. Any idea how to solve this.
Best Answer
sp_readerrorlog
As pointed out already by @Shanky read the error log (ERRORLOG) by setting off the sp_readerrorlog command:
You could also use the official xp_readerrorlog procedure with the same parameters:
xp_readerrorlog is the underlying extended stored procedure for the sp_readerrorlog stored procedure which is explained here: SQL Internals : Useful Parameters for xp_readerrorlog
Read ERRORLOG directly
If you are unable to read the ERRORLOG with the stored procedures, then manually read the ERRORLOG files (ERRORLOG.*) to find any errors.
Querying Registry to find location
If you can't find the location of the ERRORLOG file, then retrieve the path from the registry:
Don't forget to replace
MSSQLSERVER
with your instance name if you are using a different instance than the default instance (...\MSSQL11.MSSQLSERVER\...).Query SQL Server directly
SQL Server itself stores some basic information about the status of the databases in
sys.databases
:You should get an output similar to the following:
Permissions
If your database
<your_DB>
is online, then you possibly don't have adequate permissions to read the database. Change your user's permissions.Once you have found more information you will possibly be able to pinpoint the issue.