Database cannot be opened due to
inaccessible files or insufficient memory or disk space.
Solution:
Step1: Check the log file drive. Sql
script for this:
SELECT
D.[Name] AS [Database],
Type_desc,
Physical_name,
[Size]
FROM Sys.Master_files M, Sys.Databases D
WHERE M.Database_id=D.Database_id
Note:
Physical_name represents log and data file name and path.
Step 2: Try to
find out the driver of your Database where log file stores from above query.
Step 3: Check
the disk space in the corresponding Drive. If Disk space is low then go to step
4.
Step 4: Shrink
the log and data file. We can do it two ways
Process one:
Right click on
the database which you want to Shrink and go to the Task -> Shrink - >
Database
And click on OK
button.
Process two:
Right click on
the database which you want to Shrink and go to the Properties - > Files
And copy the
Logical Name for file type = Log
Sql query for this:
USE [DatabaseName]
DBCC SHRINKFILE('DatabaseName_Log',7)
Note: DatabaseName_Log reprents the
Logical Name
Repeat same task for file type = Data
Step 5: Restart
your data base server. For this right click on your database server and click
on restart and then click on yes button.
No comments:
Post a Comment