Friday, March 30, 2012

JOBS

Hi All,
I am currently running a job that backs up a database using
the following code
BACKUP DATABASE [Leads] TO DISK = N'\\mymachine\d$\backup\leads.bak' WITH INIT , NOUNLOAD ,
NAME = N'Leads backup2', SKIP , STATS = 10, noFORMAT
this most of the time works fine but every now and again it
complete's fine but keeps the database locked open, is
there any way to fix this'
Thanks PhilWhat exactly do you mean by "Locked Open"?
--
Andrew J. Kelly SQL MVP
"Phil" <harlequintp@.blazemail.com> wrote in message
news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
> Hi All,
> I am currently running a job that backs up a database using
> the following code
> BACKUP DATABASE [Leads] TO DISK => N'\\mymachine\d$\backup\leads.bak' WITH INIT , NOUNLOAD ,
> NAME = N'Leads backup2', SKIP , STATS = 10, noFORMAT
> this most of the time works fine but every now and again it
> complete's fine but keeps the database locked open, is
> there any way to fix this'
> Thanks Phil|||Sorry I should of been a little clearer, what I mean is
although the job says that it has completed, if you look
at the locks section in the SQL Enterprise Window, you
can still see a lock on the database showing the code
featured below.
Thanks again for your help!
Phil
>--Original Message--
>What exactly do you mean by "Locked Open"?
>--
>Andrew J. Kelly SQL MVP
>
>"Phil" <harlequintp@.blazemail.com> wrote in message
>news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
>> Hi All,
>> I am currently running a job that backs up a database
using
>> the following code
>> BACKUP DATABASE [Leads] TO DISK =>> N'\\mymachine\d$\backup\leads.bak' WITH INIT ,
NOUNLOAD ,
>> NAME = N'Leads backup2', SKIP , STATS = 10,
noFORMAT
>> this most of the time works fine but every now and
again it
>> complete's fine but keeps the database locked open, is
>> there any way to fix this'
>> Thanks Phil
>
>.
>|||You have to be even clear than that<g>. What type of lock does it have?
Are these locks causing problems? It is normal for any connection to a db
to have at least a shared lock on the db. You also have to refresh EM in
order for most of the windows to show up to date information.
--
Andrew J. Kelly SQL MVP
<anonymous@.discussions.microsoft.com> wrote in message
news:0bd801c3fb1f$b4c51a40$a401280a@.phx.gbl...
> Sorry I should of been a little clearer, what I mean is
> although the job says that it has completed, if you look
> at the locks section in the SQL Enterprise Window, you
> can still see a lock on the database showing the code
> featured below.
> Thanks again for your help!
> Phil
> >--Original Message--
> >What exactly do you mean by "Locked Open"?
> >
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"Phil" <harlequintp@.blazemail.com> wrote in message
> >news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
> >> Hi All,
> >>
> >> I am currently running a job that backs up a database
> using
> >> the following code
> >>
> >> BACKUP DATABASE [Leads] TO DISK => >> N'\\mymachine\d$\backup\leads.bak' WITH INIT ,
> NOUNLOAD ,
> >> NAME = N'Leads backup2', SKIP , STATS = 10,
> noFORMAT
> >>
> >> this most of the time works fine but every now and
> again it
> >> complete's fine but keeps the database locked open, is
> >> there any way to fix this'
> >>
> >> Thanks Phil
> >
> >
> >.
> >sql

No comments:

Post a Comment