Wednesday, March 28, 2012

Restore Db

Hi ,
When I perform a restore transaction log on my server , I enounter an
issue saying that my db get lock and the restore transaction failed. How can
I set to no lock the database ? It is possible ? I am using the command below
to execute my restore log process. Actually what is the "with stanby" means ?
Am I doing the right command ? Please advise.
RESTORE LOG PDDIRECTLINK FROM disk = @.FileName with standby = 'C:\LaiDBBackup\Undo\Undo_PdDirectLink.dat'
--
Travis Tan> When I perform a restore transaction log on my server , I enounter an
> issue saying that my db get lock and the restore transaction failed.
You cannot have any connections in the database when you do RESTORE. This includes the connection
from where you run the RESTORE command.
> How can
> I set to no lock the database ? It is possible ?
No, you need to make sure that there are no users in the database.
> Actually what is the "with stanby" means ?
It is documented in Books Online. Read about the RESTORE LOG command and you will find it.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Travis" <Travis@.discussions.microsoft.com> wrote in message
news:FEBA7216-7152-4605-B8B3-85C2C8C6C274@.microsoft.com...
> Hi ,
> When I perform a restore transaction log on my server , I enounter an
> issue saying that my db get lock and the restore transaction failed. How can
> I set to no lock the database ? It is possible ? I am using the command below
> to execute my restore log process. Actually what is the "with stanby" means ?
> Am I doing the right command ? Please advise.
> RESTORE LOG PDDIRECTLINK FROM disk = @.FileName with standby => 'C:\LaiDBBackup\Undo\Undo_PdDirectLink.dat'
> --
> Travis Tan|||Do
Alter database <dbname> set single_user with rollback immediate
Now Restore database.
now run
Alter database <dbname> multi_user
Regards
Amish Shahsql

No comments:

Post a Comment