ALTER DATABASE (optimization job)

From: Julie (anonymous_at_discussions.microsoft.com)
Date: 05/21/04


Date: Fri, 21 May 2004 03:47:21 -0700

Dear Dimitris,

This is one of the performance vr's cost issues that as a
DBA, makes your life fun. Firstly your plan will work (but
put in a shrinkdb in there after the backup on simple, but
the question is here is it worth it performance wise.

If you consider that the log file may grow over 17gb,
shrinking down to a couple hundred will really impact
perforance next time the re-indexing is run. The reason is
that as the log file grows it will attempt to get disk
space which will really slow your job down.

J

>-----Original Message-----
>Hi all
>
>I have a database (warehouse) with a data file 16GB with
Recovery model FULL
>
>And each week I do a night run for optimization with the
options "Reorganize
>data and index pages" and "Change free space per page
percentage to 10%"
>
>When this night run occurs, the transaction log on my
database increases to
>17GB
>
>cause to recreation of indexes and so on.
>
>I was wondering about the following, so I could solve the
problem of 17GB
>transaction logs. The disks are not cheap in an external
sub-system with
>mirrors and stripes.
>
>1) Before the optimization job start backup the database
>
>2) After the backup change the database recovery model to
simple (so no log
>will be recorded
>
>3) Backup again database (now on simple mode) so
transaction log will be
>shrink
>
>4) Run the optimization job
>
>5) Change the database recovery model back to FULL
>
>6) Backup again database (now in FULL mode)
>
>
>
>That's the solution I have thought.and all that will be
done by the night
>run
>
>
>
>How dangerous is to change the recovery model of the
database before you run
>a job?? Is the risk high??
>
>
>
>Is there an other way to perform the task, without having
my transaction log
>increased so match?
>
>
>
>Thanks in advance
>
>
>
>Dimitris Dimolas
>
>Web Programmer
>
>Greece
>
>
>.
>



Relevant Pages

  • What is the best practice to create Maintenance Plans
    ... There is not a definitive answer to the question of which backup is better. ... the database can be recovered to the point ... Full Recovery or Bulk-Logged Recovery model. ... Transaction Log backup for master database is not allowed. ...
    (microsoft.public.sqlserver.security)
  • Re: Large Transaction Log Backup after Database Backup
    ... script and see for yourself that the database backup doesn't truncate the ... ALTER DATABASE steve SET RECOVERY FULL ... But my understanding was that the transaction log was> truncated after a full database backup. ...
    (microsoft.public.sqlserver.server)
  • Re: Transaction Log Size
    ... Backup database does not empty the transaction log files. ... How to Shrink the SQL Server 7.0 Transaction Log ...
    (microsoft.public.sqlserver.server)
  • Disaster Averted?
    ... Some process, unknown at this point, flooded a transaction log to the point ... the .mdf file was 0 bytes according to EM. ... Following the backup, I ... the database was now Suspect! ...
    (microsoft.public.sqlserver.server)
  • Re: Backup / restore question
    ... You can do this only if your OLD database is in "FULL" recovery model. ... In the new server Load the full database backup with NORECOVERY ... Perform a transaction log backup in Old Server. ...
    (microsoft.public.sqlserver.security)