Showing posts with label wizard. Show all posts
Showing posts with label wizard. Show all posts

Thursday, March 8, 2012

Backup or move transaction logs to another server.

Can anyone advice me:
I'm backing up my transaction logs every 2 hours using the SQL Server
database management wizard.
I only keep the logs for two days before the wizard automatically
deletes the ones which are older than two days.
I want to include into the routine a process which will move the
transaction logs to a different server, but will also delete the logs
on the other server if they are older than 2 days. Is this possible?
Or is it possible to set SQL Server to backup the transaction logs to
another server using the wizard or some other means. I can only see
the local driver on the server, even if I've mapped one.
Many thanks in advancethis is from google.com
the default backup folder path is stored in the regisrty at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector
y
for a default SQL Server installation. You can edit the value by specifying
the required valid path.
Becareful while editing the registry.
--
HTH,
Vyas, MVP (SQL Server)
"Allan Martin" <allanmartin@.ntlworld.com> wrote in message
news:a6d765d6.0401200822.415cb11c@.posting.google.com...
quote:

> Can anyone advice me:
> I'm backing up my transaction logs every 2 hours using the SQL Server
> database management wizard.
> I only keep the logs for two days before the wizard automatically
> deletes the ones which are older than two days.
> I want to include into the routine a process which will move the
> transaction logs to a different server, but will also delete the logs
> on the other server if they are older than 2 days. Is this possible?
> Or is it possible to set SQL Server to backup the transaction logs to
> another server using the wizard or some other means. I can only see
> the local driver on the server, even if I've mapped one.
> Many thanks in advance
|||I have the same problem.
How does this solution help? Enterprise Manager still refuses to accept the
UNC address (as shown in BOL "sp_addumpdevice") and although sp_addumpdevice
will accept it (it accepts anything), the backup command complains that it
can't open the backup device. Here's the code:
exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local drive
exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' -- remote
drive
exec sp_addumpdevice 'disk', 'device3', '\\Acqserver\R\Temp\backup.dat' --
same drive, UNC notation
backup database PC_DASC_DB to device1 -- this works
backup database PC_DASC_DB to device2 -- this fails
backup database PC_DASC_DB to device3 -- this fails
TIA,
Wm Schmidt
"ME" <mail@.moon.net> wrote in message
news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
quote:

> this is from google.com
> the default backup folder path is stored in the regisrty at:
>

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector[QUO
TE]
> y
> for a default SQL Server installation. You can edit the value by[/QUOTE]
specifying
quote:

> the required valid path.
> Becareful while editing the registry.
> --
> HTH,
> Vyas, MVP (SQL Server)
>
> "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> news:a6d765d6.0401200822.415cb11c@.posting.google.com...
>
|||if you use the wizard you don't have the choice. SQL wizard backup db and
logs to .BAK and .TRN files
"Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
quote:

> I have the same problem.
> How does this solution help? Enterprise Manager still refuses to accept

the
quote:

> UNC address (as shown in BOL "sp_addumpdevice") and although

sp_addumpdevice
quote:

> will accept it (it accepts anything), the backup command complains that it
> can't open the backup device. Here's the code:
> exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local

drive
quote:

> exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' -- remote
> drive
> exec sp_addumpdevice 'disk', 'device3',

\\Acqserver\R\Temp\backup.dat' --
quote:

> same drive, UNC notation
> backup database PC_DASC_DB to device1 -- this works
> backup database PC_DASC_DB to device2 -- this fails
> backup database PC_DASC_DB to device3 -- this fails
> TIA,
> Wm Schmidt
>
> "ME" <mail@.moon.net> wrote in message
> news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
>

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector[QUO
TE]
> specifying
>[/QUOTE]|||Ok, let's forget EI. I have to use T-SQL for my app anyway. I'm running
this test using the Query Analyzer with the commands shown below. I changed
all the file names to backup.bak but it still doesn't work for network
drives.
"ME" <mail@.moon.net> wrote in message
news:OXJqQS53DHA.1404@.TK2MSFTNGP11.phx.gbl...
quote:

> if you use the wizard you don't have the choice. SQL wizard backup db and
> logs to .BAK and .TRN files
>
> "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
> the
> sp_addumpdevice
it[QUOTE]
> drive
> \\Acqserver\R\Temp\backup.dat' --
>

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector[QUO
TE]
Server
quote:

logs[QUOTE]
to[QUOTE]
>
|||Statements are valid and probably you don't have valid permission on remote
machine.
Does your SQLServerAgent Service have a permission to write on remote
machine?
"Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
news:OnHvwg53DHA.1264@.TK2MSFTNGP11.phx.gbl...
quote:

> Ok, let's forget EI. I have to use T-SQL for my app anyway. I'm running
> this test using the Query Analyzer with the commands shown below. I

changed
quote:

> all the file names to backup.bak but it still doesn't work for network
> drives.
>
> "ME" <mail@.moon.net> wrote in message
> news:OXJqQS53DHA.1404@.TK2MSFTNGP11.phx.gbl...
and[QUOTE]
accept[QUOTE]
that[QUOTE]
> it
remote[QUOTE]
>

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector[QUO
TE]
> Server
> logs
possible?
quote:

> to
see[QUOTE]
>
|||Problem solved. It turns out that MSSQLSERVER was logged on as LocalSystem
(the default when a service is installed). By setting the login to
administrator I was able to successfully do a backup to a remote drive.
Apparently it doesn't matter that the remote drive is shared with full
permissions for Everyone. Or that SQLServerAgent was logged on as
administrator.
Thanks for your help in solving the problem.
William
"Ana Mihalj" <amihalj@.hotmail.com> wrote in message
news:%23COs1X$3DHA.632@.TK2MSFTNGP12.phx.gbl...
quote:

> Statements are valid and probably you don't have valid permission on

remote
quote:

> machine.
> Does your SQLServerAgent Service have a permission to write on remote
> machine?
>
>
>
> "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> news:OnHvwg53DHA.1264@.TK2MSFTNGP11.phx.gbl...
running[QUOTE]
> changed
> and
> accept
> that
local[QUOTE]
> remote
>

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer\BackupDirector[QUO
TE]
automatically
quote:

> possible?
logs[QUOTE]
> see
>

Backup or move transaction logs to another server.

Can anyone advice me:
I'm backing up my transaction logs every 2 hours using the SQL Server
database management wizard.
I only keep the logs for two days before the wizard automatically
deletes the ones which are older than two days.
I want to include into the routine a process which will move the
transaction logs to a different server, but will also delete the logs
on the other server if they are older than 2 days. Is this possible?
Or is it possible to set SQL Server to backup the transaction logs to
another server using the wizard or some other means. I can only see
the local driver on the server, even if I've mapped one.
Many thanks in advancethis is from google.com
the default backup folder path is stored in the regisrty at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
y
for a default SQL Server installation. You can edit the value by specifying
the required valid path.
Becareful while editing the registry.
--
HTH,
Vyas, MVP (SQL Server)
"Allan Martin" <allanmartin@.ntlworld.com> wrote in message
news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> Can anyone advice me:
> I'm backing up my transaction logs every 2 hours using the SQL Server
> database management wizard.
> I only keep the logs for two days before the wizard automatically
> deletes the ones which are older than two days.
> I want to include into the routine a process which will move the
> transaction logs to a different server, but will also delete the logs
> on the other server if they are older than 2 days. Is this possible?
> Or is it possible to set SQL Server to backup the transaction logs to
> another server using the wizard or some other means. I can only see
> the local driver on the server, even if I've mapped one.
> Many thanks in advance|||I have the same problem.
How does this solution help? Enterprise Manager still refuses to accept the
UNC address (as shown in BOL "sp_addumpdevice") and although sp_addumpdevice
will accept it (it accepts anything), the backup command complains that it
can't open the backup device. Here's the code:
exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local drive
exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' -- remote
drive
exec sp_addumpdevice 'disk', 'device3', '\\Acqserver\R\Temp\backup.dat' --
same drive, UNC notation
backup database PC_DASC_DB to device1 -- this works
backup database PC_DASC_DB to device2 -- this fails
backup database PC_DASC_DB to device3 -- this fails
TIA,
Wm Schmidt
"ME" <mail@.moon.net> wrote in message
news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
> this is from google.com
> the default backup folder path is stored in the regisrty at:
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
> y
> for a default SQL Server installation. You can edit the value by
specifying
> the required valid path.
> Becareful while editing the registry.
> --
> HTH,
> Vyas, MVP (SQL Server)
>
> "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> > Can anyone advice me:
> >
> > I'm backing up my transaction logs every 2 hours using the SQL Server
> > database management wizard.
> > I only keep the logs for two days before the wizard automatically
> > deletes the ones which are older than two days.
> >
> > I want to include into the routine a process which will move the
> > transaction logs to a different server, but will also delete the logs
> > on the other server if they are older than 2 days. Is this possible?
> > Or is it possible to set SQL Server to backup the transaction logs to
> > another server using the wizard or some other means. I can only see
> > the local driver on the server, even if I've mapped one.
> >
> > Many thanks in advance
>|||if you use the wizard you don't have the choice. SQL wizard backup db and
logs to .BAK and .TRN files
"Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
> I have the same problem.
> How does this solution help? Enterprise Manager still refuses to accept
the
> UNC address (as shown in BOL "sp_addumpdevice") and although
sp_addumpdevice
> will accept it (it accepts anything), the backup command complains that it
> can't open the backup device. Here's the code:
> exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local
drive
> exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' -- remote
> drive
> exec sp_addumpdevice 'disk', 'device3',
\\Acqserver\R\Temp\backup.dat' --
> same drive, UNC notation
> backup database PC_DASC_DB to device1 -- this works
> backup database PC_DASC_DB to device2 -- this fails
> backup database PC_DASC_DB to device3 -- this fails
> TIA,
> Wm Schmidt
>
> "ME" <mail@.moon.net> wrote in message
> news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
> > this is from google.com
> >
> > the default backup folder path is stored in the regisrty at:
> >
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
> > y
> > for a default SQL Server installation. You can edit the value by
> specifying
> > the required valid path.
> >
> > Becareful while editing the registry.
> > --
> > HTH,
> > Vyas, MVP (SQL Server)
> >
> >
> > "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> > news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> > > Can anyone advice me:
> > >
> > > I'm backing up my transaction logs every 2 hours using the SQL Server
> > > database management wizard.
> > > I only keep the logs for two days before the wizard automatically
> > > deletes the ones which are older than two days.
> > >
> > > I want to include into the routine a process which will move the
> > > transaction logs to a different server, but will also delete the logs
> > > on the other server if they are older than 2 days. Is this possible?
> > > Or is it possible to set SQL Server to backup the transaction logs to
> > > another server using the wizard or some other means. I can only see
> > > the local driver on the server, even if I've mapped one.
> > >
> > > Many thanks in advance
> >
> >
>|||Ok, let's forget EI. I have to use T-SQL for my app anyway. I'm running
this test using the Query Analyzer with the commands shown below. I changed
all the file names to backup.bak but it still doesn't work for network
drives.
"ME" <mail@.moon.net> wrote in message
news:OXJqQS53DHA.1404@.TK2MSFTNGP11.phx.gbl...
> if you use the wizard you don't have the choice. SQL wizard backup db and
> logs to .BAK and .TRN files
>
> "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
> > I have the same problem.
> >
> > How does this solution help? Enterprise Manager still refuses to accept
> the
> > UNC address (as shown in BOL "sp_addumpdevice") and although
> sp_addumpdevice
> > will accept it (it accepts anything), the backup command complains that
it
> > can't open the backup device. Here's the code:
> >
> > exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local
> drive
> > exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' -- remote
> > drive
> > exec sp_addumpdevice 'disk', 'device3',
> \\Acqserver\R\Temp\backup.dat' --
> > same drive, UNC notation
> >
> > backup database PC_DASC_DB to device1 -- this works
> >
> > backup database PC_DASC_DB to device2 -- this fails
> >
> > backup database PC_DASC_DB to device3 -- this fails
> >
> > TIA,
> > Wm Schmidt
> >
> >
> > "ME" <mail@.moon.net> wrote in message
> > news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
> > > this is from google.com
> > >
> > > the default backup folder path is stored in the regisrty at:
> > >
> >
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
> > > y
> > > for a default SQL Server installation. You can edit the value by
> > specifying
> > > the required valid path.
> > >
> > > Becareful while editing the registry.
> > > --
> > > HTH,
> > > Vyas, MVP (SQL Server)
> > >
> > >
> > > "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> > > news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> > > > Can anyone advice me:
> > > >
> > > > I'm backing up my transaction logs every 2 hours using the SQL
Server
> > > > database management wizard.
> > > > I only keep the logs for two days before the wizard automatically
> > > > deletes the ones which are older than two days.
> > > >
> > > > I want to include into the routine a process which will move the
> > > > transaction logs to a different server, but will also delete the
logs
> > > > on the other server if they are older than 2 days. Is this possible?
> > > > Or is it possible to set SQL Server to backup the transaction logs
to
> > > > another server using the wizard or some other means. I can only see
> > > > the local driver on the server, even if I've mapped one.
> > > >
> > > > Many thanks in advance
> > >
> > >
> >
> >
>|||Statements are valid and probably you don't have valid permission on remote
machine.
Does your SQLServerAgent Service have a permission to write on remote
machine?
"Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
news:OnHvwg53DHA.1264@.TK2MSFTNGP11.phx.gbl...
> Ok, let's forget EI. I have to use T-SQL for my app anyway. I'm running
> this test using the Query Analyzer with the commands shown below. I
changed
> all the file names to backup.bak but it still doesn't work for network
> drives.
>
> "ME" <mail@.moon.net> wrote in message
> news:OXJqQS53DHA.1404@.TK2MSFTNGP11.phx.gbl...
> > if you use the wizard you don't have the choice. SQL wizard backup db
and
> > logs to .BAK and .TRN files
> >
> >
> > "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> > news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
> > > I have the same problem.
> > >
> > > How does this solution help? Enterprise Manager still refuses to
accept
> > the
> > > UNC address (as shown in BOL "sp_addumpdevice") and although
> > sp_addumpdevice
> > > will accept it (it accepts anything), the backup command complains
that
> it
> > > can't open the backup device. Here's the code:
> > >
> > > exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' -- local
> > drive
> > > exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' --
remote
> > > drive
> > > exec sp_addumpdevice 'disk', 'device3',
> > \\Acqserver\R\Temp\backup.dat' --
> > > same drive, UNC notation
> > >
> > > backup database PC_DASC_DB to device1 -- this works
> > >
> > > backup database PC_DASC_DB to device2 -- this fails
> > >
> > > backup database PC_DASC_DB to device3 -- this fails
> > >
> > > TIA,
> > > Wm Schmidt
> > >
> > >
> > > "ME" <mail@.moon.net> wrote in message
> > > news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
> > > > this is from google.com
> > > >
> > > > the default backup folder path is stored in the regisrty at:
> > > >
> > >
> >
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
> > > > y
> > > > for a default SQL Server installation. You can edit the value by
> > > specifying
> > > > the required valid path.
> > > >
> > > > Becareful while editing the registry.
> > > > --
> > > > HTH,
> > > > Vyas, MVP (SQL Server)
> > > >
> > > >
> > > > "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> > > > news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> > > > > Can anyone advice me:
> > > > >
> > > > > I'm backing up my transaction logs every 2 hours using the SQL
> Server
> > > > > database management wizard.
> > > > > I only keep the logs for two days before the wizard automatically
> > > > > deletes the ones which are older than two days.
> > > > >
> > > > > I want to include into the routine a process which will move the
> > > > > transaction logs to a different server, but will also delete the
> logs
> > > > > on the other server if they are older than 2 days. Is this
possible?
> > > > > Or is it possible to set SQL Server to backup the transaction logs
> to
> > > > > another server using the wizard or some other means. I can only
see
> > > > > the local driver on the server, even if I've mapped one.
> > > > >
> > > > > Many thanks in advance
> > > >
> > > >
> > >
> > >
> >
> >
>|||Problem solved. It turns out that MSSQLSERVER was logged on as LocalSystem
(the default when a service is installed). By setting the login to
administrator I was able to successfully do a backup to a remote drive.
Apparently it doesn't matter that the remote drive is shared with full
permissions for Everyone. Or that SQLServerAgent was logged on as
administrator.
Thanks for your help in solving the problem.
William
"Ana Mihalj" <amihalj@.hotmail.com> wrote in message
news:%23COs1X$3DHA.632@.TK2MSFTNGP12.phx.gbl...
> Statements are valid and probably you don't have valid permission on
remote
> machine.
> Does your SQLServerAgent Service have a permission to write on remote
> machine?
>
>
>
> "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> news:OnHvwg53DHA.1264@.TK2MSFTNGP11.phx.gbl...
> > Ok, let's forget EI. I have to use T-SQL for my app anyway. I'm
running
> > this test using the Query Analyzer with the commands shown below. I
> changed
> > all the file names to backup.bak but it still doesn't work for network
> > drives.
> >
> >
> > "ME" <mail@.moon.net> wrote in message
> > news:OXJqQS53DHA.1404@.TK2MSFTNGP11.phx.gbl...
> > > if you use the wizard you don't have the choice. SQL wizard backup db
> and
> > > logs to .BAK and .TRN files
> > >
> > >
> > > "Wm" <wschmidt@.egginc_SpamBlocker_.com> wrote in message
> > > news:OKVnQG53DHA.4060@.TK2MSFTNGP11.phx.gbl...
> > > > I have the same problem.
> > > >
> > > > How does this solution help? Enterprise Manager still refuses to
> accept
> > > the
> > > > UNC address (as shown in BOL "sp_addumpdevice") and although
> > > sp_addumpdevice
> > > > will accept it (it accepts anything), the backup command complains
> that
> > it
> > > > can't open the backup device. Here's the code:
> > > >
> > > > exec sp_addumpdevice 'disk', 'device1', 'C:\Temp\backup.dat' --
local
> > > drive
> > > > exec sp_addumpdevice 'disk', 'device2', 'R:\Temp\backup.dat' --
> remote
> > > > drive
> > > > exec sp_addumpdevice 'disk', 'device3',
> > > \\Acqserver\R\Temp\backup.dat' --
> > > > same drive, UNC notation
> > > >
> > > > backup database PC_DASC_DB to device1 -- this works
> > > >
> > > > backup database PC_DASC_DB to device2 -- this fails
> > > >
> > > > backup database PC_DASC_DB to device3 -- this fails
> > > >
> > > > TIA,
> > > > Wm Schmidt
> > > >
> > > >
> > > > "ME" <mail@.moon.net> wrote in message
> > > > news:%23WzsUn33DHA.3216@.TK2MSFTNGP11.phx.gbl...
> > > > > this is from google.com
> > > > >
> > > > > the default backup folder path is stored in the regisrty at:
> > > > >
> > > >
> > >
> >
>
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\BackupDirector
> > > > > y
> > > > > for a default SQL Server installation. You can edit the value by
> > > > specifying
> > > > > the required valid path.
> > > > >
> > > > > Becareful while editing the registry.
> > > > > --
> > > > > HTH,
> > > > > Vyas, MVP (SQL Server)
> > > > >
> > > > >
> > > > > "Allan Martin" <allanmartin@.ntlworld.com> wrote in message
> > > > > news:a6d765d6.0401200822.415cb11c@.posting.google.com...
> > > > > > Can anyone advice me:
> > > > > >
> > > > > > I'm backing up my transaction logs every 2 hours using the SQL
> > Server
> > > > > > database management wizard.
> > > > > > I only keep the logs for two days before the wizard
automatically
> > > > > > deletes the ones which are older than two days.
> > > > > >
> > > > > > I want to include into the routine a process which will move the
> > > > > > transaction logs to a different server, but will also delete the
> > logs
> > > > > > on the other server if they are older than 2 days. Is this
> possible?
> > > > > > Or is it possible to set SQL Server to backup the transaction
logs
> > to
> > > > > > another server using the wizard or some other means. I can only
> see
> > > > > > the local driver on the server, even if I've mapped one.
> > > > > >
> > > > > > Many thanks in advance
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>

Friday, February 24, 2012

backup Maintenance wizard

Will Trans. logs backup options be in the wizard in sp2?

At this point there are no options to backup trans. logs every 1hr and deleting files over x amount of days old without doing a TSQL command correct?

To clarify, in 2k enterprise, it's in the maintenance plan. I can specify that info and give it the trn extension and folder to backup into.

I am a network admin being given sql duties now, so If I may seem like a beginner, it's because I am.

I did to a search for this topic, so forgive me if there is one i did not find.

Also, I was trying to submit feedback as requested for sp2 about this, but i did not see a button on the bottom of the search through feedback as stated.

You can do transaction log backups along with differential backups in a maintenance plan. You have to add a Backup database task. Then you can configure the backup type within the task. (It's the third field from the top in the dialog.)|||Probably looking for a similar option ion SQL Server 2000. I had a hard time myself way back.|||

You can back up Transaction logs every hour if you want to, just set up a job to back them up as often as you wish, for example:

http://img.photobucket.com/albums/v472/Schmedrick/backuptranslog.gif

You can also delete backup files older than "x" days by adding a maintenance cleanup task to your maintenance plan after it has been created, this does require that SP1 has been installed, for example:

http://img.photobucket.com/albums/v472/Schmedrick/mainttask.gif

|||

Is there a way to run hourly transaction log backups while backing up the database once a day in ONE maintenance plan (like SQL2000)? Or do we have to create one maintenance plan for the full backup and another one for the transaction log backups.

|||

No. A maintenance plan is generated as a single monolithic SSIS package. That means the entire package has a single schedule. If you have multiple tasks in the maintenance plan, they will all run on the same schedule. So, in 2005, you have to create a separate maintenance plan for each group of tasks that need to have a distinct schedule. It is for this reason, that I do not recommend using maintenance plans at all and simply writing the code for this stuff yourself. I also don't like the fact that I have to enlist the SSIS engine, so now running my backups has a dependency on the SSIS engine as well as the security access of the SSIS engine. If something happens to SSIS, my backups no longer run. Can you tell that I absolutely hate the new maintenance plans in 2005? It takes something that was very simple and very straightforward and turned it into a mess than has to transit multiple subsystems in order to perform and VERY straightforward task.

Below is the set of code that I use for backing up databases along with a procedure to clean up the backup history and backup files. All T-SQL. Simple, straightforward, and it is smart enough to not try to issue a tran log backup against a database that is in simple recovery model. All you have to do is create the jobs to call the backup and clean-up based on the type of backup you want to run and the frequency you want it to run on.

CREATE TABLE [dbo].[backupfiles](

[DatabaseName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[BackupFileName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[CreationDate] [datetime] NULL

) ON [PRIMARY]

GO

CREATE procedure [dbo].[asp_backup]

@.dir varchar(50), @.type char(1)

as

/****************************************************************/

/* Stored Procedure: asp_backup */

/* Creation Date: 4/01/2006 */

/* Written by: Mike Hotek - MHS Enterprises, Inc. */

/* http://www.mssqlserver.com */

/* Copyright: 2006 MHS Enterprises, Inc. All Rights Reserved */

/* Code can be used in its entirety, free of charge. Code can*/

/* not be incorporated into other products that are for sale. */

/* This copyright notice must remain intact when used. */

/* Code is provided as-is, without warranties. It is the */

/* user's sole responsibility to test this code for */

/* suitability in their environment. */

/* */

/* Purpose: Executes full, differential, and tran log backups */

/* */

/* Input Parameters: */

/* @.dir directory for the backup */

/* @.type backup type */

/* */

/* Output Parameters: None */

/* */

/* Return Status: 0 success */

/* -1 failure */

/* */

/* Usage: exec asp_backup 'c:\data','T' */

/* Executes a transaction log backup against each */

/* database that is in full recovery model and drops the */

/* backups in the directory c:\data */

/* */

/* Local Variables: */

/* */

/* Called By: SQL Server Agent job */

/* */

/* Calls: None */

/* */

/* Data Modifications: */

/* Inserts into the blockedprocess table */

/* */

/* Updates: */

/* Date Author Purpose */

/* 4/01/06 Mike Hotek Created */

/****************************************************************/

declare @.filename varchar(255),

@.database varchar(255),

@.recovery int,

@.command nvarchar(1000)

--Error checking

if @.dir is null

begin

print 'You must specify a directory path'

return

end

if @.type not in ('F','D','T')

begin

print 'Valid backup types are F, D, and T'

return

end

--Format directory path

if right(@.dir,1) != '\'

set @.dir = @.dir + '\'

set @.command = null

declare curdb cursor for

select name, status from master.dbo.sysdatabases where name not in ('tempdb','model')

for read only

open curdb

fetch curdb into @.database, @.recovery

while @.@.fetch_status = 0

begin

--Format filename. Functions needed to work around single digit month, day, minute, etc.

set @.filename = @.dir + @.database + '_' + cast(datepart(yyyy,getdate()) as char(4)) +

right('0' + rtrim(cast(datepart(mm,getdate()) as char(2))),2) +

right('0' + rtrim(cast(datepart(dd,getdate()) as char(2))),2) +

right('0' + rtrim(cast(datepart(hh,getdate()) as char(2))),2) +

right('0' + rtrim(cast(datepart(mi,getdate()) as char(2))),2) +

right('0' + rtrim(cast(datepart(ss,getdate()) as char(2))),2)

set @.filename = @.filename + case when @.type = 'F' then '_full.bak'

when @.type = 'D' then '_diff.bak'

else '.trn' end

--Format backup command

if @.type = 'F'

begin

set @.command = 'backup database [' + @.database + '] to disk = ''' + @.filename + ''' with init'

end

else if @.type = 'D' and @.database != 'master'

begin

set @.command = 'backup database [' + @.database + '] to disk = ''' + @.filename + ''' with differential, init'

end

else if @.type = 'T' and DATABASEPROPERTYEX(@.database, N'RECOVERY') = 'Full'

begin

set @.command = 'backup log [' + @.database + '] to disk = ''' + @.filename + ''' with init'

end

--Execute backup

if @.command is not null

begin

print @.command

exec sp_executesql @.command

end

insert into dbo.backupfiles

(DatabaseName, BackupFileName, CreationDate)

values(@.database, @.filename, getdate())

set @.command = null

fetch curdb into @.database, @.recovery

end

close curdb

deallocate curdb

GO

CREATE procedure [dbo].[asp_bakfilecleanup] @.backupretention int,

@.historyretention int

as

/****************************************************************/

/* Stored Procedure: asp_bakfilecleanup */

/* Creation Date: 4/01/2006 */

/* Written by: Mike Hotek - MHS Enterprises, Inc. */

/* http://www.mssqlserver.com */

/* Copyright: 2006 MHS Enterprises, Inc. All Rights Reserved */

/* Code can be used in its entirety, free of charge. Code can*/

/* not be incorporated into other products that are for sale. */

/* This copyright notice must remain intact when used. */

/* Code is provided as-is, without warranties. It is the */

/* user's sole responsibility to test this code for */

/* suitability in their environment. */

/* */

/* Purpose: Removes old backup files from the file system. */

/* */

/* Input Parameters: */

/* @.backupretention Number of days to retain backup files */

/* @.historyretention Number of days to retain backup history*/

/* */

/* Output Parameters: None */

/* */

/* Return Status: 0 success */

/* -1 failure */

/* */

/* Usage: exec asp_bakfilecleanup 3,15 */

/* Deletes any backup files older than 3 days and any */

/* backup history older than 15 days */

/* */

/* Local Variables: */

/* */

/* Called By: SQL Server Agent job */

/* */

/* Calls: None */

/* */

/* Data Modifications: */

/* Deletes rows from the backupfiles table */

/* */

/* Updates: */

/* Date Author Purpose */

/* 5/10/06 Mike Hotek Created */

/****************************************************************/

--This is wired to a logging table simply to avoid messy code in

--parsing file names or pulling fiel attributes to figure out which

--files to purge

declare @.file varchar(255),

@.command varchar(1000)

if @.backupretention is null

begin

print 'You must specify a retention interval'

return

end

if @.historyretention is null

begin

print 'You must specify a retention interval'

return

end

--Pull the list of files that are older than the retention

-- Construct a del command for each file and execute it.

declare curfile cursor for select BackupFileName from dbo.backupfiles

where CreationDate < dateadd(dd,-@.backupretention,getdate())

for read only

open curfile

fetch curfile into @.file

while @.@.fetch_status = 0

begin

set @.command = 'exec master.dbo.xp_cmdshell ''del ' + @.file + ''''

exec(@.command)

fetch curfile into @.file

end

--Clean up objects that were created

close curfile

deallocate curfile

delete from backupfiles

where CreationDate < dateadd(dd,-@.historyretention,getdate())

GO

Thursday, February 16, 2012

backup log

I'm trying to export my database to a server (WebMatrixHosting.net) ...
So I'm using the DTS - Import/Export Wizard of MSSQL Tools ...
It generates the script ok, but when the copy starts I receive an error: Failed to copy objects from SQL Server to SQL Server ...
Looking at the log file I found out the error: BACKUP LOG permission denied in database 'database_name' ...
So I set Backup log permission using the Enterprise Manager to my database. But the error remains.
What's wrong and how to fix it?
ThanksCont.

I set Backup log permission for my database locally, not the database_name that is returning an error. (stupid isn't?)
I need the command line to set permission for the backup log for database_name (using the query analyser), because I'm unable to use Enterprise Manager.
Thanks

Monday, February 13, 2012

Backup jobs and restores reporting false success!

Below are the problems I am having with my SQL 7.0
server. The first problem is backup jobs created with
the backup wizard and scheduled with the backup wizard
fail. The latest problem I discovered is my databases
can not be restored. The restore problem is very
critical to solve.
I tested restoring a database and the system reports the
database is restore sucessfully but it does not. The
sysdatabase does not show an entry for the restored
database. When I close Enterprise Manager and reopen the
database is gone. The mdf file is still in the data
directory. What is wrong with my sql server.
I can restore the database from the same file on my SQL
2000 server but it fail on every one of the SQL 7.0
servers. The production 7.0 SQL server and the 7.0 SQL
server on my laptop computer.
Kathy
The first point you made really made sense to me. I knew
transactions rolled back but never thought about a backup
job rolling back. I did as you suggested. I created a
backup device and backup a database (and restored it)
using T-SQL code. Of course this worked, because it is
not a job scheduled using the backup wizard interface. I
can always manually backup a database by right clicking,
choicing "All Task" and "Backup Database." But as soon
as I ran it as a scheduled job it will failed, or SQL
would reported it as suceeding with no BAK file.
So, I decided to create a backup job manually. It
worked!!! Then I scheduled it through the job interfaced
and it ran as scheduled.
To clarify this to you:
Backup Job FAILS when I do the following steps:
Create a backup device, i.e. otg_backupdevice
Right click on the new backup device (otg_backupdevice)
and select "Backup a Database"
The SQL Server backup wizard window appears, select the
database (otg) to backup, add the backup device
(otg_backupdevice) and schedule the backup to occur once
a day at 12:00 A.M.
Then ran the job from the jobs window
The job fails.
Backup Job Succeeds when I do the following steps:
Create a backup device, i.e. otg_backupdevice
Go to the job window
Right-click and select new job
Name the job - OTG backup to device
Click on the "Steps" tab and click on "New Step"
Select OTG as the database
In the command window I enter "backup database otg to
otg_backupdevice
Click on the "Schedule" tab and schedule it to backup at
10:00 am
The job suceeds
I suspect there is a problem with the backup wizard'
I am experiencing the same behavior on my SQL Server 7.0
running on NT (lastest service packs and patched on
both.) I too have witnessed the BAK file created and
then
deleted. I do not have the maintance plan configured to
deleting old .BAK files. I do receive this error message
when I create a backup from the "backup" option (not the
database maintenance plan.) This is the message I get:
10 percent backed up. [SQLSTATE 01000] (Message 3211) 20
percent backed up. [SQLSTATE 01000] (Message 3211)
ConnectionRead (WrapperRead()). [SQLSTATE 01000] (Message
258) General network error. Check your network
documentation. [SQLSTATE 08S01] (Error 11) 30 percent
backed up. [SQLSTATE 01000] (Message 3211). The step
failed.
NOTE: I am backing up to the server harddrive(NO NETWORK
INVOLVED!!!)with 20 gigs free. This database is only
199mb in size. I suspect the "general network error" is
bogus.
Please help!
>--Original Message--
>been researching a problem I discovered yesterday on the
>SQLSever 7.0 I administer. I discovered Call Heller
>posted a problem very similar to what I am
experiencing.
>
>Every morning I check to see if my SQL backup jobs run.
>No errors are reported. Yesterday, I was ask to restore
a
>database and discovered there was not output file i.e.
>teachercert_db_200308201656.BAK. I viewed job log,
>backup maintenance plan history and event viewer, all
>reported that the output file was created. Now, if I go
>in and manual backup the database directly from the
>database "All Task" option, an output file is created.
>
>Next I discovered all the database maintenance plans I
>viewed on changed yesterday, did not generate an output
>file when the scheduled job ran.
>
>My questions are:
>
>1. Why is the job not generating a output file and
all
>log report the output file was created?
>2. How do I open a case with Microsoft
>
>I'd appreciate any help you can offer.
>
>Kathy Long
>
>.
>It seems that you can create a backup job successfully just have
problems with the wizard.
Do you mean the maintenance exe? I always advise against using that so I
would say stick with simplest solution.
Instead of creating a device use backup dateabase dbname to disk = ...
This will create a backup file for you.
I always include the date and time in the filename to make
administration easier.
Here is an SP that will backup all databases on a server - you can get
some ideas from that:
http://www.nigelrivett.net/BackupAllDatabases.html
Nigel Rivett
www.nigelrivett.net
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Hi Kathy,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.
About the backup wizard to backup the database, I have provided solution
and you can try the steps I provided and if there is any problem, please
feel free to post any new message in that post and I am pleased and ready
to provide support there.
In this post, I will assist you to solve the prolem of restore your
database in SQL Server 7.0. I will work on it today. But please go to the
old post to check if the backup problem is solved.
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||Hi Kathy,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.
From the information you provided, your problem should be:
You want to restore database from a file. This process succeeded in SQL
Server 2000 but failed in SQL Server 7.
Actually, because the information you provide is so limited, I cannot give
an answer or solution this time. I wonder if you could provide the
information below for further analysis:
1) When using the Enterprise Manager to restore the database, what steps
have you taken? Could you give me more detailed information? Because you
just said you restored a database, but it is gone. I just want to the
detailed information of how you carry out this restore process, by T-SQL or
by Wizard? Have you got any message indicate that the restore is successful
or failed, what is these messages? Could you provide the System and
Application logs together with the output of SQLDiag if they are available
to you?
2) What kind of file you are using in this backup process? Is the file you
used the MDF file you mentioned above? If not, is it a SQL Server 2000
backup file or a SQL Server 7 backup file?
The feedback from you will be great helpful in clarifying the problem you
encountered and for us to analysis. I am waiting on your response and ready
to provide further help!
Best regards
Baisong Wei
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||1. Steps to Enterprise manager is to right click on the
database to restore the backup file to and select the
file I want to use. Then on the Option tab I choice to
restore over the current database and change the path to
E:\Data\Test.mdb. The system clains it restore correctly
but when I attempt to open up the database I receive this
message: Error 911- could not locate entry in
sysdatabase 'Test.' No entry found with that name. Make
sure that the name is entered correctly.
I know the database is there because I still see it in
the file folder.
2. The file is created with SQL Server 7.0. I've used
backup devices and files.
When I do a manual using T-SQL restore to the same
database with the following command
RESTORE DATABASE PBDMI
FROM DISK = 'H:\PBDMI.bak'
I receive the following info in my results pane.
Processed 28968 pages for database 'PBDMI',
file 'PBDMI_Data' on file 1.
[Microsoft][ODBC SQL Server Driver][DBNETLIB]
ConnectionRead (WrapperRead()).
[Microsoft][ODBC SQL Server Driver][DBNETLIB]General
network error. Check your network documentation.
Processed 1 pages for database 'PBDMI', file 'PBDMI_Log'
on file 1.
Connection Broken
The database actually restores because I've deleted a row
in one of the tables and it comes back after the
restore. No luck restoring to a different database.
When I run the code to restore to a different database:
BACKUP DATABASE PBDMI
TO DISK = 'H:\PBDMI.bak'
RESTORE FILELISTONLY
FROM DISK = 'H:\PBDMI.bak'
RESTORE DATABASE PBDMI_New
FROM DISK = 'H:\PBDMI.bak'
WITH MOVE 'PBDMI' TO 'E:\Data\PBDMI_New_Data.mdf',
MOVE 'PBDMI_log' TO 'E:\Data\PBDMI_New_Log.ldf',
REPLACE
GO
Here is the message I receive. I pretty sure our
language is US-English
Changed language setting to us_english.
Processed 28968 pages for database 'PBDMI',
file 'PBDMI_Data' on file 6.
Processed 1 pages for database 'PBDMI', file 'PBDMI_Log'
on file 6.
Backup or restore operation successfully processed 28969
pages in 38.095 seconds (6.229 MB/sec).
LogicalName
PhysicalName
Type
FileGroupName
Size
MaxSize
----
----
-- ---
----
----
----
--- --
-- ----
----
-- -- --
--
PBDMI_Data
e:\data\PBDMI_Data.MDF
D
PRIMARY
240582656 35184372080640
PBDMI_Log
e:\data\PBDMI_Log.LDF
L
NULL
704905216 35184372080640
(2 row(s) affected)
Server: Msg 3234, Level 16, State 2, Line 9
File 'PBDMI' is not a database file for
database 'PBDMI_New'.
Server: Msg 3013, Level 16, State 1, Line 9
Backup or restore operation terminating abnormally.
I cannot send any file to your email address.
Thanks for your help.
Kathy
>--Original Message--
>Hi Kathy,
> Thank you for using MSDN Newsgroup! It's my pleasure to
assist you with
>your issue.
> From the information you provided, your problem should
be:
>You want to restore database from a file. This process
succeeded in SQL
>Server 2000 but failed in SQL Server 7.
>
>Actually, because the information you provide is so
limited, I cannot give
>an answer or solution this time. I wonder if you could
provide the
>information below for further analysis:
>1) When using the Enterprise Manager to restore the
database, what steps
>have you taken? Could you give me more detailed
information? Because you
>just said you restored a database, but it is gone. I
just want to the
>detailed information of how you carry out this restore
process, by T-SQL or
>by Wizard? Have you got any message indicate that the
restore is successful
>or failed, what is these messages? Could you provide
the System and
>Application logs together with the output of SQLDiag if
they are available
>to you?
>2) What kind of file you are using in this backup
process? Is the file you
>used the MDF file you mentioned above? If not, is it a
SQL Server 2000
>backup file or a SQL Server 7 backup file?
> The feedback from you will be great helpful in
clarifying the problem you
>encountered and for us to analysis. I am waiting on your
response and ready
>to provide further help!
>
>Best regards
>Baisong Wei
> Microsoft Online Support
>----
>Get Secure! - www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>Please reply to newsgroups only. Thanks.
>
>.
>

Backup job permissions...

What roles/permissions can you give a login in SQL Server
to allow him/her to see the Database Maintenance Wizard
and Backup Jobs in order to check the status?
Thanks,
ThomasHi Thomas,
According to my experience, if the login account that is used to open
Enterprise Manager is not a member of sysadmin server role, he/she cannot
see the following icons under the Management folder.
-Current Activity
-Database Maintenance Plans
-SQL Server Logs
So you may give the login sysadmin permission.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sincerely,
William Wang
Microsoft Partner Online Support
| Content-Class: urn:content-classes:message
| From: "Thomas.LeBlanc" <Thomas.LeBlanc@.NoSpam.Com>
| Sender: "Thomas.LeBlanc" <Thomas.LeBlanc@.NoSpam.Com>
| Subject: Backup job permissions...
| Date: Tue, 29 Jul 2003 14:02:50 -0700
| Lines: 6
| Message-ID: <034101c35614$c51813d0$a501280a@.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNWFMUYCEK3zv1OTuiKQYXOp8kbIQ==| Newsgroups: microsoft.public.sqlserver.server
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.server:298439
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.sqlserver.server
|
| What roles/permissions can you give a login in SQL Server
| to allow him/her to see the Database Maintenance Wizard
| and Backup Jobs in order to check the status?
|
| Thanks,
| Thomas
||||There is a builtin backup_admin role, this may have some
of what you are looking for.
"Thomas.LeBlanc" <Thomas.LeBlanc@.NoSpam.Com> wrote in message
news:034101c35614$c51813d0$a501280a@.phx.gbl...
> What roles/permissions can you give a login in SQL Server
> to allow him/her to see the Database Maintenance Wizard
> and Backup Jobs in order to check the status?
> Thanks,
> Thomas