Showing posts with label dbcc. Show all posts
Showing posts with label dbcc. Show all posts

Wednesday, March 28, 2012

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."
Just watch the size of the following tlog backup (read about details for bulk logged in Books
Online). Also, during time period while in bulk mode and if during that time you perform minimally
logged operations, forthcoming log backup will not have point in time restore (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE option.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does anyone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED, perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural method of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capacity for."
|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."Just watch the size of the following tlog backup (read about details for bul
k logged in Books
Online). Also, during time period while in bulk mode and if during that time
you perform minimally
logged operations, forthcoming log backup will not have point in time restor
e (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE o
ption.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl.
.
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does an
yone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED,
perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural meth
od of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capa
city for."|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

recovery model and dbcc dbreindex

Hello,
I have a log file that grows significantly during DBCC DBREINDEX. Does
anyone know of a good reason why I shouldn't switch the recovery model
from FULL to BULK_LOGGED, perform DBCC DBREINDEX and then switch back to
FULL again?
Thanks,
Craig.
--
"...how we thwart the natural love of learning by leaving the natural
method of teaching what each wishes to learn, and insisting that you
shall learn what you have no taste or capacity for."Just watch the size of the following tlog backup (read about details for bulk logged in Books
Online). Also, during time period while in bulk mode and if during that time you perform minimally
logged operations, forthcoming log backup will not have point in time restore (STOPAT). Also, if db
files crash during this same period, not backing up tlog using NO_TRUNCATE option.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Craig H." <spam@.thehurley.com> wrote in message news:ejUEgayLFHA.3296@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I have a log file that grows significantly during DBCC DBREINDEX. Does anyone know of a good
> reason why I shouldn't switch the recovery model from FULL to BULK_LOGGED, perform DBCC DBREINDEX
> and then switch back to FULL again?
> Thanks,
> Craig.
>
> --
> "...how we thwart the natural love of learning by leaving the natural method of teaching what each
> wishes to learn, and insisting that you shall learn what you have no taste or capacity for."|||On 2005-03-22 13:41, Tibor Karaszi wrote:
> Just watch the size of the following tlog backup (read about details
> for bulk logged in Books Online). Also, during time period while in
> bulk mode and if during that time you perform minimally logged
> operations, forthcoming log backup will not have point in time
> restore (STOPAT). Also, if db files crash during this same period,
> not backing up tlog using NO_TRUNCATE option.
>
So the rate at which the log file grows during DBCC DBREINDEX will
decrease and regular inserts will still be logged while the db is using
the BULK_LOGGED model... this will do fine.
Craig.
"The power of accurate observation is frequently called cynicism by
those who don't have it."

Tuesday, March 20, 2012

Recover Lost data files?

Hi
When we issue a DBCC SHRINKFILE with empty option, the data file
is removed and the space is alloted back to the OS.
Same way when we issue a an ALTER DATABASE to remove a database,
all the data files and transaction log files are dropped.
But can these files be recovered again by using any of the disk
recovery tools?

AchillesDBCC SHRINKFILE doesn't remove a data file it just removes unused space in a
file. ALTER DATABASE doesn't remove databases, although it can be used to
remove files (but only when they are empty of data). Since neither of these
statements actually removes any data from your database there isn't really
anything to recover. I doubt it would be feasible to restore a database to a
prior state using disk recovery tools and I definitely wouldn't recommend
you try as the likely result would be a corrupt database.

If you think you have lost some data for some reason then restoring from a
backup is your best course of action. But as I said, neither of the
statements you have mentioned should cause you to lose data even if you use
them in error.

Hope this helps.

--
David Portas
SQL Server MVP
--