Recentemente precisei renomear uma base de dados e me deparei com o error 5030. Utilizando o script a seguir:
ALTER DATABASE AdventureWorks2014 MODIFY NAME = [AdventureWorks2014_Copia]
Surgiu essa mensagem:
Msg 5030, Level 16, State 2, Line 1
The database could not be exclusive locked to perform the operation.
Minha primeira pergunta: Será que tem alguma coisa errada com a minha query? Não! Então li a mensagem novamente e entendi o que estava acontecendo. Outras conexões estavam abertas na minha base, enquanto elas não fossem fechadas eu não poderia renomear, mas como eu precisava fazer isso pra ontem, alterei a base de dados para SINGLE_USER e então alterei o nome, veja abaixo como:
USE master ALTER DATABASE AdventureWorks2014 SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE AdventureWorks2014 MODIFY NAME = [AdventureWorks2014_Copia] ALTER DATABASE AdventureWorks2014_Copia SET MULTI_USER
Pronto, problema resolvido!
Port video games have actually long been a popular type of entertainment, providing exhilarating gameplay…
When it pertains to online gambling, safety needs to be a top issue for every…
There are many reasons to play no-cost online casino games in the coming year. The…
On the internet casinos have acquired tremendous appeal in recent times, offering gamers with the…
Welcome to our useful post concerning the very best casino site game! Whether you're a…
The random number generator (or RNG) is the program that generates the outcome of every…