Thursday, March 29, 2012
dbcc shrinkfile
one of them removed.
After running the following set of commands successfully...
backup log db_tdadatamart with truncate_only
dbcc shrinkfile ('datamartLog', EMPTYFILE)
...when I try to remove the second file using this
command...
alter database db_datamart
remove file datamartLog
...I get this error:
The file 'datamartLog' cannot be removed because it is not
empty.
Thanks in advance for your help.Run DBCC OPENTRAN to ensure there are no open transactions. And you might
want to make sure you have adone a log backup after that command as well.
--
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
> I have a DB with two transaction log files. I'd like have
> one of them removed.
> After running the following set of commands successfully...
> backup log db_tdadatamart with truncate_only
> dbcc shrinkfile ('datamartLog', EMPTYFILE)
> ...when I try to remove the second file using this
> command...
> alter database db_datamart
> remove file datamartLog
> ...I get this error:
> The file 'datamartLog' cannot be removed because it is not
> empty.
> Thanks in advance for your help.|||'No active open transactions' were reported... still
encoutner the same problem.
Thanks.
>--Original Message--
>Run DBCC OPENTRAN to ensure there are no open
transactions. And you might
>want to make sure you have adone a log backup after that
command as well.
>--
>Andrew J. Kelly SQL MVP
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message
>news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
>> I have a DB with two transaction log files. I'd like
have
>> one of them removed.
>> After running the following set of commands
successfully...
>> backup log db_tdadatamart with truncate_only
>> dbcc shrinkfile ('datamartLog', EMPTYFILE)
>> ...when I try to remove the second file using this
>> command...
>> alter database db_datamart
>> remove file datamartLog
>> ...I get this error:
>> The file 'datamartLog' cannot be removed because it is
not
>> empty.
>> Thanks in advance for your help.
>
>.
>|||Did you do a Log backup? Any chance this is related?
http://support.microsoft.com/default.aspx?scid=kb;en-us;324432&Product=sql2k
--
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx.gbl...
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
> >--Original Message--
> >Run DBCC OPENTRAN to ensure there are no open
> transactions. And you might
> >want to make sure you have adone a log backup after that
> command as well.
> >
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"Rob" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
> >> I have a DB with two transaction log files. I'd like
> have
> >> one of them removed.
> >>
> >> After running the following set of commands
> successfully...
> >>
> >> backup log db_tdadatamart with truncate_only
> >> dbcc shrinkfile ('datamartLog', EMPTYFILE)
> >>
> >> ...when I try to remove the second file using this
> >> command...
> >>
> >> alter database db_datamart
> >> remove file datamartLog
> >>
> >> ...I get this error:
> >>
> >> The file 'datamartLog' cannot be removed because it is
> not
> >> empty.
> >>
> >> Thanks in advance for your help.
> >
> >
> >.
> >|||I have some information about DBCC LOGINFO etc on my article regarding shrinking of database files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx.gbl...
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
> >--Original Message--
> >Run DBCC OPENTRAN to ensure there are no open
> transactions. And you might
> >want to make sure you have adone a log backup after that
> command as well.
> >
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"Rob" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
> >> I have a DB with two transaction log files. I'd like
> have
> >> one of them removed.
> >>
> >> After running the following set of commands
> successfully...
> >>
> >> backup log db_tdadatamart with truncate_only
> >> dbcc shrinkfile ('datamartLog', EMPTYFILE)
> >>
> >> ...when I try to remove the second file using this
> >> command...
> >>
> >> alter database db_datamart
> >> remove file datamartLog
> >>
> >> ...I get this error:
> >>
> >> The file 'datamartLog' cannot be removed because it is
> not
> >> empty.
> >>
> >> Thanks in advance for your help.
> >
> >
> >.
> >sql
dbcc shrinkfile
one of them removed.
After running the following set of commands successfully...
backup log db_tdadatamart with truncate_only
dbcc shrinkfile ('datamartLog', EMPTYFILE)
...when I try to remove the second file using this
command...
alter database db_datamart
remove file datamartLog
...I get this error:
The file 'datamartLog' cannot be removed because it is not
empty.
Thanks in advance for your help.
Run DBCC OPENTRAN to ensure there are no open transactions. And you might
want to make sure you have adone a log backup after that command as well.
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
> I have a DB with two transaction log files. I'd like have
> one of them removed.
> After running the following set of commands successfully...
> backup log db_tdadatamart with truncate_only
> dbcc shrinkfile ('datamartLog', EMPTYFILE)
> ...when I try to remove the second file using this
> command...
> alter database db_datamart
> remove file datamartLog
> ...I get this error:
> The file 'datamartLog' cannot be removed because it is not
> empty.
> Thanks in advance for your help.
|||'No active open transactions' were reported... still
encoutner the same problem.
Thanks.
>--Original Message--
>Run DBCC OPENTRAN to ensure there are no open
transactions. And you might
>want to make sure you have adone a log backup after that
command as well.
>--
>Andrew J. Kelly SQL MVP
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:1df5a01c4546d$9c7f3f90$a001280a@.phx.gbl...
have[vbcol=seagreen]
successfully...[vbcol=seagreen]
not
>
>.
>
|||Did you do a Log backup? Any chance this is related?
http://support.microsoft.com/default...&Product=sql2k
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx.gbl...[vbcol=seagreen]
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
> transactions. And you might
> command as well.
> message
> have
> successfully...
> not
|||I have some information about DBCC LOGINFO etc on my article regarding shrinking of database files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx.gbl...[vbcol=seagreen]
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
> transactions. And you might
> command as well.
> message
> have
> successfully...
> not
dbcc shrinkfile
one of them removed.
After running the following set of commands successfully...
backup log db_tdadatamart with truncate_only
dbcc shrinkfile ('datamartLog', EMPTYFILE)
...when I try to remove the second file using this
command...
alter database db_datamart
remove file datamartLog
...I get this error:
The file 'datamartLog' cannot be removed because it is not
empty.
Thanks in advance for your help.Run DBCC OPENTRAN to ensure there are no open transactions. And you might
want to make sure you have adone a log backup after that command as well.
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1df5a01c4546d$9c7f3f90$a001280a@.phx
.gbl...
> I have a DB with two transaction log files. I'd like have
> one of them removed.
> After running the following set of commands successfully...
> backup log db_tdadatamart with truncate_only
> dbcc shrinkfile ('datamartLog', EMPTYFILE)
> ...when I try to remove the second file using this
> command...
> alter database db_datamart
> remove file datamartLog
> ...I get this error:
> The file 'datamartLog' cannot be removed because it is not
> empty.
> Thanks in advance for your help.|||'No active open transactions' were reported... still
encoutner the same problem.
Thanks.
>--Original Message--
>Run DBCC OPENTRAN to ensure there are no open
transactions. And you might
>want to make sure you have adone a log backup after that
command as well.
>--
>Andrew J. Kelly SQL MVP
>
>"Rob" <anonymous@.discussions.microsoft.com> wrote in
message
> news:1df5a01c4546d$9c7f3f90$a001280a@.phx
.gbl...
have[vbcol=seagreen]
successfully...[vbcol=seagreen]
not[vbcol=seagreen]
>
>.
>|||Did you do a Log backup? Any chance this is related?
http://support.microsoft.com/defaul...2&Product=sql2k
Andrew J. Kelly SQL MVP
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx
.gbl...[vbcol=seagreen]
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
>
> transactions. And you might
> command as well.
> message
> have
> successfully...
> not|||I have some information about DBCC LOGINFO etc on my article regarding shrin
king of database files:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Rob" <anonymous@.discussions.microsoft.com> wrote in message
news:1d78101c45470$65a7c2a0$a601280a@.phx
.gbl...[vbcol=seagreen]
> 'No active open transactions' were reported... still
> encoutner the same problem.
> Thanks.
>
> transactions. And you might
> command as well.
> message
> have
> successfully...
> notsql
Tuesday, March 27, 2012
DBCC Shrinkdatabase
A question related to shrinking a database. Find below details of a
database I use, extracted from sp_helpdb abd sp_spaceused commands
Database
Name : ABC
Size : 56999.44 MB
Status : select into/bulkcopy, trunc. log on chkpt
Name Size Max Size Growth Usage
----
Abc_Data 53734848 KB Unlimited 10% data only
Abc_Log 4632576 KB Unlimited 10% log only
database_name database_size unallocated space
-----
Abc 56999.44 MB 23566.41 MB
reserved data index_size unused
-- -- --
--
34235424 KB 30824144 KB 3404648 KB 6632 KB
I am looking to free up the unallocated space of 23 GB. How do I go
about doing the same ?
DBCC SHRINKDATABASE Truncateonly did not result in any freeing up of
space.
Should I try "DBCC Shrinkdatabase" ? If so,
a) Is the amount of time taken for the process related to the size of
the database ?
b) If the answer to a) is in the affirmative, how long do you think
shrinking a 56 GB database would take ?
c) Should I stop all activity on the database before doing this ?
d) Will the process lock the database in entirety for the duration of
the execution of the command ?
Thank you,
Narayanan B> a) Is the amount of time taken for the process related to the size of
> the database ?
Depends more on the level of fragmentation. Obviously, you have parts of
objects at the end of the data file, otherwise the TRUNCATEONLY option would
have been enough.
> b) If the answer to a) is in the affirmative, how long do you think
> shrinking a 56 GB database would take ?
Again, depends on the level of fragmentation.
> c) Should I stop all activity on the database before doing this ?
Would help, but not necessary.
> d) Will the process lock the database in entirety for the duration of
> the execution of the command ?
No, not the entire database.
It may sometimes be a good idea to leave the database size as is, if you
think it would grow to that size some day. This is because if the database
needs to grow dynamically, it comes with a small impact on performance. If
performance is currently an issue, you could try defragmenting individual
tables / indexes.
Peter Yeoh
http://www.yohz.com
Need smaller backup files? Try MiniSQLBackup
"narayanan" <narayanan@.mytiger.com> wrote in message
news:13949517.0406030114.52d7432d@.posting.google.com...
> Hello,
> A question related to shrinking a database. Find below details of a
> database I use, extracted from sp_helpdb abd sp_spaceused commands
> Database
> Name : ABC
> Size : 56999.44 MB
> Status : select into/bulkcopy, trunc. log on chkpt
>
> Name Size Max Size Growth Usage
> ----
> Abc_Data 53734848 KB Unlimited 10% data only
> Abc_Log 4632576 KB Unlimited 10% log only
>
> database_name database_size unallocated space
> ----
--
> Abc 56999.44 MB 23566.41 MB
>
> reserved data index_size unused
> -- -- --
> --
> 34235424 KB 30824144 KB 3404648 KB 6632 KB
>
> I am looking to free up the unallocated space of 23 GB. How do I go
> about doing the same ?
> DBCC SHRINKDATABASE Truncateonly did not result in any freeing up of
> space.
> Should I try "DBCC Shrinkdatabase" ? If so,
> a) Is the amount of time taken for the process related to the size of
> the database ?
> b) If the answer to a) is in the affirmative, how long do you think
> shrinking a 56 GB database would take ?
> c) Should I stop all activity on the database before doing this ?
> d) Will the process lock the database in entirety for the duration of
> the execution of the command ?
> Thank you,
> Narayanan B|||Also, a bit more info is found at:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Peter Yeoh" <nospam@.nospam.com> wrote in message news:eieOE4USEHA.2480@.TK2MSFTNGP10.phx.gbl...
> > a) Is the amount of time taken for the process related to the size of
> > the database ?
> Depends more on the level of fragmentation. Obviously, you have parts of
> objects at the end of the data file, otherwise the TRUNCATEONLY option would
> have been enough.
> > b) If the answer to a) is in the affirmative, how long do you think
> > shrinking a 56 GB database would take ?
> Again, depends on the level of fragmentation.
> > c) Should I stop all activity on the database before doing this ?
> Would help, but not necessary.
> > d) Will the process lock the database in entirety for the duration of
> > the execution of the command ?
> No, not the entire database.
> It may sometimes be a good idea to leave the database size as is, if you
> think it would grow to that size some day. This is because if the database
> needs to grow dynamically, it comes with a small impact on performance. If
> performance is currently an issue, you could try defragmenting individual
> tables / indexes.
>
> Peter Yeoh
> http://www.yohz.com
> Need smaller backup files? Try MiniSQLBackup
>
> "narayanan" <narayanan@.mytiger.com> wrote in message
> news:13949517.0406030114.52d7432d@.posting.google.com...
> > Hello,
> >
> > A question related to shrinking a database. Find below details of a
> > database I use, extracted from sp_helpdb abd sp_spaceused commands
> >
> > Database
> > Name : ABC
> > Size : 56999.44 MB
> > Status : select into/bulkcopy, trunc. log on chkpt
> >
> >
> > Name Size Max Size Growth Usage
> > ----
> > Abc_Data 53734848 KB Unlimited 10% data only
> > Abc_Log 4632576 KB Unlimited 10% log only
> >
> >
> > database_name database_size unallocated space
> > ----
> --
> > Abc 56999.44 MB 23566.41 MB
> >
> >
> > reserved data index_size unused
> > -- -- --
> > --
> > 34235424 KB 30824144 KB 3404648 KB 6632 KB
> >
> >
> > I am looking to free up the unallocated space of 23 GB. How do I go
> > about doing the same ?
> > DBCC SHRINKDATABASE Truncateonly did not result in any freeing up of
> > space.
> >
> > Should I try "DBCC Shrinkdatabase" ? If so,
> > a) Is the amount of time taken for the process related to the size of
> > the database ?
> > b) If the answer to a) is in the affirmative, how long do you think
> > shrinking a 56 GB database would take ?
> > c) Should I stop all activity on the database before doing this ?
> > d) Will the process lock the database in entirety for the duration of
> > the execution of the command ?
> >
> > Thank you,
> > Narayanan B
>
Sunday, March 25, 2012
DBCC SHOWCONTIG Questions
commands, we see an entry for "Logical Scan
Fragmentation", but on others we don't see that entry.
From comparing the tables I can see that a table with only
a clustered index or table with some indexes but none of
which are specified as primary key or clustered are the
ones without the logical scan frag information. Can
someone explain to me why tables with these characterists
don't also generate logical scan fragmentation
information? BOL did not help me figure that one out.
Thanks for any info.that value really only makes sense for tables with a clustered index.
Tables without a clustered index are known as "Heaps". For Heaps, I focus on
the "Scan Density" Value and make sure that it stays above 80%
Cheers,
Greg Jackson
PDX, Oregon
Sunday, March 11, 2012
dbcc inputbuffer and long commands
some elsewhere with text values that went over 64k, but dbcc
inputbuffer only seems to return 256 characters. Is there any way to
fetch longer commands?
Thanks.
Josh
On Tue, 07 Dec 2004 10:28:45 -0800, jxstern <jxstern@.nowhere.com>
wrote:
>We have some commands here that go over 2k characters, and I've seen
>some elsewhere with text values that went over 64k, but dbcc
>inputbuffer only seems to return 256 characters. Is there any way to
>fetch longer commands?
Aha, found:
http://support.microsoft.com/default...b;en-us;325607
FIX: The fn_get_sql Function Returns SQL Text for Handle in the
Sysprocesses System Table
But it doesn't seem to be very robust - seems not to find the command
in cache all the time.
At least the fn/hotfix is present on a SQL2K sp3a system, fwiw.
J.
|||jxstern wrote:
> We have some commands here that go over 2k characters, and I've seen
> some elsewhere with text values that went over 64k, but dbcc
> inputbuffer only seems to return 256 characters. Is there any way to
> fetch longer commands?
> Thanks.
> Josh
DBCC INPUTBUFFER returns an nvarchar(255)
You might be able to use fn_get_sql. See BOL for more info.
David Gugick
Imceda Software
www.imceda.com
dbcc inputbuffer and long commands
some elsewhere with text values that went over 64k, but dbcc
inputbuffer only seems to return 256 characters. Is there any way to
fetch longer commands?
Thanks.
JoshOn Tue, 07 Dec 2004 10:28:45 -0800, jxstern <jxstern@.nowhere.com>
wrote:
>We have some commands here that go over 2k characters, and I've seen
>some elsewhere with text values that went over 64k, but dbcc
>inputbuffer only seems to return 256 characters. Is there any way to
>fetch longer commands?
Aha, found:
http://support.microsoft.com/default.aspx?scid=kb;en-us;325607
FIX: The fn_get_sql Function Returns SQL Text for Handle in the
Sysprocesses System Table
But it doesn't seem to be very robust - seems not to find the command
in cache all the time.
At least the fn/hotfix is present on a SQL2K sp3a system, fwiw.
J.|||jxstern wrote:
> We have some commands here that go over 2k characters, and I've seen
> some elsewhere with text values that went over 64k, but dbcc
> inputbuffer only seems to return 256 characters. Is there any way to
> fetch longer commands?
> Thanks.
> Josh
DBCC INPUTBUFFER returns an nvarchar(255)
You might be able to use fn_get_sql. See BOL for more info.
David Gugick
Imceda Software
www.imceda.com
Friday, February 24, 2012
DBCC Daily commands
Hi,
you can read this article at http://www.sql-server-performance.com/dbcc_commands.asp,to learn more about DBCC commands and how it will help you when you are trying to optimize your SQL Servers.
You can run the DBCC commnads as a job by scheduling DBCC commands by using AT scheduler command.
Best Regards
DBCC commands stability
I have a server from which keeping clients off for maintenance is
difficult. They all have VPN connections and can be online any time
they want, and uptime as always is important.
Now I need to run dbcc shrinkdatabase, checkdb and of course
checkpoint right before backups, and when the log seems to grow. I
just tried dbcc checkdb on my home computer and apparently its really
io and CPU intensive on this dual P3. Can users be running queries and
the occasional update and insert while checkdb is doing its thing? Or
is it better to lock everyone out?
How about shrinkdatabase? Any benchmarks on the stability of these
commands while other clients are running? If tables are getting locked
during these commands, the log file will grow even if shrinkdatabase
is running...
Any commands to show which tables are locked, and by whom or what?
I just tried our 2.5GB database on my dual P3 with 256MB ram home
computer.. checkdb took 8 minutes and shrinkdb took 1.5 minutes. We've
a dualP3 server at work, IBM xSeries 232 with 1GB ram, but even 5
minutes of downtime can hurt if shrinkdb needs to be run during work
hours.
Any thoughts?"Ghazan Haider" <ghazan@.ghazan.haider.name> wrote in message
news:2f57764a.0404091155.33f4439f@.posting.google.c om...
> Hi all,
> I have a server from which keeping clients off for maintenance is
> difficult. They all have VPN connections and can be online any time
> they want, and uptime as always is important.
> Now I need to run dbcc shrinkdatabase, checkdb and of course
> checkpoint right before backups, and when the log seems to grow. I
> just tried dbcc checkdb on my home computer and apparently its really
> io and CPU intensive on this dual P3. Can users be running queries and
> the occasional update and insert while checkdb is doing its thing? Or
> is it better to lock everyone out?
> How about shrinkdatabase? Any benchmarks on the stability of these
> commands while other clients are running? If tables are getting locked
> during these commands, the log file will grow even if shrinkdatabase
> is running...
> Any commands to show which tables are locked, and by whom or what?
> I just tried our 2.5GB database on my dual P3 with 256MB ram home
> computer.. checkdb took 8 minutes and shrinkdb took 1.5 minutes. We've
> a dualP3 server at work, IBM xSeries 232 with 1GB ram, but even 5
> minutes of downtime can hurt if shrinkdb needs to be run during work
> hours.
> Any thoughts?
Yes, why should anyone contemplate running these things during
production hours when you have an automated task queue at your
disposal? Surely any realtime high volume transaction database
system has its natural cycles of usage and minimal usage?
Always move routine tasks into this window of opportunity via
automation and queuing of the task to the off-peak times.
--
Pete Brown
Winluck P/L
IT Managers & Engineers
Falls Creek
Australia
www.mountainman.com.au/software|||> Yes, why should anyone contemplate running these things during
> production hours when you have an automated task queue at your
> disposal? Surely any realtime high volume transaction database
> system has its natural cycles of usage and minimal usage?
> Always move routine tasks into this window of opportunity via
> automation and queuing of the task to the off-peak times.
The log file simply blows up at the wrongest of times, swallows all of
the 36GB disk in a matter of 12 minutes. Apparently something is
locked while some other heavy transaction or bulk upload is going on.
Some of the financial transactions are really heavy and update lots of
rows. I'd just like to have the flexibility to checkpoint and shrinkdb
the database, and know what is locked and why.|||Why do you want to shrink the database? You've said it has very heavy
usage - if you shrink it, it'll grow again. That's because it needs all the
space for regular running - this is demonstrated by your (I'm assuming) need
to shrink every so often. Why cause the extra work for no gain? You'd be far
better off not shrinking the database at all.
You can run shrink and checkdb at any time, although they can cause up to a
20% drop (observed on a test system - YMMV) in transaction throughput.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ghazan Haider" <ghazan@.ghazan.haider.name> wrote in message
news:2f57764a.0404092151.27001b80@.posting.google.c om...
> > Yes, why should anyone contemplate running these things during
> > production hours when you have an automated task queue at your
> > disposal? Surely any realtime high volume transaction database
> > system has its natural cycles of usage and minimal usage?
> > Always move routine tasks into this window of opportunity via
> > automation and queuing of the task to the off-peak times.
> The log file simply blows up at the wrongest of times, swallows all of
> the 36GB disk in a matter of 12 minutes. Apparently something is
> locked while some other heavy transaction or bulk upload is going on.
> Some of the financial transactions are really heavy and update lots of
> rows. I'd just like to have the flexibility to checkpoint and shrinkdb
> the database, and know what is locked and why.|||"Paul S Randal [MS]" <prandal@.online.microsoft.com> wrote in message news:<4078339a$1@.news.microsoft.com>...
> Why do you want to shrink the database? You've said it has very heavy
> usage - if you shrink it, it'll grow again. That's because it needs all the
> space for regular running - this is demonstrated by your (I'm assuming) need
> to shrink every so often. Why cause the extra work for no gain? You'd be far
> better off not shrinking the database at all.
> You can run shrink and checkdb at any time, although they can cause up to a
> 20% drop (observed on a test system - YMMV) in transaction throughput.
We've had the system freeze with the message transaction log full (no
more transactions or ERP system logins which inserts rows). That was
when the log file grew to several gigabytes and filled up the disk.
It'd be nice to be able to check what is locked and why, making the
logs grow. The shrink and checkdb are just an assurance after
unlocking whatever is locked, and running checkpoint to make sure
everything has been committed, so work can begin all over again. I
wouldnt need to really shrinkdb if theres a command to show the number
of uncommitted transactions in the log file, so I know everything has
been flushed.|||"Ghazan Haider" <ghazan@.ghazan.haider.name> wrote:
...[trim]...
> wouldnt need to really shrinkdb if theres a command to show the number
> of uncommitted transactions in the log file, so I know everything has
> been flushed.
Look up dbcc opentran
--
Pete Brown
Winluck P/L
IT Managers & Engineers
Falls Creek
Australia
www.mountainman.com.au/software
DBCC Commands
Hi
Can we use
DBCC CHECKIDENT ('dbo.MyTable', RESEED, 0)
Command in Stored procedure. Which executes daily.
Thanks
Sridhar K
yes u can very well do. You can create a sp and then schedule the sp though Job. else u can include the script directly in Job
what is the probelm u faced when u tried?
Madhu
|||Thanks Madhu
I'm not having any problem. But I would like to know and as per my knowledge am not sure that these statements can execute daily on DB. Somebody said we have to use it periodically in maintenance.
Thanks
Sridhar K
|||Yes there are dbcc commands which used for database maintenance. Those are generally used periodically like DBCC DBREINDEX/IndexDefrag/Checkalloc/CheckDB etc etc...
Madhu
DBCC commands
DBCC Commands
... the hindden commands), and TRACE flags?
TIA
PabloPablo,
Two copies of the same article, I believe.
http://www.mssqlcity.com/Articles/U...00UndocDBCC.htm
http://www.sql-server-performance.c...cumented_dbcc.a
sp
From 6.5 days:
http://www.winnetmag.com/Article/Ar...4186/14186.html
http://www.extremeexperts.com/sql/a...TraceFlags.aspx
Etc, etc, from Google.
Russell Fields
"PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
quote:|||Hi,
> Anyone knows of any good source of DBCC commands (not the usual ones
> ... the hindden commands), and TRACE flags?
> TIA
> Pablo
Just go to SQL Server books online and in Index type "DBCC", there you get
all the DBCC commands with explanation.
Thanks
Hari
MCDBA
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:evUydA15DHA.1636@.TK2MSFTNGP12.phx.gbl...
quote:
> Pablo,
> Two copies of the same article, I believe.
> http://www.mssqlcity.com/Articles/U...00UndocDBCC.htm
>
http://www.sql-server-performance.c...cumented_dbcc.a
quote:|||Be very careful using undocumented (and hence unsupported) DBCC commands -
> sp
> From 6.5 days:
> http://www.winnetmag.com/Article/Ar...4186/14186.html
> http://www.extremeexperts.com/sql/a...TraceFlags.aspx
> Etc, etc, from Google.
> Russell Fields
> "PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
> news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
>
many of them can damage or destroy your database if used incorrectly. They
are there for use by PSS in the field - I don't recommend experimenting with
them.
What are you trying to do?
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:evUydA15DHA.1636@.TK2MSFTNGP12.phx.gbl...
quote:
> Pablo,
> Two copies of the same article, I believe.
> http://www.mssqlcity.com/Articles/U...00UndocDBCC.htm
>
http://www.sql-server-performance.c...cumented_dbcc.a
quote:|||Paul S Randal [MS] wrote:
> sp
> From 6.5 days:
> http://www.winnetmag.com/Article/Ar...4186/14186.html
> http://www.extremeexperts.com/sql/a...TraceFlags.aspx
> Etc, etc, from Google.
> Russell Fields
> "PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
> news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
>
quote:
> Be very careful using undocumented (and hence unsupported) DBCC
> commands - many of them can damage or destroy your database if used
> incorrectly. They are there for use by PSS in the field - I don't
> recommend experimenting with them.
> What are you trying to do?
I know all that but on real situations some of them had really helped
me a lot, so being able to know more about them can help me more in the
future.
No that I'm going to live using them but you know ... they are really
useful sometimes
DBCC Commands
... the hindden commands), and TRACE flags?
TIA
PabloPablo,
Two copies of the same article, I believe.
http://www.mssqlcity.com/Articles/Undoc/SQL2000UndocDBCC.htm
http://www.sql-server-performance.com/ac_sql_server_2000_undocumented_dbcc.a
sp
From 6.5 days:
http://www.winnetmag.com/Article/ArticleID/14186/14186.html
http://www.extremeexperts.com/sql/articles/DBCCTraceFlags.aspx
Etc, etc, from Google.
Russell Fields
"PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
> Anyone knows of any good source of DBCC commands (not the usual ones
> ... the hindden commands), and TRACE flags?
> TIA
> Pablo|||Hi,
Just go to SQL Server books online and in Index type "DBCC", there you get
all the DBCC commands with explanation.
Thanks
Hari
MCDBA
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:evUydA15DHA.1636@.TK2MSFTNGP12.phx.gbl...
> Pablo,
> Two copies of the same article, I believe.
> http://www.mssqlcity.com/Articles/Undoc/SQL2000UndocDBCC.htm
>
http://www.sql-server-performance.com/ac_sql_server_2000_undocumented_dbcc.a
> sp
> From 6.5 days:
> http://www.winnetmag.com/Article/ArticleID/14186/14186.html
> http://www.extremeexperts.com/sql/articles/DBCCTraceFlags.aspx
> Etc, etc, from Google.
> Russell Fields
> "PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
> news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > Anyone knows of any good source of DBCC commands (not the usual ones
> > ... the hindden commands), and TRACE flags?
> >
> > TIA
> > Pablo
>|||Be very careful using undocumented (and hence unsupported) DBCC commands -
many of them can damage or destroy your database if used incorrectly. They
are there for use by PSS in the field - I don't recommend experimenting with
them.
What are you trying to do?
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:evUydA15DHA.1636@.TK2MSFTNGP12.phx.gbl...
> Pablo,
> Two copies of the same article, I believe.
> http://www.mssqlcity.com/Articles/Undoc/SQL2000UndocDBCC.htm
>
http://www.sql-server-performance.com/ac_sql_server_2000_undocumented_dbcc.a
> sp
> From 6.5 days:
> http://www.winnetmag.com/Article/ArticleID/14186/14186.html
> http://www.extremeexperts.com/sql/articles/DBCCTraceFlags.aspx
> Etc, etc, from Google.
> Russell Fields
> "PAblo E. Colazurdo" <rael@.singularidad.com.ar> wrote in message
> news:uVajpx05DHA.2392@.TK2MSFTNGP11.phx.gbl...
> > Anyone knows of any good source of DBCC commands (not the usual ones
> > ... the hindden commands), and TRACE flags?
> >
> > TIA
> > Pablo
>|||Paul S Randal [MS] wrote:
> Be very careful using undocumented (and hence unsupported) DBCC
> commands - many of them can damage or destroy your database if used
> incorrectly. They are there for use by PSS in the field - I don't
> recommend experimenting with them.
> What are you trying to do?
I know all that but on real situations some of them had really helped
me a lot, so being able to know more about them can help me more in the
future.
No that I'm going to live using them but you know ... they are really
useful sometimes