I restored the database from a .bak
file by running a PowerShell script. Today, when I tried to check the database with "Reports", I noticed it had been disabled. See the screenshot:
Not quite sure whether there is anything wrong with the script I used to restore the database, but here it is:
$restoredDbName = "dbx"
[string] $dbCommand = "RESTORE DATABASE [$($restoredDbName)] " +
"FROM DISK = N'$($bakFilePath)' " +
"WITH FILE = 1," +
"MOVE N'$($fileLogicalName)' TO N'$($restorePathD)\$($restoredDbName).mdf'," +
"MOVE N'$($fileLogicalName)_Log' TO N'$($restorePathD)\$($restoredDbName)_Log.ldf',"
if($bakFilename.Contains("xyz")) {
$dbCommand += "MOVE N'abc' TO N'$($restorePathD)\$($restoredDbName).ndf',"
}
$dbCommand += "NOUNLOAD, REPLACE, STATS = 1"