Thursday, March 29, 2012

DB backup to another server

How do I configure SQL Server Agent and my Database Maintenance Plans to
enable sending backups to another server via UNC pathnames and restoring
from the same location? Backing up locally and copying files to the other
server doesn't make good use of the functionality of deleting backups older
than a certain number of days.
I've already created a domain admin user, shared the destination folder to
this user will full permissions, set SQL Server Agent to login under the
context of this domain admin user, but my backups still won't go to that
remote server.This is a multi-part message in MIME format.
--=_NextPart_000_0525_01C3B825.106A5290
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Have you also configured SQL Server itself to run under that domain account?
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans to
enable sending backups to another server via UNC pathnames and restoring
from the same location? Backing up locally and copying files to the other
server doesn't make good use of the functionality of deleting backups older
than a certain number of days.
I've already created a domain admin user, shared the destination folder to
this user will full permissions, set SQL Server Agent to login under the
context of this domain admin user, but my backups still won't go to that
remote server.
--=_NextPart_000_0525_01C3B825.106A5290
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Have you also configured SQL Server =itself to run under that domain account?
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the =otherserver doesn't make good use of the functionality of deleting backups =olderthan a certain number of days.I've already created a domain admin user, =shared the destination folder tothis user will full permissions, set SQL =Server Agent to login under thecontext of this domain admin user, but my =backups still won't go to thatremote server.

--=_NextPart_000_0525_01C3B825.106A5290--|||This is a multi-part message in MIME format.
--=_NextPart_000_0014_01C3B816.F2397930
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
No. Is that necessary?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message =news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain =account?
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message =news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans =to
enable sending backups to another server via UNC pathnames and =restoring
from the same location? Backing up locally and copying files to the =other
server doesn't make good use of the functionality of deleting backups =older
than a certain number of days.
I've already created a domain admin user, shared the destination =folder to
this user will full permissions, set SQL Server Agent to login under =the
context of this domain admin user, but my backups still won't go to =that
remote server.
--=_NextPart_000_0014_01C3B816.F2397930
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

No. Is that =necessary?
"Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server =itself to run under that domain account?
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the otherserver doesn't make good use of the functionality of deleting =backups olderthan a certain number of days.I've already created a =domain admin user, shared the destination folder tothis user will full permissions, set SQL Server Agent to login under thecontext of =this domain admin user, but my backups still won't go to thatremote server.

--=_NextPart_000_0014_01C3B816.F2397930--|||This is a multi-part message in MIME format.
--=_NextPart_000_0022_01C3B81B.15455940
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
That was it! You made my day. Thanks!
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message =news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain =account?
-- Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message =news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans =to
enable sending backups to another server via UNC pathnames and =restoring
from the same location? Backing up locally and copying files to the =other
server doesn't make good use of the functionality of deleting backups =older
than a certain number of days.
I've already created a domain admin user, shared the destination =folder to
this user will full permissions, set SQL Server Agent to login under =the
context of this domain admin user, but my backups still won't go to =that
remote server.
--=_NextPart_000_0022_01C3B81B.15455940
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

That was it! You made my =day. Thanks!
"Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server =itself to run under that domain account?
-- Tom

=---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql


"David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...How do I configure SQL Server Agent and my Database Maintenance Plans =toenable sending backups to another server via UNC pathnames and =restoringfrom the same location? Backing up locally and copying files to the otherserver doesn't make good use of the functionality of deleting =backups olderthan a certain number of days.I've already created a =domain admin user, shared the destination folder tothis user will full permissions, set SQL Server Agent to login under thecontext of =this domain admin user, but my backups still won't go to thatremote server.

--=_NextPart_000_0022_01C3B81B.15455940--|||I have the same problem. SQL Server runs using an NT account, this account has permissions on the backup server and while logged into the first server using this same NT account I'm able to map a drive to the backup server. But when I go through Enterprise Manager and look for this destination via the SQL Server Backup window, I don't find it. Please advise
-- David Morrison wrote: --
No. Is that necessary
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl..
Have you also configured SQL Server itself to run under that domain account
--
To
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDB
SQL Server MV
Columnist, SQL Server Professiona
Toronto, ON Canad
www.pinnaclepublishing.com/sq
"David Morrison" <me@.nospam.com> wrote in message news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl..
How do I configure SQL Server Agent and my Database Maintenance Plans t
enable sending backups to another server via UNC pathnames and restorin
from the same location? Backing up locally and copying files to the othe
server doesn't make good use of the functionality of deleting backups olde
than a certain number of days
I've already created a domain admin user, shared the destination folder t
this user will full permissions, set SQL Server Agent to login under th
context of this domain admin user, but my backups still won't go to tha
remote server|||This is a multi-part message in MIME format.
--=_NextPart_000_00AA_01C3B84F.60E51960
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
Use the full UNC name for the backup destination. You cannot map to a drive
letter.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
"Simi Rao" <anonymous@.discussions.microsoft.com> wrote in message
news:21C576AF-AB76-49E8-899D-8058242FE3F2@.microsoft.com...
I have the same problem. SQL Server runs using an NT account, this account
has permissions on the backup server and while logged into the first server
using this same NT account I'm able to map a drive to the backup server.
But when I go through Enterprise Manager and look for this destination via
the SQL Server Backup window, I don't find it. Please advise.
-- David Morrison wrote: --
No. Is that necessary?
"Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in message
news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
Have you also configured SQL Server itself to run under that domain
account?
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
How do I configure SQL Server Agent and my Database Maintenance Plans
to
enable sending backups to another server via UNC pathnames and
restoring
from the same location? Backing up locally and copying files to the
other
server doesn't make good use of the functionality of deleting backups
older
than a certain number of days.
I've already created a domain admin user, shared the destination
folder to
this user will full permissions, set SQL Server Agent to login under
the
context of this domain admin user, but my backups still won't go to
that
remote server
--=_NextPart_000_00AA_01C3B84F.60E51960
Content-Type: text/html;
charset="Utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Use the full UNC name for the backup destination. You cannot map to a drive letter.
-- Tom
----Thomas A. =Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql.
"Simi Rao" wrote in message news:21C=576AF-AB76-49E8-899D-8058242FE3F2@.microsoft.com...I have the same problem. SQL Server runs using an NT account, this =account has permissions on the backup server and while logged into the first =server using this same NT account I'm able to map a drive to the backup =server. But when I go through Enterprise Manager and look for this destination =via the SQL Server Backup window, I don't find it. Please advise. -- =David Morrison wrote: -- = No. Is that necessary? ="Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl... =Have you also configured SQL Server itself to run under that domain account? = -- Tom = --- = Thomas A. Moreau, BSc, PhD, MCSE, =MCDBA SQL Server MVP Columnist, SQL =Server Professional Toronto, ON Canada http://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql ="David Morrison" =wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl... How do I configure SQL Server Agent and my Database Maintenance Plans to enable sending backups to =another server via UNC pathnames and =restoring from the same location? Backing up locally and copying files to =the other server doesn't make good =use of the functionality of deleting backups older than a certain number of days. = I've already created a domain admin user, shared the destination folder to this user will full =permissions, set SQL Server Agent to login under =the context of this domain admin user, but my backups still won't go to that remote server

--=_NextPart_000_00AA_01C3B84F.60E51960--|||I'm having a similar problem. Does SQL Server itself have
to run under the domain account? Is this the MSSQLSERVER
service? I have the permissions on the remote folder set
for the domain admin. The SQL job for the maintenance
plan is owned by the domain admin. The SQL Agent service
is started under the domain admin. Still, the backups are
failing and the log indicates that access is denied in
creating the backup and it appears that 'sa' is invoking
the job.
>--Original Message--
>No. Is that necessary?
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in
message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
> Have you also configured SQL Server itself to run under
that domain account?
> --
> Tom
> ---
--
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
> How do I configure SQL Server Agent and my Database
Maintenance Plans to
> enable sending backups to another server via UNC
pathnames and restoring
> from the same location? Backing up locally and copying
files to the other
> server doesn't make good use of the functionality of
deleting backups older
> than a certain number of days.
> I've already created a domain admin user, shared the
destination folder to
> this user will full permissions, set SQL Server Agent
to login under the
> context of this domain admin user, but my backups still
won't go to that
> remote server.
>|||This is a multi-part message in MIME format.
--=_NextPart_000_001C_01C3C328.296D6850
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
The SQL Server service has to run under a domain account to do what you
want. That said, you should not use the domain admin account. That's way
to much authority. Create a separate account that can run as a service and
use it.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
.
<anonymous@.discussions.microsoft.com> wrote in message
news:108a01c3c33e$5b4bd170$3101280a@.phx.gbl...
I'm having a similar problem. Does SQL Server itself have
to run under the domain account? Is this the MSSQLSERVER
service? I have the permissions on the remote folder set
for the domain admin. The SQL job for the maintenance
plan is owned by the domain admin. The SQL Agent service
is started under the domain admin. Still, the backups are
failing and the log indicates that access is denied in
creating the backup and it appears that 'sa' is invoking
the job.
>--Original Message--
>No. Is that necessary?
> "Tom Moreau" <tom@.dont.spam.me.cips.ca> wrote in
message news:%23T3787EuDHA.2448@.TK2MSFTNGP12.phx.gbl...
> Have you also configured SQL Server itself to run under
that domain account?
> --
> Tom
> ---
--
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
>
> "David Morrison" <me@.nospam.com> wrote in message
news:u$XDJ5EuDHA.424@.TK2MSFTNGP11.phx.gbl...
> How do I configure SQL Server Agent and my Database
Maintenance Plans to
> enable sending backups to another server via UNC
pathnames and restoring
> from the same location? Backing up locally and copying
files to the other
> server doesn't make good use of the functionality of
deleting backups older
> than a certain number of days.
> I've already created a domain admin user, shared the
destination folder to
> this user will full permissions, set SQL Server Agent
to login under the
> context of this domain admin user, but my backups still
won't go to that
> remote server.
>
--=_NextPart_000_001C_01C3C328.296D6850
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

The SQL Server service has to run =under a domain account to do what you want. That said, you should not use the =domain admin account. That's way to much authority. Create a =separate account that can run as a service and use it.
-- Tom
----Thomas A. =Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql.
wrote in message news:108a01c3c33e$5b=4bd170$3101280a@.phx.gbl...I'm having a similar problem. Does SQL Server itself have to run =under the domain account? Is this the MSSQLSERVER service? I have the permissions on the remote folder set for the domain admin. The =SQL job for the maintenance plan is owned by the domain admin. The SQL =Agent service is started under the domain admin. Still, the backups =are failing and the log indicates that access is denied in creating =the backup and it appears that 'sa' is invoking the job.>--Original Message-->No. Is that necessary?> "Tom Moreau" = wrote in message news:%23T3787EuDHA.=2448@.TK2MSFTNGP12.phx.gbl...> Have you also configured SQL Server itself to run under that domain account?>> -- > =Tom>> -----&g=t; Thomas A. Moreau, BSc, PhD, MCSE, MCDBA> SQL Server MVP> Columnist, SQL Server Professional> =Toronto, ON Canada>http://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql>>> "David Morrison" wrote in message news:u$XDJ5EuDHA.424@.T=K2MSFTNGP11.phx.gbl...> How do I configure SQL Server Agent and my Database Maintenance =Plans to> enable sending backups to another server via UNC =pathnames and restoring> from the same location? Backing up =locally and copying files to the other> server doesn't make good =use of the functionality of deleting backups older> than a certain =number of days.>> I've already created a domain admin user, =shared the destination folder to> this user will full =permissions, set SQL Server Agent to login under the> context of this =domain admin user, but my backups still won't go to that> =remote server.>>

--=_NextPart_000_001C_01C3C328.296D6850--

DB backup to a mapped drive on another server?

In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom
See if this helps: http://vyaskn.tripod.com/administration_faq.htm#q17
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom
|||You don't need to add a dump device if you just want to backup the database
to another server.
BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
"TJT" wrote:

> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
> When i tried backing up to that device i got an error that the backup failed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>
>
|||Hello Tom,
Check the login id the SQLServer service runs as and login to the server
with that ID and try to copy a file
into that share. If you cannot copy the file then you have a
access/permission problem ... etc.
ie, Can you copy a file to this location " \RemoteServerName\e$\Backuptest\
" using the login id that SQLServer
service runs with. Try this from command prompt.
Gopi
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
> When i tried backing up to that device i got an error that the backup
> failed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>
|||All The above are correct. I will add the idea of getting backup in a dump
device with Complete, differential, transactional backups to another server.
1. Create a map network drive
2. Restart your sql server in order to see the drive
3. Create a dump device via EM (It's easier) pointing the drive
4. Create the jobs you want.
Andreas
"Jack" wrote:
[vbcol=seagreen]
> You don't need to add a dump device if you just want to backup the database
> to another server.
> BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
> "TJT" wrote:
|||Yes , follow the below steps.
There are Few Pre requisites to do backup remotely;
1. You Should start SQL server using Domain user who got access to remote machine Share
2. Should have share in the remote machine
3. If you need to schedule this as a job then SQL Agent should use the same Domain user in which SQL server was started
4. Restart the services
Now you can execute the Backup script with UNC path
BACKUP Database <dbname> to disk='\\computername\sharenameX\dbname.bak' with init
Note:
Backup to remote machine will not work if you start SQL server using Local system account
Thanks
Hari
SQL Server MVP
____________________________________
TJT Wrote:
In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom
Sent via SreeSharp NewsReader http://www.SreeSharp.com
sql

DB backup to a mapped drive on another server?

In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
TomSee if this helps: http://vyaskn.tripod.com/administration_faq.htm#q17
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom|||You don't need to add a dump device if you just want to backup the database
to another server.
BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
"TJT" wrote:
> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
> When i tried backing up to that device i got an error that the backup failed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>
>|||Hello Tom,
Check the login id the SQLServer service runs as and login to the server
with that ID and try to copy a file
into that share. If you cannot copy the file then you have a
access/permission problem ... etc.
ie, Can you copy a file to this location " \RemoteServerName\e$\Backuptest\
" using the login id that SQLServer
service runs with. Try this from command prompt.
Gopi
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
> When i tried backing up to that device i got an error that the backup
> failed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>|||All The above are correct. I will add the idea of getting backup in a dump
device with Complete, differential, transactional backups to another server.
1. Create a map network drive
2. Restart your sql server in order to see the drive
3. Create a dump device via EM (It's easier) pointing the drive
4. Create the jobs you want.
Andreas
"Jack" wrote:
> You don't need to add a dump device if you just want to backup the database
> to another server.
> BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
> "TJT" wrote:
> > In SQL 2000, is it possible to perform a DB backup where the backup is
> > written to a disk drive on a different server. Someone had mentioned that
> > this is possible using backup devices (instead of backup files).
> >
> > I tried adding a dump device with the following command:
> > sp_addumpdevice @.devtype = 'disk',
> > @.logicalname = 'SorClinTest_E',
> > @.physicalname = '\\RemoteServerName\e$\Backuptest\FromProd.ext'
> >
> > When i tried backing up to that device i got an error that the backup failed
> > (no details). I am guessing that it failed because of the remote device.
> >
> > If anyone can shed some light on this - I would appreciate it.
> >
> > Thanks,
> > Tom
> >
> >
> >

DB backup to a mapped drive on another server?

In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromPr
od.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
TomSee if this helps: http://vyaskn.tripod.com/administration_faq.htm#q17
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromPr
od.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom|||You don't need to add a dump device if you just want to backup the database
to another server.
BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
"TJT" wrote:

> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromPr
od.ext'
> When i tried backing up to that device i got an error that the backup fail
ed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>
>|||Hello Tom,
Check the login id the SQLServer service runs as and login to the server
with that ID and try to copy a file
into that share. If you cannot copy the file then you have a
access/permission problem ... etc.
ie, Can you copy a file to this location " \RemoteServerName\e$\Backuptest\
" using the login id that SQLServer
service runs with. Try this from command prompt.
Gopi
"TJT" <TJT@.nospam.com> wrote in message
news:OTIQNZTNFHA.1176@.TK2MSFTNGP12.phx.gbl...
> In SQL 2000, is it possible to perform a DB backup where the backup is
> written to a disk drive on a different server. Someone had mentioned that
> this is possible using backup devices (instead of backup files).
> I tried adding a dump device with the following command:
> sp_addumpdevice @.devtype = 'disk',
> @.logicalname = 'SorClinTest_E',
> @.physicalname = '\\RemoteServerName\e$\Backuptest\FromPr
od.ext'
> When i tried backing up to that device i got an error that the backup
> failed
> (no details). I am guessing that it failed because of the remote device.
> If anyone can shed some light on this - I would appreciate it.
> Thanks,
> Tom
>|||All The above are correct. I will add the idea of getting backup in a dump
device with Complete, differential, transactional backups to another server.
1. Create a map network drive
2. Restart your sql server in order to see the drive
3. Create a dump device via EM (It's easier) pointing the drive
4. Create the jobs you want.
Andreas
"Jack" wrote:
[vbcol=seagreen]
> You don't need to add a dump device if you just want to backup the databas
e
> to another server.
> BACKUP DATABASE dbname TO DISK = '\\server\share\filename'
> "TJT" wrote:
>|||Yes , follow the below steps.
There are Few Pre requisites to do backup remotely;
1. You Should start SQL server using Domain user who got access to remote ma
chine Share
2. Should have share in the remote machine
3. If you need to schedule this as a job then SQL Agent should use the same
Domain user in which SQL server was started
4. Restart the services
Now you can execute the Backup script with UNC path
BACKUP Database <dbname> to disk='\\computername\sharename_\dbname.bak' wit
h init
Note:
Backup to remote machine will not work if you start SQL server using Local s
ystem account
Thanks
Hari
SQL Server MVP
____________________________________
TJT Wrote:
In SQL 2000, is it possible to perform a DB backup where the backup is
written to a disk drive on a different server. Someone had mentioned that
this is possible using backup devices (instead of backup files).
I tried adding a dump device with the following command:
sp_addumpdevice @.devtype = 'disk',
@.logicalname = 'SorClinTest_E',
@.physicalname = '\\RemoteServerName\e$\Backuptest\FromPr
od.ext'
When i tried backing up to that device i got an error that the backup failed
(no details). I am guessing that it failed because of the remote device.
If anyone can shed some light on this - I would appreciate it.
Thanks,
Tom
Sent via SreeSharp NewsReader http://www.SreeSharp.com

db backup simple vs. full recovery mode

When we do a full database backup manually, we are seeing the trn file reflect the current date/time, but we are not seeing the mdf reflect the new date/time. And we are not seeing the transaction log file decrease in size. the recovery mode is set to full, do we need to change to simple to see both the mdf being backup'ed?

When you do a backup, markers are written to the Transaction Log file, however, the backup process does not change anything about the datafiles -therefore the 'trn' file gets a new datetime and the data file does not.

The Transaction Log file does not shrink UNLESS specifically so instructed. See Books Online for DBCC 'Shrinkfile'.

|||

Hi,

You can schedule half/hourly t-log backup to keep it in shape, how ever if its growing unpexctingly refer below thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1221599&SiteID=1

Hemantgiri S. Goswami

|||

What we are seeing are current timestamps on the trn file, current timestamps on the ldf, but about a six month old modified date on the mdf. I would assume that the trn file would have the most recent transactions, the ldf the intermediate, and then the mdf.

With the truncate command on the trn file, do the transactions immediately hit the mdf file or the ldf (I would think the ldf)? however when does the mdf get updated by the ldf file?

Am I completely lost--I thought that the ldf (a locked mdf file, correct?) would eventually post the edits/updates to the mdf.

|||

The ldf is the transaction log file. Data changes are moved to the mdf (data file) on a regular basis -usually within seconds.

The OS stamps the file date. SQL Server has a data file (mdf) open with a, perhaps, large, amount of empty space. The OS does not know what is happening inside the mdf file unless there are specific interactions between SQL Server and the OS regarding the file.

It seems like you are confused because the mdf file date is not changing. It most likely will not change unless one of the following actions occur: Filegrowth, Fileshrink, Detach/Attach.

DB backup script

Hello, I inherited a SQL Server from my predecissor and came accross this backup script..Can anyone please help me in understanding what this means?
This script is currently backing up the 1.3GB database. and the current backup file size is 67GB. Maybe this script is adding up all the backs cummulatively everyday. I want it to make a fullbackup once a day and make incremental backups remaining 6 days. At the end of the week, I want to save the file somewhere and then start fresh with a new backup file. Is that possible? How do I achieve it. Any online sources to read some helpful tips? Appreciate your help...
-------

BACKUP DATABASE [STS_pthsps01_1] TO DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH NOINIT , NOUNLOAD , NAME = N'STS_pthsps01_1 backup', NOSKIP , STATS = 10, NOFORMAT DECLARE @.i INT
select @.i = position from msdb..backupset where database_name='STS_pthsps01_1'and type!='F' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name='STS_pthsps01_1')
RESTORE VERIFYONLY FROM DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH FILE = @.iYou are correct. The script is only appending backups. The NOINIT is what does that. If you want to overwrite the file change NOINIT to INIT.

As to changing it, you can set up 2 jobs under SQLAgent. The first runs weekly, and does the following:
1) copy the old backups to a new directory
2) Backs up the database (with init)

The second job would run 6 days a week and just do the differential backups probably to the same file, and let the weekly job pick up it's old file.

Play around with jobs in SQLAgent, and you should get it quickly enough. Also, look up BACKUP in BOL, so you can see all the bells and whistles there.|||You are correct. The script is only appending backups. The NOINIT is what does that. If you want to overwrite the file change NOINIT to INIT.

As to changing it, you can set up 2 jobs under SQLAgent. The first runs weekly, and does the following:
1) copy the old backups to a new directory
2) Backs up the database (with init)

The second job would run 6 days a week and just do the differential backups probably to the same file, and let the weekly job pick up it's old file.

Play around with jobs in SQLAgent, and you should get it quickly enough. Also, look up BACKUP in BOL, so you can see all the bells and whistles there.
Hi Thanks.
Thats a good suggestion. I will do that. Also, In the script that I copied F is for full. What needs to be changed to make full to differential.
I want to create 2 jobs.
1- Full backup every friday night with INIT
2- Diff backup the remaining days with NOINIT.
I will have a windows scheduler to copy this file every week to alternate location.|||Hello, I inherited a SQL Server from my predecissor and came accross this backup script..Can anyone please help me in understanding what this means?
This script is currently backing up the 1.3GB database. and the current backup file size is 67GB. Maybe this script is adding up all the backs cummulatively everyday. I want it to make a fullbackup once a day and make incremental backups remaining 6 days. At the end of the week, I want to save the file somewhere and then start fresh with a new backup file. Is that possible? How do I achieve it. Any online sources to read some helpful tips? Appreciate your help...
-------

BACKUP DATABASE [STS_pthsps01_1] TO DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH NOINIT , NOUNLOAD , NAME = N'STS_pthsps01_1 backup', NOSKIP , STATS = 10, NOFORMAT DECLARE @.i INT
select @.i = position from msdb..backupset where database_name='STS_pthsps01_1'and type!='F' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name='STS_pthsps01_1')
RESTORE VERIFYONLY FROM DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH FILE = @.i

The switch database_name='STS_pthsps01_1'and type!='F' means that it is fullbackup. How do I change it to be Differential? I tried creating a new job, but, its all T-SQL that I can do. I didnt see a GUI way.|||The restore command actually ends at "STATS = 10, NOFORMAT" After that, a query to determine the filenumber starts. The restore verifyonly checks the validity of the backup (kinda).
The types of backups are as follows:
D: Full
I: Differential (incremental)
L: Transaction log

Why the query is looking for type not equal to "F", I am not sure, since all of them are not equal to "F".|||Thanks Mcrowly for the clarification. I am clear now on the existing command. Now, Looking at the script, I am not seeing it to backup FULL. Can you please point me to where I can say backup D or backup I? I looked in BOL, and couldnt find any help from the T-SQL perspective there. Appreciate your help.|||A full backup is the default behaviour of the BACKUP DATABASE command. In order to get a differential backup, you have to supply the DIFFERENTIAL argument in the WITH list.|||Hi, Thanks for your reply.
I have modified the script to take differential as follows and it works fine.. Is this correct?
-------
BACKUP DATABASE [STS_pthsps01_1] TO DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH NOINIT , DIFFERENTIAL, NOUNLOAD , NAME = N'STS_pthsps01_1 backup', NOSKIP , STATS = 10, NOFORMAT DECLARE @.i INT
select @.i = position from msdb..backupset where database_name='STS_pthsps01_1'and type!='F' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name='STS_pthsps01_1')
RESTORE VERIFYONLY FROM DISK = N'E:\PTHSPS01_BACKUP\SharepointDB' WITH FILE = @.i
----------

Looks like this script backs up the diff between the full backup and the time diff is executed. The next diff backup will be again between full backup and 3rd day.
1) Full backup
2) Diff bwtween 1 and 2
3) Diff between 1 and 3
4) Diff between 1 and 4

How do we make the 3) to be 2 and 3 instead of 1 and 3?

DB Backup Question

Hello,
I know the transaction log will grow while backing up a
database, but will the database file grow as well if the
database is not in use?
Any help would be greatly appreciated!
Thanks in advance.
If the Db is not being actively updated i would not expect either the
databse, or the log to grow t all during a backup.
I am not sure what you mean when you say you "know the log will grow". Is
there an underlying problem you are trying to resolve?
Mike John
"Gene S." <anonymous@.discussions.microsoft.com> wrote in message
news:21b801c4ac8b$c816de30$a601280a@.phx.gbl...
> Hello,
> I know the transaction log will grow while backing up a
> database, but will the database file grow as well if the
> database is not in use?
> Any help would be greatly appreciated!
> Thanks in advance.
sql

DB Backup Question

Hello,
I know the transaction log will grow while backing up a
database, but will the database file grow as well if the
database is not in use?
Any help would be greatly appreciated!
Thanks in advance.If the Db is not being actively updated i would not expect either the
databse, or the log to grow t all during a backup.
I am not sure what you mean when you say you "know the log will grow". Is
there an underlying problem you are trying to resolve?
Mike John
"Gene S." <anonymous@.discussions.microsoft.com> wrote in message
news:21b801c4ac8b$c816de30$a601280a@.phx.gbl...
> Hello,
> I know the transaction log will grow while backing up a
> database, but will the database file grow as well if the
> database is not in use?
> Any help would be greatly appreciated!
> Thanks in advance.

DB Backup problem

Hello,
I have one particular SQL 7 database that is rather large, over 100
gigs. Most of this is in one table which is full of blobs. This database
is mission critical stuff and is backed up every night. However, as of
recent this backup is taking almost 15 hours to complete sometimes and when
it's running the DB can't be accessed which is causing problems. Can anyone
suggest a solution to keeping this backup time to a minimum?
-Scott Elgram
There are several things that you can do.. None of them are particularly
pretty.
One suggestion that comes to mind:
1. Create a new table for a 1-to-1 relationship with your big table and
move your BLOBs off the big table and into the new table.
2. Put that new table in it's own filegroup
3. Back up that filegroup separately.
Another suggestion..
If the BLOBs are not often modified or added, you may wish to enable
t-logging of your BLOB objects. Then the blobs are part of the transaction
log. You don't have to do a complete DB backup every night.
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have one particular SQL 7 database that is rather large, over 100
> gigs. Most of this is in one table which is full of blobs. This database
> is mission critical stuff and is backed up every night. However, as of
> recent this backup is taking almost 15 hours to complete sometimes and
when
> it's running the DB can't be accessed which is causing problems. Can
anyone
> suggest a solution to keeping this backup time to a minimum?
> --
> -Scott Elgram
>
|||Are you certain that it really is backup that is blocking? Have you verified using sp_who2 etc?
Backup shouldn't block, perhaps you in the same job is doing some shrink or defrag?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have one particular SQL 7 database that is rather large, over 100
> gigs. Most of this is in one table which is full of blobs. This database
> is mission critical stuff and is backed up every night. However, as of
> recent this backup is taking almost 15 hours to complete sometimes and when
> it's running the DB can't be accessed which is causing problems. Can anyone
> suggest a solution to keeping this backup time to a minimum?
> --
> -Scott Elgram
>
|||Tibor Karaszi,
I looked into that and the Maintenance Plan does the following Monday -
Friday;
5:00pm - Optimization:
- Reorganize data and index pages, Change free space per page to 1%.
- Remove unused space from database files, shrink when it grows
beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
space.
5:30pm - Integrity
- Check database integrity, include indexes, attempt to repair any
minor problems.
6:00pm - Transaction Log Backup
- Backup the transaction log of the database as part of the
maintenance plan
- Verify the integrity of the backup upon completion
7:00pm - Complete Backup
- back up the database as part of the maintenance plan
- verify the integrity of the backup upon completion
After reviewing this, which I did not create ;) , Would in help my cause
if I were to move the Optimization to some other plan that runs once a week
on perhaps a weekend when backups are not running? If backing up should not
lock the DB then could it be the Optimization that is taking 15 hours and
locking it?
-Scott
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> Are you certain that it really is backup that is blocking? Have you
verified using sp_who2 etc?
> Backup shouldn't block, perhaps you in the same job is doing some shrink
or defrag?[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
database[vbcol=seagreen]
when[vbcol=seagreen]
anyone
>
|||Rick Sawtell,
The information added to the BLOB table is daily....sometimes several
hundred megs are added each day. Does that leave me with only this second
option? Also, Someone by the name Tibor Karaszi has suggested that Backups
should not "lock" databases or tables and this lock might be caused by some
shrink or defrag occurring in the same job. Could Optimization in the
backup maintenance plan be the culprit and running for 15 hours, not the
actual backup?
-Scott
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:Osb3YGgtEHA.3572@.tk2msftngp13.phx.gbl...
> There are several things that you can do.. None of them are particularly
> pretty.
> One suggestion that comes to mind:
> 1. Create a new table for a 1-to-1 relationship with your big table and
> move your BLOBs off the big table and into the new table.
> 2. Put that new table in it's own filegroup
> 3. Back up that filegroup separately.
> Another suggestion..
> If the BLOBs are not often modified or added, you may wish to enable
> t-logging of your BLOB objects. Then the blobs are part of the
transaction[vbcol=seagreen]
> log. You don't have to do a complete DB backup every night.
> HTH
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>
>
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
database
> when
> anyone
>
|||"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uTP9RmgtEHA.2956@.TK2MSFTNGP12.phx.gbl...
> Rick Sawtell,
> The information added to the BLOB table is daily....sometimes several
> hundred megs are added each day. Does that leave me with only this second
> option? Also, Someone by the name Tibor Karaszi has suggested that
Backups
> should not "lock" databases or tables and this lock might be caused by
some
> shrink or defrag occurring in the same job. Could Optimization in the
> backup maintenance plan be the culprit and running for 15 hours, not the
> actual backup?
> -Scott
A couple of hundred megs of changes are still better than 100 gigs of
nightly backups.
That said, Tibor is correct. Backups don't generally lock the tables. You
probably have something going on in the DBMaint that is locking rows and
slowing your backup process. An index defrag or similar.
Rick
|||"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following
Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to
1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems.
> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
> After reviewing this, which I did not create ;) , Would in help my
cause
> if I were to move the Optimization to some other plan that runs once a
week
> on perhaps a weekend when backups are not running? If backing up should
not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
>
Yes! You are only picking up 1% or so.. If you let it go until the
weekends, you should see very little performance degradation.
To be sure, run a baseline on the system as it operates currently. Then
make your changes and check it again. Compare to the baseline.
Rick
|||Comments Inline
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following
Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to
1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
>
Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
SHOWCONTIG. There is a script that will allow you to defrag your tables
when they actually need it rather than all at once. Do not shrink the data
files. You will just have to grow them again and take the performance hit
when they auto-grow. And yes, it is the optimization step that is likely
locking the tables.

> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems
Big no-no. Go ahead and run the checks, but don't attempt to repair. All
you will do is mask the early stages of a problem until it gets too big for
DBCC to fix.

> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
Yes.
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
Yes.
> After reviewing this, which I did not create ;) , Would in help my
cause
> if I were to move the Optimization to some other plan that runs once a
week
> on perhaps a weekend when backups are not running? If backing up should
not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
> -Scott
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in[vbcol=seagreen]
> message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> verified using sp_who2 etc?
> or defrag?
> database
of
> when
> anyone
>
|||I fully agree with Geoff's points.
To read more specifically about shrink: http://www.karaszi.com/SQLServer/info_dont_shrink.asp
And more about defragmentation:
http://www.microsoft.com/technet/pro.../ss2kidbp.mspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to 1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems.
> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
> After reviewing this, which I did not create ;) , Would in help my cause
> if I were to move the Optimization to some other plan that runs once a week
> on perhaps a weekend when backups are not running? If backing up should not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
> -Scott
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> verified using sp_who2 etc?
> or defrag?
> database
> when
> anyone
>
|||Geoff N. Hiten,
What about checking the "Reorganize data and index pages, Reorganize
with the original amount of free space" and "Update the statistics used by
the query optimizer, Percentage of database to sample 10%" to run on a
weekend? Those seem like good things to have done but because of the cost on
performance might be better run during a time of little or no usage like the
weekend. Or is it just a bad idea over all to set Optimization in the
maintenance Plan?
-Scott
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:%23CT8aygtEHA.1464@.TK2MSFTNGP15.phx.gbl...[vbcol=seagreen]
> Comments Inline
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Monday -
> 1%.
data
> Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
> SHOWCONTIG. There is a script that will allow you to defrag your tables
> when they actually need it rather than all at once. Do not shrink the
data[vbcol=seagreen]
> files. You will just have to grow them again and take the performance hit
> when they auto-grow. And yes, it is the optimization step that is likely
> locking the tables.
>
any
> Big no-no. Go ahead and run the checks, but don't attempt to repair. All
> you will do is mask the early stages of a problem until it gets too big
for[vbcol=seagreen]
> DBCC to fix.
> Yes.
> Yes.
> cause
> week
> not
and[vbcol=seagreen]
> in
shrink[vbcol=seagreen]
100[vbcol=seagreen]
> of
and[vbcol=seagreen]
Can
>

DB Backup problem

Hello,
I have one particular SQL 7 database that is rather large, over 100
gigs. Most of this is in one table which is full of blobs. This database
is mission critical stuff and is backed up every night. However, as of
recent this backup is taking almost 15 hours to complete sometimes and when
it's running the DB can't be accessed which is causing problems. Can anyone
suggest a solution to keeping this backup time to a minimum?
--
-Scott ElgramThere are several things that you can do.. None of them are particularly
pretty.
One suggestion that comes to mind:
1. Create a new table for a 1-to-1 relationship with your big table and
move your BLOBs off the big table and into the new table.
2. Put that new table in it's own filegroup
3. Back up that filegroup separately.
Another suggestion..
If the BLOBs are not often modified or added, you may wish to enable
t-logging of your BLOB objects. Then the blobs are part of the transaction
log. You don't have to do a complete DB backup every night.
HTH
Rick Sawtell
MCT, MCSD, MCDBA
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have one particular SQL 7 database that is rather large, over 100
> gigs. Most of this is in one table which is full of blobs. This database
> is mission critical stuff and is backed up every night. However, as of
> recent this backup is taking almost 15 hours to complete sometimes and
when
> it's running the DB can't be accessed which is causing problems. Can
anyone
> suggest a solution to keeping this backup time to a minimum?
> --
> -Scott Elgram
>|||Are you certain that it really is backup that is blocking? Have you verified using sp_who2 etc?
Backup shouldn't block, perhaps you in the same job is doing some shrink or defrag?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> Hello,
> I have one particular SQL 7 database that is rather large, over 100
> gigs. Most of this is in one table which is full of blobs. This database
> is mission critical stuff and is backed up every night. However, as of
> recent this backup is taking almost 15 hours to complete sometimes and when
> it's running the DB can't be accessed which is causing problems. Can anyone
> suggest a solution to keeping this backup time to a minimum?
> --
> -Scott Elgram
>|||Tibor Karaszi,
I looked into that and the Maintenance Plan does the following Monday -
Friday;
5:00pm - Optimization:
- Reorganize data and index pages, Change free space per page to 1%.
- Remove unused space from database files, shrink when it grows
beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
space.
5:30pm - Integrity
- Check database integrity, include indexes, attempt to repair any
minor problems.
6:00pm - Transaction Log Backup
- Backup the transaction log of the database as part of the
maintenance plan
- Verify the integrity of the backup upon completion
7:00pm - Complete Backup
- back up the database as part of the maintenance plan
- verify the integrity of the backup upon completion
After reviewing this, which I did not create ;) , Would in help my cause
if I were to move the Optimization to some other plan that runs once a week
on perhaps a weekend when backups are not running? If backing up should not
lock the DB then could it be the Optimization that is taking 15 hours and
locking it?
-Scott
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> Are you certain that it really is backup that is blocking? Have you
verified using sp_who2 etc?
> Backup shouldn't block, perhaps you in the same job is doing some shrink
or defrag?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > Hello,
> > I have one particular SQL 7 database that is rather large, over 100
> > gigs. Most of this is in one table which is full of blobs. This
database
> > is mission critical stuff and is backed up every night. However, as of
> > recent this backup is taking almost 15 hours to complete sometimes and
when
> > it's running the DB can't be accessed which is causing problems. Can
anyone
> > suggest a solution to keeping this backup time to a minimum?
> >
> > --
> > -Scott Elgram
> >
> >
>|||Rick Sawtell,
The information added to the BLOB table is daily....sometimes several
hundred megs are added each day. Does that leave me with only this second
option? Also, Someone by the name Tibor Karaszi has suggested that Backups
should not "lock" databases or tables and this lock might be caused by some
shrink or defrag occurring in the same job. Could Optimization in the
backup maintenance plan be the culprit and running for 15 hours, not the
actual backup?
-Scott
"Rick Sawtell" <r_sawtell@.hotmail.com> wrote in message
news:Osb3YGgtEHA.3572@.tk2msftngp13.phx.gbl...
> There are several things that you can do.. None of them are particularly
> pretty.
> One suggestion that comes to mind:
> 1. Create a new table for a 1-to-1 relationship with your big table and
> move your BLOBs off the big table and into the new table.
> 2. Put that new table in it's own filegroup
> 3. Back up that filegroup separately.
> Another suggestion..
> If the BLOBs are not often modified or added, you may wish to enable
> t-logging of your BLOB objects. Then the blobs are part of the
transaction
> log. You don't have to do a complete DB backup every night.
> HTH
> Rick Sawtell
> MCT, MCSD, MCDBA
>
>
>
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > Hello,
> > I have one particular SQL 7 database that is rather large, over 100
> > gigs. Most of this is in one table which is full of blobs. This
database
> > is mission critical stuff and is backed up every night. However, as of
> > recent this backup is taking almost 15 hours to complete sometimes and
> when
> > it's running the DB can't be accessed which is causing problems. Can
> anyone
> > suggest a solution to keeping this backup time to a minimum?
> >
> > --
> > -Scott Elgram
> >
> >
>|||"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uTP9RmgtEHA.2956@.TK2MSFTNGP12.phx.gbl...
> Rick Sawtell,
> The information added to the BLOB table is daily....sometimes several
> hundred megs are added each day. Does that leave me with only this second
> option? Also, Someone by the name Tibor Karaszi has suggested that
Backups
> should not "lock" databases or tables and this lock might be caused by
some
> shrink or defrag occurring in the same job. Could Optimization in the
> backup maintenance plan be the culprit and running for 15 hours, not the
> actual backup?
> -Scott
A couple of hundred megs of changes are still better than 100 gigs of
nightly backups.
That said, Tibor is correct. Backups don't generally lock the tables. You
probably have something going on in the DBMaint that is locking rows and
slowing your backup process. An index defrag or similar.
Rick|||"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following
Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to
1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems.
> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
> After reviewing this, which I did not create ;) , Would in help my
cause
> if I were to move the Optimization to some other plan that runs once a
week
> on perhaps a weekend when backups are not running? If backing up should
not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
>
Yes! You are only picking up 1% or so.. If you let it go until the
weekends, you should see very little performance degradation.
To be sure, run a baseline on the system as it operates currently. Then
make your changes and check it again. Compare to the baseline.
Rick|||Comments Inline
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following
Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to
1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
>
Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
SHOWCONTIG. There is a script that will allow you to defrag your tables
when they actually need it rather than all at once. Do not shrink the data
files. You will just have to grow them again and take the performance hit
when they auto-grow. And yes, it is the optimization step that is likely
locking the tables.
> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems
Big no-no. Go ahead and run the checks, but don't attempt to repair. All
you will do is mask the early stages of a problem until it gets too big for
DBCC to fix.
> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
Yes.
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
Yes.
> After reviewing this, which I did not create ;) , Would in help my
cause
> if I were to move the Optimization to some other plan that runs once a
week
> on perhaps a weekend when backups are not running? If backing up should
not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
> -Scott
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> > Are you certain that it really is backup that is blocking? Have you
> verified using sp_who2 etc?
> > Backup shouldn't block, perhaps you in the same job is doing some shrink
> or defrag?
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > > Hello,
> > > I have one particular SQL 7 database that is rather large, over 100
> > > gigs. Most of this is in one table which is full of blobs. This
> database
> > > is mission critical stuff and is backed up every night. However, as
of
> > > recent this backup is taking almost 15 hours to complete sometimes and
> when
> > > it's running the DB can't be accessed which is causing problems. Can
> anyone
> > > suggest a solution to keeping this backup time to a minimum?
> > >
> > > --
> > > -Scott Elgram
> > >
> > >
> >
> >
>|||I fully agree with Geoff's points.
To read more specifically about shrink: http://www.karaszi.com/SQLServer/info_dont_shrink.asp
And more about defragmentation:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> Tibor Karaszi,
> I looked into that and the Maintenance Plan does the following Monday -
> Friday;
> 5:00pm - Optimization:
> - Reorganize data and index pages, Change free space per page to 1%.
> - Remove unused space from database files, shrink when it grows
> beyond 50 MB, Amount of free space to remain after shrink: 1% of the data
> space.
> 5:30pm - Integrity
> - Check database integrity, include indexes, attempt to repair any
> minor problems.
> 6:00pm - Transaction Log Backup
> - Backup the transaction log of the database as part of the
> maintenance plan
> - Verify the integrity of the backup upon completion
> 7:00pm - Complete Backup
> - back up the database as part of the maintenance plan
> - verify the integrity of the backup upon completion
> After reviewing this, which I did not create ;) , Would in help my cause
> if I were to move the Optimization to some other plan that runs once a week
> on perhaps a weekend when backups are not running? If backing up should not
> lock the DB then could it be the Optimization that is taking 15 hours and
> locking it?
> -Scott
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
>> Are you certain that it really is backup that is blocking? Have you
> verified using sp_who2 etc?
>> Backup shouldn't block, perhaps you in the same job is doing some shrink
> or defrag?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
>> news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
>> > Hello,
>> > I have one particular SQL 7 database that is rather large, over 100
>> > gigs. Most of this is in one table which is full of blobs. This
> database
>> > is mission critical stuff and is backed up every night. However, as of
>> > recent this backup is taking almost 15 hours to complete sometimes and
> when
>> > it's running the DB can't be accessed which is causing problems. Can
> anyone
>> > suggest a solution to keeping this backup time to a minimum?
>> >
>> > --
>> > -Scott Elgram
>> >
>> >
>>
>|||Geoff N. Hiten,
What about checking the "Reorganize data and index pages, Reorganize
with the original amount of free space" and "Update the statistics used by
the query optimizer, Percentage of database to sample 10%" to run on a
weekend? Those seem like good things to have done but because of the cost on
performance might be better run during a time of little or no usage like the
weekend. Or is it just a bad idea over all to set Optimization in the
maintenance Plan?
-Scott
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:%23CT8aygtEHA.1464@.TK2MSFTNGP15.phx.gbl...
> Comments Inline
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> > Tibor Karaszi,
> > I looked into that and the Maintenance Plan does the following
> Monday -
> > Friday;
> >
> > 5:00pm - Optimization:
> > - Reorganize data and index pages, Change free space per page to
> 1%.
> > - Remove unused space from database files, shrink when it grows
> > beyond 50 MB, Amount of free space to remain after shrink: 1% of the
data
> > space.
> >
> Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
> SHOWCONTIG. There is a script that will allow you to defrag your tables
> when they actually need it rather than all at once. Do not shrink the
data
> files. You will just have to grow them again and take the performance hit
> when they auto-grow. And yes, it is the optimization step that is likely
> locking the tables.
>
> > 5:30pm - Integrity
> > - Check database integrity, include indexes, attempt to repair
any
> > minor problems
> Big no-no. Go ahead and run the checks, but don't attempt to repair. All
> you will do is mask the early stages of a problem until it gets too big
for
> DBCC to fix.
> >
> > 6:00pm - Transaction Log Backup
> > - Backup the transaction log of the database as part of the
> > maintenance plan
> > - Verify the integrity of the backup upon completion
> Yes.
> >
> > 7:00pm - Complete Backup
> > - back up the database as part of the maintenance plan
> > - verify the integrity of the backup upon completion
> Yes.
> >
> > After reviewing this, which I did not create ;) , Would in help my
> cause
> > if I were to move the Optimization to some other plan that runs once a
> week
> > on perhaps a weekend when backups are not running? If backing up should
> not
> > lock the DB then could it be the Optimization that is taking 15 hours
and
> > locking it?
> >
> > -Scott
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
> > message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> > > Are you certain that it really is backup that is blocking? Have you
> > verified using sp_who2 etc?
> > > Backup shouldn't block, perhaps you in the same job is doing some
shrink
> > or defrag?
> > >
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > http://www.karaszi.com/sqlserver/default.asp
> > > http://www.solidqualitylearning.com/
> > >
> > >
> > > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > > news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > > > Hello,
> > > > I have one particular SQL 7 database that is rather large, over
100
> > > > gigs. Most of this is in one table which is full of blobs. This
> > database
> > > > is mission critical stuff and is backed up every night. However, as
> of
> > > > recent this backup is taking almost 15 hours to complete sometimes
and
> > when
> > > > it's running the DB can't be accessed which is causing problems.
Can
> > anyone
> > > > suggest a solution to keeping this backup time to a minimum?
> > > >
> > > > --
> > > > -Scott Elgram
> > > >
> > > >
> > >
> > >
> >
> >
>|||Some people don't like maintenance plans at all and prefer to do things
using scripts and SQL agent jobs. The Reorganize Data and Index pages uses
DBCC DBREINDEX under the covers. I prefer a combination of DBCC DBREINDEX
and DBCC INDEXDEFRAG driven by DBCC SHOWCONTIG, all running at low activity
times in SQL agent jobs.
As for free space, you need to pro-actively manage that. Don't try and
shrink active databases unless there is more than 30% empty space. You will
fill in the space soon enough and auto-grow has a huge performance penalty.
Finally, the Statistics update. I prefer to set up SQL agent jobs to
recalculate statistics at a known time. Sample rates depend on your data.
If you have a fairly normal or even data distribution, then a small
percentage like 10% is ok. If you have some unusual distributions (I.E.
many entries are unique and a few entries have hundreds or thousands of
matches, then you will likely need a higher percentage. If you end up with
bad query plans, then you will definitely have to increase the scan
percentage.
Maintenance plans are easy but not as flexible as writing your own code.
There are good examples in BOL and out on the web.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:u6$30YhtEHA.2664@.TK2MSFTNGP12.phx.gbl...
> Geoff N. Hiten,
> What about checking the "Reorganize data and index pages, Reorganize
> with the original amount of free space" and "Update the statistics used by
> the query optimizer, Percentage of database to sample 10%" to run on a
> weekend? Those seem like good things to have done but because of the cost
on
> performance might be better run during a time of little or no usage like
the
> weekend. Or is it just a bad idea over all to set Optimization in the
> maintenance Plan?
> -Scott
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:%23CT8aygtEHA.1464@.TK2MSFTNGP15.phx.gbl...
> > Comments Inline
> >
> > --
> > Geoff N. Hiten
> > Microsoft SQL Server MVP
> > Senior Database Administrator
> > Careerbuilder.com
> >
> > I support the Professional Association for SQL Server
> > www.sqlpass.org
> >
> > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> > > Tibor Karaszi,
> > > I looked into that and the Maintenance Plan does the following
> > Monday -
> > > Friday;
> > >
> > > 5:00pm - Optimization:
> > > - Reorganize data and index pages, Change free space per page
to
> > 1%.
> > > - Remove unused space from database files, shrink when it
grows
> > > beyond 50 MB, Amount of free space to remain after shrink: 1% of the
> data
> > > space.
> > >
> > Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
> > SHOWCONTIG. There is a script that will allow you to defrag your tables
> > when they actually need it rather than all at once. Do not shrink the
> data
> > files. You will just have to grow them again and take the performance
hit
> > when they auto-grow. And yes, it is the optimization step that is
likely
> > locking the tables.
> >
> >
> > > 5:30pm - Integrity
> > > - Check database integrity, include indexes, attempt to repair
> any
> > > minor problems
> > Big no-no. Go ahead and run the checks, but don't attempt to repair.
All
> > you will do is mask the early stages of a problem until it gets too big
> for
> > DBCC to fix.
> >
> > >
> > > 6:00pm - Transaction Log Backup
> > > - Backup the transaction log of the database as part of the
> > > maintenance plan
> > > - Verify the integrity of the backup upon completion
> > Yes.
> > >
> > > 7:00pm - Complete Backup
> > > - back up the database as part of the maintenance plan
> > > - verify the integrity of the backup upon completion
> > Yes.
> > >
> > > After reviewing this, which I did not create ;) , Would in help my
> > cause
> > > if I were to move the Optimization to some other plan that runs once a
> > week
> > > on perhaps a weekend when backups are not running? If backing up
should
> > not
> > > lock the DB then could it be the Optimization that is taking 15 hours
> and
> > > locking it?
> > >
> > > -Scott
> > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> > > > Are you certain that it really is backup that is blocking? Have you
> > > verified using sp_who2 etc?
> > > > Backup shouldn't block, perhaps you in the same job is doing some
> shrink
> > > or defrag?
> > > >
> > > > --
> > > > Tibor Karaszi, SQL Server MVP
> > > > http://www.karaszi.com/sqlserver/default.asp
> > > > http://www.solidqualitylearning.com/
> > > >
> > > >
> > > > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > > > news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > > > > Hello,
> > > > > I have one particular SQL 7 database that is rather large, over
> 100
> > > > > gigs. Most of this is in one table which is full of blobs. This
> > > database
> > > > > is mission critical stuff and is backed up every night. However,
as
> > of
> > > > > recent this backup is taking almost 15 hours to complete sometimes
> and
> > > when
> > > > > it's running the DB can't be accessed which is causing problems.
> Can
> > > anyone
> > > > > suggest a solution to keeping this backup time to a minimum?
> > > > >
> > > > > --
> > > > > -Scott Elgram
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>|||Did you read the defrag article I referred to? It has *lots* of good info!
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Scott Elgram" <SElgram@.verifpoint.com> wrote in message
news:u6$30YhtEHA.2664@.TK2MSFTNGP12.phx.gbl...
> Geoff N. Hiten,
> What about checking the "Reorganize data and index pages, Reorganize
> with the original amount of free space" and "Update the statistics used by
> the query optimizer, Percentage of database to sample 10%" to run on a
> weekend? Those seem like good things to have done but because of the cost on
> performance might be better run during a time of little or no usage like the
> weekend. Or is it just a bad idea over all to set Optimization in the
> maintenance Plan?
> -Scott
> "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> news:%23CT8aygtEHA.1464@.TK2MSFTNGP15.phx.gbl...
>> Comments Inline
>> --
>> Geoff N. Hiten
>> Microsoft SQL Server MVP
>> Senior Database Administrator
>> Careerbuilder.com
>> I support the Professional Association for SQL Server
>> www.sqlpass.org
>> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
>> news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
>> > Tibor Karaszi,
>> > I looked into that and the Maintenance Plan does the following
>> Monday -
>> > Friday;
>> >
>> > 5:00pm - Optimization:
>> > - Reorganize data and index pages, Change free space per page to
>> 1%.
>> > - Remove unused space from database files, shrink when it grows
>> > beyond 50 MB, Amount of free space to remain after shrink: 1% of the
> data
>> > space.
>> >
>> Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
>> SHOWCONTIG. There is a script that will allow you to defrag your tables
>> when they actually need it rather than all at once. Do not shrink the
> data
>> files. You will just have to grow them again and take the performance hit
>> when they auto-grow. And yes, it is the optimization step that is likely
>> locking the tables.
>>
>> > 5:30pm - Integrity
>> > - Check database integrity, include indexes, attempt to repair
> any
>> > minor problems
>> Big no-no. Go ahead and run the checks, but don't attempt to repair. All
>> you will do is mask the early stages of a problem until it gets too big
> for
>> DBCC to fix.
>> >
>> > 6:00pm - Transaction Log Backup
>> > - Backup the transaction log of the database as part of the
>> > maintenance plan
>> > - Verify the integrity of the backup upon completion
>> Yes.
>> >
>> > 7:00pm - Complete Backup
>> > - back up the database as part of the maintenance plan
>> > - verify the integrity of the backup upon completion
>> Yes.
>> >
>> > After reviewing this, which I did not create ;) , Would in help my
>> cause
>> > if I were to move the Optimization to some other plan that runs once a
>> week
>> > on perhaps a weekend when backups are not running? If backing up should
>> not
>> > lock the DB then could it be the Optimization that is taking 15 hours
> and
>> > locking it?
>> >
>> > -Scott
>> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in
>> > message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
>> > > Are you certain that it really is backup that is blocking? Have you
>> > verified using sp_who2 etc?
>> > > Backup shouldn't block, perhaps you in the same job is doing some
> shrink
>> > or defrag?
>> > >
>> > > --
>> > > Tibor Karaszi, SQL Server MVP
>> > > http://www.karaszi.com/sqlserver/default.asp
>> > > http://www.solidqualitylearning.com/
>> > >
>> > >
>> > > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
>> > > news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
>> > > > Hello,
>> > > > I have one particular SQL 7 database that is rather large, over
> 100
>> > > > gigs. Most of this is in one table which is full of blobs. This
>> > database
>> > > > is mission critical stuff and is backed up every night. However, as
>> of
>> > > > recent this backup is taking almost 15 hours to complete sometimes
> and
>> > when
>> > > > it's running the DB can't be accessed which is causing problems.
> Can
>> > anyone
>> > > > suggest a solution to keeping this backup time to a minimum?
>> > > >
>> > > > --
>> > > > -Scott Elgram
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>
>|||Thanks alot guys,
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:eJaSOihtEHA.1452@.TK2MSFTNGP11.phx.gbl...
> Some people don't like maintenance plans at all and prefer to do things
> using scripts and SQL agent jobs. The Reorganize Data and Index pages
uses
> DBCC DBREINDEX under the covers. I prefer a combination of DBCC DBREINDEX
> and DBCC INDEXDEFRAG driven by DBCC SHOWCONTIG, all running at low
activity
> times in SQL agent jobs.
> As for free space, you need to pro-actively manage that. Don't try and
> shrink active databases unless there is more than 30% empty space. You
will
> fill in the space soon enough and auto-grow has a huge performance
penalty.
> Finally, the Statistics update. I prefer to set up SQL agent jobs to
> recalculate statistics at a known time. Sample rates depend on your data.
> If you have a fairly normal or even data distribution, then a small
> percentage like 10% is ok. If you have some unusual distributions (I.E.
> many entries are unique and a few entries have hundreds or thousands of
> matches, then you will likely need a higher percentage. If you end up
with
> bad query plans, then you will definitely have to increase the scan
> percentage.
> Maintenance plans are easy but not as flexible as writing your own code.
> There are good examples in BOL and out on the web.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> news:u6$30YhtEHA.2664@.TK2MSFTNGP12.phx.gbl...
> > Geoff N. Hiten,
> > What about checking the "Reorganize data and index pages, Reorganize
> > with the original amount of free space" and "Update the statistics used
by
> > the query optimizer, Percentage of database to sample 10%" to run on a
> > weekend? Those seem like good things to have done but because of the
cost
> on
> > performance might be better run during a time of little or no usage like
> the
> > weekend. Or is it just a bad idea over all to set Optimization in the
> > maintenance Plan?
> >
> > -Scott
> >
> > "Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
> > news:%23CT8aygtEHA.1464@.TK2MSFTNGP15.phx.gbl...
> > > Comments Inline
> > >
> > > --
> > > Geoff N. Hiten
> > > Microsoft SQL Server MVP
> > > Senior Database Administrator
> > > Careerbuilder.com
> > >
> > > I support the Professional Association for SQL Server
> > > www.sqlpass.org
> > >
> > > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > > news:uuQrgjgtEHA.2316@.TK2MSFTNGP12.phx.gbl...
> > > > Tibor Karaszi,
> > > > I looked into that and the Maintenance Plan does the following
> > > Monday -
> > > > Friday;
> > > >
> > > > 5:00pm - Optimization:
> > > > - Reorganize data and index pages, Change free space per
page
> to
> > > 1%.
> > > > - Remove unused space from database files, shrink when it
> grows
> > > > beyond 50 MB, Amount of free space to remain after shrink: 1% of the
> > data
> > > > space.
> > > >
> > > Ditch the Maintenance Plan Optimizations. Look in BOL under DBCC
> > > SHOWCONTIG. There is a script that will allow you to defrag your
tables
> > > when they actually need it rather than all at once. Do not shrink the
> > data
> > > files. You will just have to grow them again and take the performance
> hit
> > > when they auto-grow. And yes, it is the optimization step that is
> likely
> > > locking the tables.
> > >
> > >
> > > > 5:30pm - Integrity
> > > > - Check database integrity, include indexes, attempt to
repair
> > any
> > > > minor problems
> > > Big no-no. Go ahead and run the checks, but don't attempt to repair.
> All
> > > you will do is mask the early stages of a problem until it gets too
big
> > for
> > > DBCC to fix.
> > >
> > > >
> > > > 6:00pm - Transaction Log Backup
> > > > - Backup the transaction log of the database as part of the
> > > > maintenance plan
> > > > - Verify the integrity of the backup upon completion
> > > Yes.
> > > >
> > > > 7:00pm - Complete Backup
> > > > - back up the database as part of the maintenance plan
> > > > - verify the integrity of the backup upon completion
> > > Yes.
> > > >
> > > > After reviewing this, which I did not create ;) , Would in help
my
> > > cause
> > > > if I were to move the Optimization to some other plan that runs once
a
> > > week
> > > > on perhaps a weekend when backups are not running? If backing up
> should
> > > not
> > > > lock the DB then could it be the Optimization that is taking 15
hours
> > and
> > > > locking it?
> > > >
> > > > -Scott
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote
> > > in
> > > > message news:O%23pUFIgtEHA.2536@.TK2MSFTNGP11.phx.gbl...
> > > > > Are you certain that it really is backup that is blocking? Have
you
> > > > verified using sp_who2 etc?
> > > > > Backup shouldn't block, perhaps you in the same job is doing some
> > shrink
> > > > or defrag?
> > > > >
> > > > > --
> > > > > Tibor Karaszi, SQL Server MVP
> > > > > http://www.karaszi.com/sqlserver/default.asp
> > > > > http://www.solidqualitylearning.com/
> > > > >
> > > > >
> > > > > "Scott Elgram" <SElgram@.verifpoint.com> wrote in message
> > > > > news:%23EiS8cftEHA.1272@.TK2MSFTNGP12.phx.gbl...
> > > > > > Hello,
> > > > > > I have one particular SQL 7 database that is rather large,
over
> > 100
> > > > > > gigs. Most of this is in one table which is full of blobs.
This
> > > > database
> > > > > > is mission critical stuff and is backed up every night.
However,
> as
> > > of
> > > > > > recent this backup is taking almost 15 hours to complete
sometimes
> > and
> > > > when
> > > > > > it's running the DB can't be accessed which is causing problems.
> > Can
> > > > anyone
> > > > > > suggest a solution to keeping this backup time to a minimum?
> > > > > >
> > > > > > --
> > > > > > -Scott Elgram
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>