Saturday, February 25, 2012
checkpoint
I came across the recommendation to do checkpoint to flush a buffer pool out
when doing massive modification in small chunks under simple recovery mode.
Can someone elaborate a bit more on it? Is it reasonable? And why?
Thanks a lot in advance.
AlexAlex,
This is my understanding...
When you execute a CHECKPOINT Statement it forces SQL Server to write
all dirty pages to Disk. (Dirty pages being Data/Log Pages that have
been modified but not written to Disk). Once the Checkpoint is issued
the Transaction Log is Truncated. SQL Server marks the transaction log
at the start of the active portion i.e Where there are still active
transactions. The rest of log is discarded as all transactions have
either had commit or rollback statement issued.
To be honest I can't really see the need to do this when you are using
Simple Recovery anyway - unless space is an issue. SQL Server issues
Checkpoint commands automatically, so the Log would return to the
minimum size anyway. I think SQL Server issues Checkpoint commands
every 10 mins - I think!
Hope this helps
Barry|||thanks Barry,
That was my understanding too, I just thought maybe I was missing
something,- such recommendation couldn't emerge out of nowhere, right?
Alex
"Barry" <barry.oconnor@.singers.co.im> wrote in message
news:1138908677.612627.55190@.g43g2000cwa.googlegroups.com...
> Alex,
> This is my understanding...
> When you execute a CHECKPOINT Statement it forces SQL Server to write
> all dirty pages to Disk. (Dirty pages being Data/Log Pages that have
> been modified but not written to Disk). Once the Checkpoint is issued
> the Transaction Log is Truncated. SQL Server marks the transaction log
> at the start of the active portion i.e Where there are still active
> transactions. The rest of log is discarded as all transactions have
> either had commit or rollback statement issued.
> To be honest I can't really see the need to do this when you are using
> Simple Recovery anyway - unless space is an issue. SQL Server issues
> Checkpoint commands automatically, so the Log would return to the
> minimum size anyway. I think SQL Server issues Checkpoint commands
> every 10 mins - I think!
> Hope this helps
> Barry
>|||Well, there's no harm in forcing checkpoints in between batches. I
think the recommendation comes from the problems around long running
transactions and large data modifications.
Even in SIMPLE recovery mode the transaction log can grow very large
when there is some long running transaction (thereby preventing the
checkpoint from occurring, because the server can't flush an open
transaction) and it's making lots of changes (thereby producing many log
records). By breaking up the single big transaction into many smaller
batches, that gives the server a chance to checkpoint in between batches
thereby keeping the transaction log under control (and not locking out
other users for long periods of time).
The server will do automatic checkpoints based on a formula (it's not
just every x seconds). It's different depending on the recovery mode.
In simple recovery mode the server will do an automatic checkpoint when
the log becomes 70% full or the number of log records is more than what
SQL Server estimates it can get through in the recovery interval period
(which ever comes sooner). So it's possible that the log is not quite
full enough to do an auto checkpoint at the time you start the next
batch. In which case the log will then continue to be filled and quite
possibly have to do an autogrow operation (at which time the 70% full
mark is even bigger). So there's no harm in doing a manual checkpoint
in between batches and possible benefit.
Personally, when I have to do this kind of stuff I always do manual
checkpoints between batches (although I do it mostly on DBs in full
recovery mode that have their logs backed up pretty regularly - like
every 15 minutes for example - so it's slightly different, but the same
concept).
*mike hodgson*
http://sqlnerd.blogspot.com
AlexM wrote:
>thanks Barry,
>That was my understanding too, I just thought maybe I was missing
>something,- such recommendation couldn't emerge out of nowhere, right?
>Alex
>
>"Barry" <barry.oconnor@.singers.co.im> wrote in message
>news:1138908677.612627.55190@.g43g2000cwa.googlegroups.com...
>
>
>|||I've had some discussions with Storage engine people at MS about this. I've
had cases where forcing
a checkpoint in simple recovery with *not* long running transaction seemed t
o increate re-use of the
log. But this shouldn't happen, and the person I spoke to would consider suc
h cases a bug. The way I
interpreted it: If we can provide a repro, and provide them with that, they
will have a look at it
and "fix" it.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:%23NPOQWGKGHA.668@.TK2MSFTNGP11.p
hx.gbl...
> Well, there's no harm in forcing checkpoints in between batches. I
> think the recommendation comes from the problems around long running
> transactions and large data modifications.
> Even in SIMPLE recovery mode the transaction log can grow very large
> when there is some long running transaction (thereby preventing the
> checkpoint from occurring, because the server can't flush an open
> transaction) and it's making lots of changes (thereby producing many log
> records). By breaking up the single big transaction into many smaller
> batches, that gives the server a chance to checkpoint in between batches
> thereby keeping the transaction log under control (and not locking out
> other users for long periods of time).
> The server will do automatic checkpoints based on a formula (it's not
> just every x seconds). It's different depending on the recovery mode.
> In simple recovery mode the server will do an automatic checkpoint when
> the log becomes 70% full or the number of log records is more than what
> SQL Server estimates it can get through in the recovery interval period
> (which ever comes sooner). So it's possible that the log is not quite
> full enough to do an auto checkpoint at the time you start the next
> batch. In which case the log will then continue to be filled and quite
> possibly have to do an autogrow operation (at which time the 70% full
> mark is even bigger). So there's no harm in doing a manual checkpoint
> in between batches and possible benefit.
> Personally, when I have to do this kind of stuff I always do manual
> checkpoints between batches (although I do it mostly on DBs in full
> recovery mode that have their logs backed up pretty regularly - like
> every 15 minutes for example - so it's slightly different, but the same
> concept).
> --
> *mike hodgson*
> http://sqlnerd.blogspot.com
>
> AlexM wrote:
>
>|||TIbor, Mike - Thanks for additional comments - further info is always
helpful.
Barry|||>> Even in SIMPLE recovery mode the transaction log can grow very large when
there is some long running transaction (thereby preventing the checkpoint f
rom occurring, because the server can't flush an open transaction)<<
I'm not sure exactly what you mean saying SQL Server can't flush an open tra
nsaction. It's true that the log space can't be reused, but that has nothing
to do with checkpoint. Checkpoint happens at regular intervals, as you sugg
est, but it will write ALL dirty pages to disk, even those that are part of
an uncommitted transaction.
The log space can't be reused, so the log can grow quite large, but the chec
kpoints DO occur.
--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com
"Mike Hodgson" <e1minst3r@.gmail.com> wrote in message news:%23NPOQWGKGHA.668
@.TK2MSFTNGP11.phx.gbl...
Well, there's no harm in forcing checkpoints in between batches. I think th
e recommendation comes from the problems around long running transactions an
d large data modifications.
Even in SIMPLE recovery mode the transaction log can grow very large when th
ere is some long running transaction (thereby preventing the checkpoint from
occurring, because the server can't flush an open transaction) and it's mak
ing lots of changes (thereby producing many log records). By breaking up th
e single big transaction into many smaller batches, that gives the server a
chance to checkpoint in between batches thereby keeping the transaction log
under control (and not locking out other users for long periods of time).
The server will do automatic checkpoints based on a formula (it's not just e
very x seconds). It's different depending on the recovery mode. In simple
recovery mode the server will do an automatic checkpoint when the log become
s 70% full or the number of log records is more than what SQL Server estimat
es it can get through in the recovery interval period (which ever comes soon
er). So it's possible that the log is not quite full enough to do an auto c
heckpoint at the time you start the next batch. In which case the log will
then continue to be filled and quite possibly have to do an autogrow operati
on (at which time the 70% full mark is even bigger). So there's no harm in
doing a manual checkpoint in between batches and possible benefit.
Personally, when I have to do this kind of stuff I always do manual checkpoi
nts between batches (although I do it mostly on DBs in full recovery mode th
at have their logs backed up pretty regularly - like every 15 minutes for ex
ample - so it's slightly different, but the same concept).
mike hodgson
http://sqlnerd.blogspot.com
AlexM wrote:
thanks Barry,
That was my understanding too, I just thought maybe I was missing
something,- such recommendation couldn't emerge out of nowhere, right?
Alex
"Barry" <barry.oconnor@.singers.co.im> wrote in message
news:1138908677.612627.55190@.g43g2000cwa.googlegroups.com...
Alex,
This is my understanding...
When you execute a CHECKPOINT Statement it forces SQL Server to write
all dirty pages to Disk. (Dirty pages being Data/Log Pages that have
been modified but not written to Disk). Once the Checkpoint is issued
the Transaction Log is Truncated. SQL Server marks the transaction log
at the start of the active portion i.e Where there are still active
transactions. The rest of log is discarded as all transactions have
either had commit or rollback statement issued.
To be honest I can't really see the need to do this when you are using
Simple Recovery anyway - unless space is an issue. SQL Server issues
Checkpoint commands automatically, so the Log would return to the
minimum size anyway. I think SQL Server issues Checkpoint commands
every 10 mins - I think!
Hope this helps
Barry|||Sorry, I shouldn't have used the term "flush". My bad - mixing terminology.
I guess where I was coming from was, and it may since have changed so
I'm prepared to admit I'm wrong, in the old days (with SQL 6.5 and
earlier from memory) the simple recovery model was implemented with the
"trunc. log on checkpoint" dboption (and also depended on the value of
the "bcp/bulk insert" option too). So I was thinking that in simple
recovery mode with SQL 2000 the checkpoint truncates up to the minimum
recovery LSN, but in this case the earliest open transaction represents
the minimum recovery LSN and hence the log cannot be truncated past that
point until those open transactions are complete. (In fact, I just
found the BOL page
<http://msdn.microsoft.com/library/e...ar_da2_8y3y.asp>
that confirms the checkpoint process is responsible for truncating log
records before the MinLSN when the DB is in SIMPLE recovery mode and it
also confirms what I'm trying to say in the "Long-Running Transaction"
section.) And so, while the checkpoint still occurs and flushes all
dirty pages from memory to disk, as far as the size of the physical log
goes, the checkpoint effectively does nothing. I wasn't focused on
memory to disk operations but rather on log truncation operations.
I stand corrected in saying the checkpoint doesn't occur. My point was
that the open transaction would prevent the log from getting truncated
and therefore increased the likelihood of the log needing an autogrow
operation, but you're right (as always) - the checkpoint still occurs.
(I guess I really should have said "thereby preventing the checkpoint
from /truncating the physical log/, because the server can't /truncate
the log record associated with/ an open transaction".)
*mike hodgson*
http://sqlnerd.blogspot.com
Kalen Delaney wrote:
> large when there is some long running transaction (thereby preventing
> the checkpoint from occurring, because the server can't flush an open
> transaction)<<
> I'm not sure exactly what you mean saying SQL Server can't flush an
> open transaction. It's true that the log space can't be reused, but
> that has nothing to do with checkpoint. Checkpoint happens at regular
> intervals, as you suggest, but it will write ALL dirty pages to disk,
> even those that are part of an uncommitted transaction.
> The log space can't be reused, so the log can grow quite large, but
> the checkpoints DO occur.
> --
> HTH
> Kalen Delaney, SQL Server MVP
> www.solidqualitylearning.com <http://www.solidqualitylearning.com>
>
> "Mike Hodgson" <e1minst3r@.gmail.com <mailto:e1minst3r@.gmail.com>>
> wrote in message news:%23NPOQWGKGHA.668@.TK2MSFTNGP11.phx.gbl...
> Well, there's no harm in forcing checkpoints in between batches.
> I think the recommendation comes from the problems around long
> running transactions and large data modifications.
> Even in SIMPLE recovery mode the transaction log can grow very
> large when there is some long running transaction (thereby
> preventing the checkpoint from occurring, because the server can't
> flush an open transaction) and it's making lots of changes
> (thereby producing many log records). By breaking up the single
> big transaction into many smaller batches, that gives the server a
> chance to checkpoint in between batches thereby keeping the
> transaction log under control (and not locking out other users for
> long periods of time).
> The server will do automatic checkpoints based on a formula (it's
> not just every x seconds). It's different depending on the
> recovery mode. In simple recovery mode the server will do an
> automatic checkpoint when the log becomes 70% full or the number
> of log records is more than what SQL Server estimates it can get
> through in the recovery interval period (which ever comes
> sooner). So it's possible that the log is not quite full enough
> to do an auto checkpoint at the time you start the next batch. In
> which case the log will then continue to be filled and quite
> possibly have to do an autogrow operation (at which time the 70%
> full mark is even bigger). So there's no harm in doing a manual
> checkpoint in between batches and possible benefit.
> Personally, when I have to do this kind of stuff I always do
> manual checkpoints between batches (although I do it mostly on DBs
> in full recovery mode that have their logs backed up pretty
> regularly - like every 15 minutes for example - so it's slightly
> different, but the same concept).
> --
> *mike hodgson*
> http://sqlnerd.blogspot.com
>
> AlexM wrote:
>
Checkpoint
If i wanted to have checkpoint run more often say every 1 min, how can i
change it ? Will the setting change require a restart of SQL ?
Using SQL 2000.
Hassan
> How can i know exactly when checkpoint is occuring ?
I use SQL Server Profiler
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
Read this article "recovery interval Option" in the BOL
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>
|||You can use the checkpoint pages/sec counter in Perfmon. When it goes from 0
a checkpoint is occurring. I don't believe it requires a restart.
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>
|||DBCC TRACEON(-1, 3502) will cause SQL Server to record an entry in its
errorlog every time a checkpoint is issued.
Linchi
"Hassan" wrote:
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>
Checkpoint
If i wanted to have checkpoint run more often say every 1 min, how can i
change it ? Will the setting change require a restart of SQL ?
Using SQL 2000.Hassan
> How can i know exactly when checkpoint is occuring ?
I use SQL Server Profiler
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
Read this article "recovery interval Option" in the BOL
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>|||You can use the checkpoint pages/sec counter in Perfmon. When it goes from 0
a checkpoint is occurring. I don't believe it requires a restart.
--
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>|||DBCC TRACEON(-1, 3502) will cause SQL Server to record an entry in its
errorlog every time a checkpoint is issued.
Linchi
"Hassan" wrote:
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>
CHECKPOINT
are written to disk in the database file only at the end of the transaction
(commit/rollback) or if portion are written at each checkpoint ?
and next eventually rollback
example:
checkpoint1 checkpoint2 checkpoint3
T1 --!--!--!--commit
does data modified by T1 are partially written to disk at each checkpoint
or only when it is committed ?
In the doc i read
"A SQL Server 2000 checkpoint performs these processes in the current
database:
. Writes to the log file a record marking the start of the checkpoint.
...
Writes to disk all dirty log and data pages."
AT
--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003When you issue a COMMIT, the log buffer is flushed and this guarantees
modified data are permanently persisted. The associated data pages may or
may not have been written to disk at the time of the commit because these
are written asynchronously by worker threads, the lazy writer and the
checkpoint process. A checkpoint writes all dirty pages to disk so, in your
example, any data modified by T1 is written during each of the 3
checkpoints.
If the server were to crash immediately after the commit in your example,
SQL Server would start forward recovery from the log at checkpoint 3 until
the end of the log was reached and them rollback any uncommitted
transactions. The end result is that the data modified by T1 after the last
checkpoint would be in the database and no committed data are lost.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Alan" <t@.t.fr> wrote in message
news:3fe26d7c$0$22334$626a54ce@.news.free.fr...
> wonder if data modified in the buffer data cache
> are written to disk in the database file only at the end of the
transaction
> (commit/rollback) or if portion are written at each checkpoint ?
> and next eventually rollback
> example:
>
> checkpoint1 checkpoint2 checkpoint3
> T1 --!--!--!--commit
>
> does data modified by T1 are partially written to disk at each checkpoint
> or only when it is committed ?
>
> In the doc i read
> "A SQL Server 2000 checkpoint performs these processes in the current
> database:
> . Writes to the log file a record marking the start of the checkpoint.
> ...
> Writes to disk all dirty log and data pages."
>
> AT
>
> --
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003
>|||Alan
You also posted this in .setup, where I provided an answer, although not
quite as detailed as Dan's.
In the future, please do not post the same question to multiple groups, in
order to only have one thread of responses to follow,
and so people who see your question will know it has been aswered and won't
waste time answering it again.
One comment to Dan... you say that 'any data modified by T1 is written
during EACH of the the 3 checkpoints'. This is not true.
Once the data is written at the first checkpoint, it is no longer dirty, and
will not be written again at subsequent checkpoints. As you say,
only the dirty data is written to disk, but the process of writing to disk
during checkpoint makes that data no longer dirty.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
news:eypIt4exDHA.4060@.TK2MSFTNGP11.phx.gbl...
> When you issue a COMMIT, the log buffer is flushed and this guarantees
> modified data are permanently persisted. The associated data pages may or
> may not have been written to disk at the time of the commit because these
> are written asynchronously by worker threads, the lazy writer and the
> checkpoint process. A checkpoint writes all dirty pages to disk so, in
your
> example, any data modified by T1 is written during each of the 3
> checkpoints.
> If the server were to crash immediately after the commit in your example,
> SQL Server would start forward recovery from the log at checkpoint 3 until
> the end of the log was reached and them rollback any uncommitted
> transactions. The end result is that the data modified by T1 after the
last
> checkpoint would be in the database and no committed data are lost.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
>
> "Alan" <t@.t.fr> wrote in message
> news:3fe26d7c$0$22334$626a54ce@.news.free.fr...
> > wonder if data modified in the buffer data cache
> > are written to disk in the database file only at the end of the
> transaction
> > (commit/rollback) or if portion are written at each checkpoint ?
> > and next eventually rollback
> >
> > example:
> >
> >
> > checkpoint1 checkpoint2 checkpoint3
> >
> > T1 --!--!--!--commit
> >
> >
> >
> > does data modified by T1 are partially written to disk at each
checkpoint
> > or only when it is committed ?
> >
> >
> > In the doc i read
> > "A SQL Server 2000 checkpoint performs these processes in the current
> > database:
> > . Writes to the log file a record marking the start of the checkpoint.
> > ...
> >
> > Writes to disk all dirty log and data pages."
> >
> >
> >
> > AT
> >
> >
> >
> > --
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003
> >
> >
>|||> Once the data is written at the first checkpoint, it is no longer dirty,
and
> will not be written again at subsequent checkpoints. As you say,
> only the dirty data is written to disk, but the process of writing to disk
> during checkpoint makes that data no longer dirty.
Thanks for the clarification, Kalen. I should have made that point clearer
in my response.
--
Dan Guzman
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%239BALRfxDHA.2064@.TK2MSFTNGP10.phx.gbl...
> Alan
> You also posted this in .setup, where I provided an answer, although not
> quite as detailed as Dan's.
> In the future, please do not post the same question to multiple groups, in
> order to only have one thread of responses to follow,
> and so people who see your question will know it has been aswered and
won't
> waste time answering it again.
> One comment to Dan... you say that 'any data modified by T1 is written
> during EACH of the the 3 checkpoints'. This is not true.
> Once the data is written at the first checkpoint, it is no longer dirty,
and
> will not be written again at subsequent checkpoints. As you say,
> only the dirty data is written to disk, but the process of writing to disk
> during checkpoint makes that data no longer dirty.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> "Dan Guzman" <danguzman@.nospam-earthlink.net> wrote in message
> news:eypIt4exDHA.4060@.TK2MSFTNGP11.phx.gbl...
> > When you issue a COMMIT, the log buffer is flushed and this guarantees
> > modified data are permanently persisted. The associated data pages may
or
> > may not have been written to disk at the time of the commit because
these
> > are written asynchronously by worker threads, the lazy writer and the
> > checkpoint process. A checkpoint writes all dirty pages to disk so, in
> your
> > example, any data modified by T1 is written during each of the 3
> > checkpoints.
> >
> > If the server were to crash immediately after the commit in your
example,
> > SQL Server would start forward recovery from the log at checkpoint 3
until
> > the end of the log was reached and them rollback any uncommitted
> > transactions. The end result is that the data modified by T1 after the
> last
> > checkpoint would be in the database and no committed data are lost.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> >
> > "Alan" <t@.t.fr> wrote in message
> > news:3fe26d7c$0$22334$626a54ce@.news.free.fr...
> > > wonder if data modified in the buffer data cache
> > > are written to disk in the database file only at the end of the
> > transaction
> > > (commit/rollback) or if portion are written at each checkpoint ?
> > > and next eventually rollback
> > >
> > > example:
> > >
> > >
> > > checkpoint1 checkpoint2 checkpoint3
> > >
> > > T1 --!--!--!--commit
> > >
> > >
> > >
> > > does data modified by T1 are partially written to disk at each
> checkpoint
> > > or only when it is committed ?
> > >
> > >
> > > In the doc i read
> > > "A SQL Server 2000 checkpoint performs these processes in the current
> > > database:
> > > . Writes to the log file a record marking the start of the checkpoint.
> > > ...
> > >
> > > Writes to disk all dirty log and data pages."
> > >
> > >
> > >
> > > AT
> > >
> > >
> > >
> > > --
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003
> > >
> > >
> >
> >
>
Checkpoint
If i wanted to have checkpoint run more often say every 1 min, how can i
change it ? Will the setting change require a restart of SQL ?
Using SQL 2000.Hassan
> How can i know exactly when checkpoint is occuring ?
I use SQL Server Profiler
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
Read this article "recovery interval Option" in the BOL
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>|||You can use the checkpoint pages/sec counter in Perfmon. When it goes from 0
a checkpoint is occurring. I don't believe it requires a restart.
Andrew J. Kelly SQL MVP
"Hassan" <Hassan@.hotmail.com> wrote in message
news:Osodx%236VGHA.4960@.TK2MSFTNGP12.phx.gbl...
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>|||DBCC TRACEON(-1, 3502) will cause SQL Server to record an entry in its
errorlog every time a checkpoint is issued.
Linchi
"Hassan" wrote:
> How can i know exactly when checkpoint is occuring ?
> If i wanted to have checkpoint run more often say every 1 min, how can i
> change it ? Will the setting change require a restart of SQL ?
> Using SQL 2000.
>
>
Checklist to TroubleShoot SQl Server 2005 Connection Problem
I am trying to connect a production SQL Server 2005 which is under firewall through an Application written in ASP.Net 1.1 and I get error "SQL Server not available or Access Denied".
I am able to connect to the Server through SQL Mgr also using the same Code and Web.Config file I am able to Connect to the SErver using ASP.Net 2.0.
I am able to run the application for a SQL Server 05 which is in the same domain as of the Application Server.
My Application is not working only when I use ASP.Net 1.1 code for the Remote SQL Server 05 which is under Firewall. But for the same Server ASP.Net 2.0 works fine.
I have searched a lot for the problem and port No, DBNETLIB update is also tried.
Please let me know if anyone has came across such problem or knows the possible cause of the problem.
Sunil.
Can you post your connection string for both ASP.NET 2.0 and ASP.NET 1.1 app?|||Sure, I am using the same connection String for both versions.
In Web.config I have added the following Connection String :
<add key="CnString" value="data source=<IP of Server>;User Id=sa;password=sa;Initial Catalog =<Database>"/>
Code from aspx file :
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["CnString"]);
conn.Open();
Response.Write("Connection Opened");
conn.Close();
When the same code is written in ASP.Net 2.0 it gets executed but through Asp.Net 1.1 its throwing exception as "Sql Server does not exist or Access Denied"
|||Hi Sunil,
Is the ASP.Net 2.0 and ASP.Net 1.1 both run on the same machine? Is there more error message text available? Also, the obvious question is are you using the same IP address in both applications?
Another thing you can try is to force the app to TCP and see what happens. You can do this by prefixing the server name with "tcp:". FYI, .Net 2.0 will always try TCP first for remote connections while this isn't always the case for 1.1.
Il-Sung.
|||Hi, Thanks for the "tcp" suggestion. I will check whether it works or not.
I have two applications both having the same code which I have posted above. One is developed in VS2003 and other in VS2005.
Both these applications are using same connection string and talking to same SQL 2005 server.
Also earlier we were using SQL 2000 server which was also under Firewall but it use to work with the above mentioned Connection String very well.
About error message dont have details but error Source is System.Data.SqlClient.
I will try the "tcp" option and will get back soon.
Thanks.
Sunil.
|||Hello,
Our problem is solved. It happened because the user who shifted Databse from Sql 2000 to Sql 2005 was not DBA so direct procedure names were not working for the Database in 2k5. We gave DBO rights to the user and problem was solved.
Thanks to all of you for your time and suggestions.
Sunil.
|||Following is the checklist we have prepared to be considered if anyone came across Connection problem with Sql Server 2005.
1) Is the Database is properly shifted from SQL 2000 to SQL 2005.
While shifting the Database from SQL 2000 to SQL 2005, strictly Administrator login tote used i.e. using "sa" login only. If this is not done then the schema
definition of the underlying Tables and Procedure changes from [dbo].Tablename to [LoggedInUserName].TableName and which will give error while using the
Database Objects.
2) Get confirmed from Client whether SQL Server is in same Domain as of Application Server or Not
If Application Domain and Sql Server Domain are different in that case there are Few things to be checked/enabled on SQL Server
Check whether Server is working on Windows Authentication / Sql Authentication
Is remote access allowed for Sql Server
Is the default ports 1433/1434 are opened
Is protocols TCP/IP and Named Pipes Enabled under Sql Configuration --> Protocols
Is Sql Browser service is running
Is proper permissions are granted for the Database to be used, for the user used in connection string ( if Sql Authentication is used )
If Windows Authentication is used the ASPNETUSER must be added to Logins in SQL Server Logins and must be given proper permissions to access the Database.
Checklist for troubleshooting user connectivity problem?
It's getting posted again with a different wrapper in hopes of catching the
attention of somebody who knows connectivity.
The dilemma is this:
---
1) I rebuilt my PC a few weeks ago, reinstalling SQL Server-Developer Version in
the process.
2) An app that I've been developing is now giving me trouble when trying to open
up an ADO connection to it's SQL Server back end.
3) ODBC connections to the DB in question work fine, no problems...same User/PW
as the attempted ADO connection.
4) I can get to the DB via Query Analyzer using the same User/PW with no
problem.
5) The error message reads: "Server does not exist or access denied."
6) The DB definately exists because of items 3 & 4.
7) I think the User/PW is ok, also because of items 3 & 4.
8) The only protocol installed it TCP/IP.
9) The same connection string worked against the same DB before the rebuild. I
didn't want to post the string - thinking that it might confuse the issue by
misleading somebody into thinking there was some problem with it... but it seems
inevitable that somebody will want to see it, so here it is:
Provider=SQLOLEDB;SERVER=SAG;DATABASE=TRETS;UID=Trets;PWD=trets
Again, the string is unchanged from the time it was working. Exactly the same,
precisely the same...
10) The text of the error message is "Server does not exist or access denied."
11) If I change the "Provider=" in the connection string to "Provider=Melvyn", a
different error message pops whose verbage explicitly says the provider was not
found...so I'm guessing that the Provider=SQLOLEDB is alive and well.
---
Seems like that leaves something to do with ADO talking to the server...but
what.
Talked to the client today...to discuss a change they want made...
SO: I'm getting desperate...
Suggestons would be nice - but the main thing I'm trolling for there is some
sort of checklist for debugging connectivity problems. I'm guessing somebody
somewhere at Microsoft has developed such a thing but where?
--
PeteCresswell| 10) The text of the error message is "Server does not exist or access
denied."
--
Try this:
INF: Potential Causes of the "SQL Server Does Not Exist or Access Denied"
Error Message
http://support.microsoft.com/?id=328306
Hope this helps,
--
Eric Cárdenas
SQL Server support|||RE/
>INF: Potential Causes of the "SQL Server Does Not Exist or Access Denied"
>Error Message
>http://support.microsoft.com/?id=328306
>Hope this helps,
Thanks. It led me right to the problem.
Norton Personal Firewall...Turn it off, problem goes away. Turn it back on,
problem resurfaces. (KB article 319432)...
Now I just have to figure out how to determine the IP address and TCP/IP port
number that my SQL Server is using and config the firewall accordingly...
For now, I just disconnect from the internet and turn the firewall off.
That was a loooooong week...
--
PeteCresswell|||| >INF: Potential Causes of the "SQL Server Does Not Exist or Access
Denied"
| >Error Message
| >http://support.microsoft.com/?id=328306
| >
|
| Thanks. It led me right to the problem.
|
| Norton Personal Firewall...Turn it off, problem goes away. Turn it
back on,
| problem resurfaces. (KB article 319432)...
|
| Now I just have to figure out how to determine the IP address and TCP/IP
port
| number that my SQL Server is using and config the firewall accordingly...
|
| For now, I just disconnect from the internet and turn the firewall off.
--
Hi Pete,
You can "ping" the SQL Server machine to determine the IP address. The
default TCP port for SQL Server is 1433.
Hope this helps,
--
Eric Cárdenas
SQL Server support|||RE/
>You can "ping" the SQL Server machine to determine the IP address. The
>default TCP port for SQL Server is 1433.
Thanks. I think there's something more going on there though. Haven't really
*read* the articles yet, but the picture I get from a quick scan is that there's
some other entity out there - or at least the server looks like something else -
when the initial contact to validate the user/pw occurs.
When I tried it against the firewall, the offender was "LocalHost", with what
looks like a port number ("2323") and a TCP/IP address of 127.0.0.1.
I just have to find some time and dig into it a little more...
--
PeteCresswell