Podatkovna baza je obstala v restoring stanju

This post is also available in: English




Zadnjič mi je MS SQL baza obstala v restoring stanju in nikakor je ni bilo možno prestaviti v normalno stanje. Edino kar je pomagalo je bil restore db z vključenim recovery.

Lahko je obstalo zaradi tega, ker se je pri backup-u  uporabil način NORECOVERY. Vprimeru, da Microsoft SQL baza obstane v restoring mode, se le vpiše:

RESTORE DATABASE  Mydatabase
FROM DISK = ′Mydatabase.bak′
WITH REPLACE, RECOVERY

 

Še prej seveda priporočam narediti backup podatkovne baze. Zakaj pride do tega? Najbolj pogost vzrok je pri backup-u, kjer je potrebno preveriti, da pri full recovery mode ni označeno tole:” backup the tail of the log and leave the database in the restoring state.” Potrebno je odkljukati to možnost.

Če restore MS SQL baze z zgornjim ukazom ne pomaga, potem je potrebno uporabiti ukaz drop DB in nato ponovo ustvariti in povezati bazo.

Če še to ne pomaga, potem se zaustavi server, zbriše podatkovna baza in logi, ponovno zažene server in nato zažene restoring database.

 

Microsoft SQL Server advertisement in Shanghai
Microsoft SQL Server advertisement in Shanghai (Photo credit: Wikipedia)

Saša

Works as system engineer in Slovenian Enterprise in Microsoft environment focusing on security, deployments, SharePoint, SCCM and CheckPoint firewall. Author of successful blog about IT security, Microsoft tips & tricks, social media, internet trends.

Leave a Reply